Markdown Editor

Secrets Management Standard Template (OWASP, NIST SP 800-57)

Secrets standard: classes, inventory, approved stores, issuance, rotation, workload identity, CI/CD and Kubernetes rules, scanning, leak response, break-glass

보안 엔지니어링전체OWASP Secrets Management Cheat Sheet; NIST SP 800-57 Pt 1 Rev. 5; SP 800-53 Rev. 5CC BY-SA 4.0secretsmanagementstandard

사용법: Use it when you set organisation-wide rules for API keys, passwords, tokens and private keys. Fill the secret classes and approved stores first, then rotation and workload identity. The main pitfall is covering only the vault while secrets leak through code, CI logs, images and chat.

미리보기

Secrets Management Standard: [Organisation name]

Organisation standard for secrets: what counts as a secret, inventory and classes, approved stores, issuance, rotation, dynamic short-lived credentials, workload identity in place of static keys, CI/CD and container rules, secret scanning, leak detection and revocation, break-glass access and audit. Informed by the OWASP Secrets Management Cheat Sheet (CC BY-SA 4.0), NIST SP 800-57 Part 1 Rev. 5 Recommendation for Key Management: Part 1, General (May 2020) for key lifecycle and cryptoperiods, and NIST SP 800-53 Rev. 5 (Release 5.2.0, August 2025) controls IA-5 (authenticator management), SC-12 (cryptographic key establishment and management) and SC-28 (protection of information at rest). Replace every [bracketed] value and every row marked Example. Worked examples use Corvid Commerce, a fictional SaaS company.

Document control

FieldValue
Document ID[SEC-STD-SECRETS-001]
Version[1.0]
Status[Draft / In review / Approved / Superseded]
Owner[@head-of-security-engineering]
Approvers / reviewers[@ciso], [@head-of-platform], [@engineering-directors], [@soc-lead]
Last updatedYYYY-MM-DD
ClassificationInternal
Effective dateYYYY-MM-DD
Parent policy[Information security policy, section [x]]
Applies toAll employees, contractors and suppliers who create, store, use or operate secrets for [Organisation name]
Review cycleAnnually and after any secret-related incident
Next reviewYYYY-MM-DD

Approvals

RoleNameDecisionDate
Chief information security officer[@name][Approved / Changes requested]YYYY-MM-DD
Head of platform engineering[@name][Decision]YYYY-MM-DD
Engineering director (representing product teams)[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft
0.9YYYY-MM-DD[@name]Example: Rotation periods agreed with platform and data teams
1.0YYYY-MM-DD[@name]Example: Approved; static cloud keys for workloads banned for new systems

Contents

1. Purpose and scope

1.1 Purpose

This standard sets the minimum rules for creating, storing, distributing, using, rotating, revoking and auditing secrets so that:

  • no secret is stored in plain text where unauthorised people or systems can read it;
  • every secret has an owner, a class, a store and a lifetime;
  • static long-lived credentials are replaced by short-lived or identity-based access wherever the platform supports it;
  • a leaked secret is detected quickly and revoked before it can be abused.

1.2 What is a secret

A secret is any value that grants access, proves identity or protects data and must stay confidential. Examples: passwords, API keys and tokens, OAuth client secrets, cloud access keys, database credentials, private keys (TLS, SSH, signing, encryption), symmetric data keys, webhook signing secrets, session signing secrets, recovery codes, and connection strings that embed credentials.

1.3 Scope

In scopeOut of scope (covered elsewhere)
Secrets used by applications, services, pipelines, infrastructure and operators in all environments, including development and testEnd-user passwords of customers (see customer identity design)
Secrets held by suppliers on behalf of [Organisation name]Workforce password rules for human sign-in (see identity standard)
Private keys and symmetric keys used by softwareCertificate authority hierarchy design (see PKI and Certificate Architecture, security/pki-certificate-architecture)

2. Roles and responsibilities

ActivitySecurity engineeringPlatform teamSecret owner (service team)SOCEngineering managers
Maintain this standardA/RCCCI
Operate approved stores and their availabilityCA/RIII
Register secrets and keep inventory accurateCCA/RII
Rotate and revoke secretsCR (automation)A/RII
Operate secret scanningA/RR (pipeline integration)ICI
Respond to leaksCRRA (triage, coordination)I
Grant exceptionsACR (request)IC
Report compliance metricsA/RCIII

R = responsible, A = accountable, C = consulted, I = informed.

3. Principles

  1. Eliminate before you protect. Prefer an identity-based or short-lived credential over any stored secret.
  2. Centralise. Secrets live in an approved store, never in code, configuration files, images, tickets or chat.
  3. Least privilege and least lifetime. Each secret grants the minimum access for the minimum time.
  4. One secret, one purpose. Never share a secret between applications, environments or people.
  5. Assume leakage. Design so that a leaked secret is detected, revoked and replaced without an outage.
  6. Automate the lifecycle. Manual rotation is the exception, documented and scheduled.
  7. Audit every access. Reads of high-value secrets are logged and reviewable.

4. Secret classes and inventory

4.1 Secret classes

ClassDefinitionExamplesStoreMonitoring
S1 CriticalCompromise gives broad or privileged control, or access to restricted data across systemsCloud organisation admin credentials, root CA and code-signing private keys, KMS key administration, production database adminHSM or KMS for keys; vault with dual control for credentialsEvery access alerts the SOC
S2 HighCompromise gives access to production data or a production systemService database credentials, payment provider API keys, production TLS private keys, webhook signing secretsVault (production namespace) or cloud secret managerAccess logged; anomalies alert
S3 ModerateCompromise affects non-production or limited, low-sensitivity scopesStaging credentials, read-only monitoring API tokensVault or cloud secret managerAccess logged
S4 LowTest values with no access to real data or systemsLocal development fixtures, mock keysDeveloper local store or test fixtures, never in production storesNone required

4.2 Inventory record

Each S1 to S3 secret MUST have an inventory record, generated where possible from store metadata.

FieldExample (Example)
Secret IDSEC-PAY-014
Name or pathprod/checkout/payment-provider-api-key
ClassS2 High
Owner[@checkout-team]
Consumer(s)checkout-service (production)
StoreVault, namespace prod-checkout
TypeStatic API key (provider does not support OAuth client credentials)
CreatedYYYY-MM-DD
Rotation period90 days (Example)
Last rotatedYYYY-MM-DD
Rotation methodAutomated (dual-key overlap)
Revocation procedureRunbook RB-SEC-014
ExceptionNone

5. Policy statements summary

IDStatementLevel
SM-01Secrets MUST NOT be stored in source code, commit history, infrastructure-as-code files, container images, build logs, wikis, tickets, chat or email.MUST
SM-02S1 to S3 secrets MUST be stored only in an approved store (section 6).MUST
SM-03Each S1 to S3 secret MUST have an owner and an inventory record (section 4.2).MUST
SM-04Secrets MUST NOT be shared across environments, applications or people.MUST
SM-05New workloads MUST use workload identity or dynamic credentials where the platform supports it; static cloud access keys for workloads MUST NOT be created.MUST
SM-06Static secrets MUST be rotated within the period for their class and immediately on suspected exposure or owner departure.MUST
SM-07Access to secrets MUST be granted to identities, not to shared accounts, using least privilege.MUST
SM-08Every repository MUST have secret scanning enabled with push protection where the platform supports it.MUST
SM-09A detected leak of a valid S1 or S2 secret MUST be revoked within the leak response target (section 11.3).MUST
SM-10Reads of S1 secrets MUST be logged and alert the SOC; reads of S2 secrets MUST be logged.MUST
SM-11Cryptographic keys MUST follow the key lifecycle in NIST SP 800-57 Part 1 and the cryptoperiods set in section 8.MUST
SM-12Secrets SHOULD be delivered to workloads at runtime (mounted or fetched) rather than baked into artefacts or passed as command-line arguments.SHOULD
SM-13Applications SHOULD reload rotated secrets without restart.SHOULD
SM-14Break-glass credentials MUST be sealed, monitored and rotated after every use (section 12).MUST
SM-15Secrets MUST be encrypted at rest in stores and backups, and in transit, with keys managed under SM-11.MUST

6. Approved stores

Store IDStoreApproved classesAuthentication of consumersOperated byNotes
ST-01 (Example)Cloud KMS with HSM-backed keysS1, S2 keys (non-exportable)Cloud IAM roles via workload identityPlatformKey material never leaves the HSM boundary
ST-02 (Example)Central vault cluster (production)S1 (dual control), S2Kubernetes service account tokens, cloud IAM auth, OIDC for CIPlatformNamespaces per business unit
ST-03 (Example)Cloud provider secret managerS2, S3Cloud IAM rolesPlatformFor serverless workloads without vault access
ST-04 (Example)CI platform encrypted secretsS3 only, and only until OIDC federation is available for the targetRepository and environment scopingDeveloper experience teamNot for S1 or S2
ST-05 (Example)Enterprise password managerHuman-used shared credentials for third-party consoles that lack SSOSSO with phishing-resistant MFAITNot for workloads

Requirements for every approved store:

  1. Encryption at rest with keys under SM-11, and TLS for all access.
  2. Fine-grained access policies per path or secret, managed as code and reviewed.
  3. Audit logs of reads, writes and policy changes forwarded to the SIEM.
  4. Versioning, so a rotation can roll back within the overlap window.
  5. High availability and a tested recovery procedure; loss of the store is a severity-1 incident risk.
  6. Removal of secrets from memory and temporary files on consumer hosts is the responsibility of the consuming application.

7. Issuance and access

7.1 Issuance rules

  1. Generate secrets in the store or by the target system using a cryptographically secure random generator. Humans MUST NOT choose secret values for S1 to S3.
  2. Minimum strength (Example): random API secrets of at least 256 bits of entropy; passwords for service accounts at least 32 random characters; key sizes and algorithms per the cryptography standard.
  3. Register the inventory record (section 4.2) at creation, ideally by the same automation.
  4. Deliver the secret only to the consuming identity through the store's access policy. If a human must transfer a secret to an external party, use a one-time, expiring share from the approved password manager.
  5. Scope each secret to the narrowest permission the target system offers (read-only, single resource, IP or network restrictions where available).

7.2 Access control

  • Access policies are granted to workload or human identities, versioned in a repository and approved by the secret owner.
  • Human read access to S1 and S2 production secrets is not standing; it uses just-in-time elevation with a ticket reference.
  • Access reviews: quarterly for S1, semi-annually for S2 (Example). Record results in the access review process.

8. Rotation and expiry

8.1 Rotation periods

All values are Example values. Adjust them to your risk assessment and the capabilities of the target systems.

Secret typeS1 CriticalS2 HighS3 ModerateTrigger-based rotation
Dynamic database or cloud credentialsLease 1 hour (Example)Lease 8 hours (Example)Lease 24 hours (Example)Automatic on lease expiry
Static service passwords and API keys30 days (Example)90 days (Example)180 days (Example)Suspected exposure, owner leaves, supplier breach
Webhook and token signing secrets90 days (Example)180 days (Example)365 days (Example)Suspected exposure
TLS server private keysRe-key on each certificate renewalRe-key on each certificate renewalRe-key on each certificate renewalKey compromise
Symmetric data encryption keysPer cryptoperiod set in the cryptography standard (informed by NIST SP 800-57 Part 1)SameSameCompromise, algorithm deprecation
Code-signing and CA private keysPer PKI design; HSM-held, rotated by planned key ceremonyn/an/aCompromise
Break-glass credentialsAfter every use and at least every 90 days (Example)n/an/aEvery use

8.2 Rotation method

  1. Use dual-secret overlap: create the new secret, deploy it to consumers, verify use, then revoke the old one.
  2. Automate rotation in the store where a rotation integration exists for the target system.
  3. Record each rotation (date, method, operator or automation) in the store metadata.
  4. Treat a rotation that fails, or that is more than 14 days overdue (metric in section 13.2), as a finding; fix it within 30 days (Example), or within the leak response target in section 11.3 if exposure is suspected.
  5. When a secret cannot be rotated without downtime, record it as a design defect and plan a fix; do not extend the period silently.

9. Dynamic credentials and workload identity

9.1 Target patterns

ContextTarget patternStatic secret eliminated
Workloads in a cloud accountCloud workload identity (instance or function role, managed identity, service account attached to the resource)Cloud access keys
Kubernetes workloadsProjected service account tokens federated to cloud IAM and to the vaultCloud keys and vault tokens in Kubernetes Secrets
CI/CD pipelinesOIDC federation from the CI platform to cloud IAM and the vault, scoped to repository, branch and environmentLong-lived deploy keys in CI secrets
DatabasesDynamic credentials issued per workload with a lease, or database IAM authenticationShared static database passwords
Service-to-serviceMutual TLS with short-lived certificates from an automated issuer, or signed tokens from the platform identityShared API keys between internal services
Human operatorsSSO with phishing-resistant MFA and just-in-time role elevationPersonal long-lived cloud keys

9.2 Migration register

Migration IDCurrent static secretTargetOwnerDueStatus
MIG-001 (Example)14 machine-user cloud keys (Corvid data platform; 22 a quarter earlier)Workload identity on the ETL runners[@data-platform]YYYY-MM-DDIn progress (14 active at the Q3 snapshot; 11 to be replaced this quarter; 3 used by the third-party ETL tool stay under SMX-003)
MIG-002 (Example)CI deploy keys for 120 repositoriesOIDC federation[@devex]YYYY-MM-DDPlanned
MIG-003 (Example)Shared reporting database passwordDynamic credentials, 8-hour lease[@analytics]YYYY-MM-DDPlanned

Cross-reference: posture reviews measure static key counts in Cloud Security Posture Review (security/cloud-security-posture-review), section 5.

10. CI/CD, containers and Kubernetes

10.1 CI/CD rules

  1. Pipelines MUST obtain cloud and vault access by OIDC federation where supported (SM-05); stored CI secrets are limited to S3 (ST-04).
  2. Scope credentials to the environment and protected branches; jobs from forks or untrusted pull requests MUST NOT receive secrets.
  3. Do not print secrets, pass them as command-line arguments, or write them to artefacts or caches. Enable log masking as a backstop, not a control.
  4. Pin third-party actions and plugins to a full commit hash or verified digest; a compromised dependency can read every secret the job holds. See Software Supply Chain Security Assessment Template (SLSA) (security/supply-chain-security).
  5. Self-hosted runners for production deployments MUST be ephemeral, so no credential persists between jobs.

10.2 Container rules

  1. Container images MUST NOT contain secrets in any layer, including layers deleted later; build-time secrets use the build tool's secret mount feature.
  2. Do not pass S1 or S2 secrets as plain environment variables where a mounted file or runtime fetch is available; environment variables leak through crash dumps, debug endpoints and child processes.
  3. Scan images for secrets in the registry and block promotion on a confirmed finding.

10.3 Kubernetes rules

  1. Enable encryption at rest for Kubernetes Secrets using a KMS provider; base64 encoding is not encryption.
  2. Prefer an external secrets operator or a CSI secrets store driver that syncs from the approved store, with namespace-scoped access.
  3. Restrict get, list and watch on Secrets through RBAC to the workloads that need them; list on Secrets in a namespace exposes all of them.
  4. Disable automatic mounting of service account tokens for pods that do not call the Kubernetes API.
  5. Cluster-level design choices live in Kubernetes Cluster Design (ops/kubernetes-cluster-design).

11. Secret scanning and leak response

11.1 Scanning coverage

LocationControlModeOwner
Developer workstationPre-commit hook with the approved scannerWarn and blockEach engineer, installed by onboarding script
Source code platformPlatform secret scanning with push protectionBlock, bypass needs reason and is alertedSecurity engineering
Full history of all repositoriesScheduled deep scanReportSecurity engineering
CI logs and artefactsPipeline log scannerReport and purgeDeveloper experience team
Container registryImage secret scanBlock promotionPlatform
Wikis, tickets and chatScanner integration where availableReport and redactIT
Public internet (public repositories, paste sites)Partner programmes of providers and external monitoringAlertSOC

11.2 Leak response steps

  1. Triage (SOC). Confirm the value is a real secret and identify the inventory record and owner. Check validity where safe (for example a provider's verification endpoint).
  2. Revoke and replace (owner). Rotate the secret using the dual-secret method; if overlap is not possible, revoke immediately and accept the outage for S1.
  3. Investigate (SOC). Search store and target logs for use of the leaked secret from the time of exposure. Expand to an incident if any unexpected use is found.
  4. Remove the exposure (owner). Remove the secret from the location, purge caches and artefacts, and request removal from public sources. History rewriting is optional; revocation is mandatory.
  5. Learn (security engineering). Record the root cause (how the secret reached that location) and fix the path, for example by adding a scanner rule or moving to workload identity.

11.3 Leak response targets

SituationRevoke within (Example)Severity starting point
Valid S1 secret exposed publicly1 hourMajor incident per Incident Severity Matrix (ops/incident-severity-matrix)
Valid S1 secret exposed internally, or S2 exposed publicly4 hoursHigh
Valid S2 secret exposed internally24 hoursMedium
S3 secret exposed anywhere5 business daysLow
Value confirmed invalid or a test fixtureNo revocation; close with reasonInformational

12. Break-glass access

  1. Maintain break-glass accounts only for: cloud organisation administration, the identity provider, and the vault itself (Example list).
  2. Store break-glass credentials outside the systems they recover, for example as split knowledge in sealed envelopes in two safes, or in a separate password manager tenant, with hardware MFA tokens held separately.
  3. Any use MUST raise a high-priority SOC alert automatically.
  4. Use requires two people, a declared incident or change, and a written log of actions taken.
  5. Rotate the credentials and re-seal after every use, and test access at least every [6] months (Example) without exposing the credential.
  6. Review the list of break-glass holders quarterly.

13. Audit, logging and compliance measurement

13.1 Audit logging

  • Store audit logs (reads, writes, policy changes, authentication failures) are forwarded to the SIEM and retained per Security Logging Standard (security/security-logging-standard).
  • Alerts (Example): any S1 read; S2 reads from a new identity or network; bulk reads; policy changes outside change windows; disabled audit device.

13.2 Metrics

MetricFormulaTarget (Example)
Inventory coveragesecrets in stores with an inventory record / secrets in stores100%
Static workload credentialscount of active static cloud keys and stored CI deploy keysDown each quarter; 0 for new systems
Rotation complianceS1 to S3 static secrets rotated within period / S1 to S3 static secrets98%
Repositories with push protectionrepositories with protection on / active repositories100%
Mean time to revoke (valid leaks)sum of (revocation time minus detection time) / valid leaksWithin targets in 11.3
Push protection bypassesbypasses in period, with reason recordedTrend down; 100% with reason
Overdue rotation findingscount of secrets past rotation date by more than 14 days0

Example (Corvid Commerce, Q3): 1,240 secrets in stores, 1,215 with an inventory record: coverage = 1,215 / 1,240 = 98.0%. 410 static secrets due for rotation, 398 rotated in period: compliance = 398 / 410 = 97.1%.

13.3 Compliance checks

CheckMethodFrequency
SM-01, SM-08Scanner reports and repository settings exportContinuous; monthly report
SM-02, SM-03Store metadata compared with inventoryMonthly
SM-05CSPM count of static workload keysMonthly
SM-06Rotation dates in store metadataWeekly
SM-10, SM-14SIEM alert testsQuarterly

14. Exceptions and risk acceptance

Exception IDStatementSystemReasonCompensating controlsApproved byExpiry
SMX-003 (Example)SM-05Third-party ETL tool (3 machine-user keys; recorded in the posture review as EXC-019)Supports only static access keysKeys scoped to the ETL buckets with no administrative policy, network condition, 30-day rotation, alert on new source IP[@ciso]YYYY-MM-DD (90 days)
SMX-007 (Example)SM-06Legacy payment terminal integrationSupplier requires manual key exchangeKey held in HSM, rotated annually by ceremony, supplier contract updated[@ciso]YYYY-MM-DD

Rules: exceptions to MUST statements for S1 need CISO approval; all exceptions expire within 12 months (Example); expired exceptions become findings.

15. Related documents and control mapping

15.1 Control mapping

StatementNIST SP 800-53 Rev. 5Topic
SM-02, SM-07, SM-14IA-5Managing authenticators: initial values, protection, change and revocation
SM-06, SM-11IA-5, SC-12Authenticator refresh; establishing and managing cryptographic keys
SM-15SC-28Protecting stored information, including secrets at rest
SM-10AU-2, AU-12Selecting and generating audit events
SM-05IA-5, AC-6Fewer static authenticators; least privilege

15.2 Related templates and documents

DocumentRelationship
PKI and Certificate Architecture Template (RFC 3647, 47-Day TLS) (security/pki-certificate-architecture)Certificate and CA key lifecycle
IAM Solution Design Template (NIST SP 800-63-4, SSO, PAM) (security/iam-solution-design)Workforce identity, privileged access, machine identities
Cloud Security Reference Patterns Template (AWS SRA, MCSB, CCM v4.1) (security/cloud-security-reference-patterns)Approved key management and workload identity patterns
Security Architecture Document Template (NIST SP 800-160, STRIDE) (security/security-architecture)Per-system secrets design (its section 10)
Software Supply Chain Security Assessment Template (SLSA) (security/supply-chain-security)CI/CD hardening
Cloud Security Posture Review (security/cloud-security-posture-review)Periodic measurement of static keys and key rotation
Security Logging Standard (security/security-logging-standard)Audit log retention
Incident Severity Matrix (ops/incident-severity-matrix)Severity of leak incidents
Kubernetes Cluster Design (ops/kubernetes-cluster-design)Cluster secret encryption and RBAC

16. Glossary and references

16.1 Glossary

TermMeaning
SecretA confidential value that grants access, proves identity or protects data
Static secretA secret that stays valid until someone rotates or revokes it
Dynamic credentialA credential generated on request with a lease, revoked automatically when the lease ends
Workload identityAn identity the platform attaches to a workload, which it exchanges for short-lived tokens without a stored secret
Secret zeroThe first credential a workload needs in order to fetch other secrets
CryptoperiodThe time span during which a specific key is authorised for use (NIST SP 800-57 concept)
Push protectionA source platform feature that blocks a push containing a detected secret
Break-glassEmergency access that bypasses normal controls, used only when they fail
HSMHardware security module: tamper-resistant hardware that generates and holds keys

16.2 References

Standard and licence note

Based on NIST SP 800-57 Part 1 Rev. 5 (May 2020) and NIST SP 800-53 Rev. 5 (Release 5.2.0, August 2025), which are works of the United States Government; control identifiers are cited and their intent is paraphrased. The topic coverage (general secrets management, CI/CD, cloud providers, containers and orchestrators, detection, incident response) is informed by the OWASP Secrets Management Cheat Sheet by the OWASP Foundation, licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). If you adapt or redistribute material taken from the OWASP cheat sheet, attribute OWASP and license that adapted material under CC BY-SA 4.0 (ShareAlike). The wording of this template is original. Check the current official versions at nist.gov and owasp.org before relying on this standard, as updates may have been published. Product and platform names are trademarks of their owners; this template is not affiliated with or endorsed by them. Template licence: MIT.

관련 템플릿