How ignacio-hernani/vault-cmpv2-demo works
Main Components
• PKI secrets engines set up (mock root CA, intermediate CA, hardware root CA simulation).
• CMPv2 endpoint enabled and configured.
• Authentication configuration using certificates.
• Script/Automation Layer: Represent the three main Bash scripts as distinct steps:
• Setup Script (01-test-cmpv2.sh): Launches Vault, sets up the PKI secrets paths, and configures the endpoints.
• Key and CSR Generation (02-new-rsa-2048-key-csr.sh): Uses OpenSSL to generate a new RSA key and a CSR.
• Initialization Request (03-initialization-request.sh): Uses OpenSSL CMP commands to send the CSR to the Vault CMP endpoint and obtain a new certificate.
• Client Tools:
• OpenSSL: Not just as the tool used via the scripts, but a key component that interfaces with Vault (both for CSR generation and for sending the CMP request).
• Bash Shell/Environment: Where environment variables get set to mediate interaction between scripts and Vault.
Interactions and Data Flow
• Environment Variables: Optionally include a note or a separate “Configuration/Environment” component that represents the export of various environment variables (like VAULT_ADDR, VAULT_TOKEN, paths for certificates, keys, etc.) that tie the flows together.
Architectural Patterns and Principles
• Separation of Concerns: Each script is responsible for a specific part of the demo operation (setup, key generation, CMP request).
• Secure Communication: Use of TLS (explicit in the Vault configuration) should be highlighted.
• PKI/CMP Design: Emphasize that Vault is acting as both a Certificate Authority (via PKI secrets engine) and a CMP server.
• External Dependency Use: The reliance on standard utilities (Bash, OpenSSL, curl, jq, nc) to interact with Vault and perform cryptographic operations.
• Data flows: environment setup, CSR/key files creation, CMP IR submission, and certificate retrieval.