How-to & Guides · How-to

How to Manage Secrets, Certificates, and Keys

Centralize issuance, access, rotation, monitoring, and recovery for application secrets, TLS certificates, and cryptographic keys across multiple clouds.

Document class: How-to Guides implementation guide Normative terms: MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are requirements levels. Applicability: Secrets, certificates, keys, issuance, delivery, rotation, revocation, monitoring, and recovery across multiple clouds. Exception process: Deviations require a documented risk assessment, compensating controls, named risk owner, and expiry date.

Control fieldValue
Document IDHTG-22
OwnerCloud Center of Excellence
Review cycleAt least annually and after material cryptography, identity, or provider changes
EvidenceInventory, owner and expiry, access policy, rotation test, certificate health, audit logs, backup or recovery record, and incident response

Decision in brief: Prefer workload identity, centralize unavoidable cryptographic material, and automate its scope, rotation, revocation, and recovery.

Document type: Security and operations guide Primary example: Azure Key Vault with managed identity Operating principle: Prefer identity over secrets; when secret material is unavoidable, make its lifecycle automatic, scoped, observable, and recoverable.

Objective

Prevent credentials and private keys from being embedded in source code, pipeline variables, container images, configuration files, chat, or operator workstations. Establish one governed lifecycle for creation, storage, use, rotation, expiry, revocation, deletion, and evidence.

Classify the material

TypeExamplesRequired handling
SecretPassword, API token, connection stringGenerate randomly, scope narrowly, rotate, never log
CertificateTLS or client-auth certificateTrack issuer, SANs, chain, renewal, deployment, revocation
KeyKMS/HSM encryption or signing keyDefine algorithm, protection level, rotation, usage policy, recovery
Recovery materialBreak-glass credential, root key shareOffline or isolated storage, dual control, test and monitor use

Reference lifecycle

flowchart LR REQUEST[Approved request] --> ISSUE[Generate or issue] ISSUE --> VAULT[Managed vault or HSM] VAULT --> ID[Identity-authorized retrieval] ID --> USE[In-memory workload use] USE --> ROTATE[Automated rotation] ROTATE --> VERIFY[Consumer verification] VERIFY --> REVOKE[Disable old version] REVOKE --> EVIDENCE[Audit and retention]

Implement the control plane

  1. Assign a named owner and rotation SLA to every secret, certificate, and key.
  2. Use separate vault boundaries for production, non-production, tenant, and regulatory scope.
  3. Connect through private endpoints where required and restrict public access.
  4. Authorize workloads with managed identity, IAM role, workload federation, or resource principal.
  5. Separate read, write, rotate, backup, recover, purge, and policy-administration duties.
  6. Enable soft delete, purge protection, versioning, audit logs, expiry alerts, and immutable evidence retention.
  7. Deliver material at runtime through an SDK, sidecar/driver, or short-lived broker; do not copy it into deployment artifacts.
  8. Automate rotation and verify every consumer before disabling the old version.

Provider mapping

CapabilityAzureAWSGCPOCI
SecretsKey Vault secretsSecrets Manager or Parameter StoreSecret ManagerVault secrets
Managed keysKey Vault / Managed HSMKMS / CloudHSMCloud KMS / Cloud HSMVault / KMS / dedicated HSM options
CertificatesKey Vault and managed certificate servicesACM / Private CACertificate Manager / CASCertificates / private CA capabilities
Workload accessManaged identity / federationIAM role and STSWorkload identity / service accountResource or instance principal

Rotation pattern

Use overlapping versions: issue a new version, update consumers, prove successful authentication or decryption, then disable and later destroy the old version according to retention policy. For database credentials, prefer dynamic or identity-based access. For TLS, test the complete chain, SNI, revocation behavior, client trust, and rollback before cutover.

Key rotation does not automatically re-encrypt existing data. Document whether rotation changes only the wrapping key version, requires background re-encryption, or affects signatures that must remain verifiable.

Prevent leakage

  • Run secret scanning before commit and continuously across history and artifacts.
  • Masking is not protection; malicious code can transform or exfiltrate values.
  • Never place production secrets in developer .env files or shared variable groups.
  • Prevent operators from listing secret values unless break-glass access is approved.
  • Scrub sensitive headers and payloads from logs, traces, crash dumps, and support bundles.

Validation

  • Workloads retrieve only their required material with short-lived identity.
  • Network and IAM controls block unauthorized vault access and purge operations.
  • Rotation completes without outage and the retired version no longer authenticates.
  • Expiry, access anomaly, deletion, policy change, and logging failure alerts are tested.
  • Restore and break-glass procedures work under dual control.
  • Repositories, images, pipeline artifacts, state files, and logs contain no secret values.

Incident response

For suspected disclosure, revoke or disable the credential, rotate every derivative credential, isolate the affected workload, preserve evidence, inspect use since the earliest exposure, remove the value from current and historical artifacts through an approved process, and correct the delivery path. Rotation without investigation is incomplete.