Use it when handling automation credentials around Secrets & Credentials. Keep credential owner/purpose, secret value custody, retrieval identity, target privilege, runtime exposure, rotation/revocation and verified rejection as separate proof boundaries.
Secrets & Credentials
Secrets & Credentials is the cross-cutting Automation branch for non-public authentication material and credential artifacts that automation must obtain, use, protect, rotate, expire and audit without embedding sensitive values into source code, logs, artifacts or long-lived runtime state.
1. Secrets & credentials for automation: store in vaults, inject at runtime, least privilege, rotate, audit.
2. Prefer dynamic/short-lived credentials and workload identity.
3. Never in code, logs or images.
4. Scan for leaks.
5. Revoke on exposure.
automation identity → secret store → short-lived credential → target
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
automation identity/operation → credential requirement → authoritative secret source → authenticated retrieval → in-memory/session injection → target authentication/authorization → effective operation → audit correlation → rotation/revocation → old-secret rejection
Healthy evidence: credentials are scoped, retrieved just in time, masked from observability surfaces, correlated to a workload identity, rotated on schedule and old values are demonstrably rejected.
Step 2 Verification path Verify boundary
To verify Secrets & Credentials, first record secret reference/key ID, credential principal, scope/audience, version and target service identity. Then check the result reported by the tool, and finally read the authorization capability granted to the automation without exposing the secret material itself directly and compare it with what you intended.
Also test the cases that usually go wrong: plaintext config, environment leakage, stale tokens, overbroad scopes, copied credentials, untracked rotation and confusing successful authentication with authorization.
Step 3 Failure modes and next checks Narrow the fault
Suspicious evidence: secrets are embedded in repositories or variables files, shared across unrelated jobs, appear in logs/artifacts, remain valid after rotation or cannot be attributed to a specific automation identity.
It does not show security outside the explicit identities, credentials, code/dependencies, targets, policies and observation window. This branch shows lifecycle and handling of sensitive credential material; it does not by itself show that the target authorization policy, automation code or downstream workload is secure.
Next check: Continue from the first unproven credential boundary: preserve the secret ID/version/fingerprint without plaintext, workload identity, store/issuer and exact consumers; trace runtime exposure and target authentication; compare active generation to source metadata; then rotate/revoke or expire safely and show both intended success and old-credential rejection before closure.
Step 4 Where it fails Narrow the fault
Trace a failure along the path it takes: secret source → retrieval/authentication → runtime binding → transport → target authorization → audit/logging → rotation/revocation.
Typical problems with Secrets & Credentials: plaintext config, environment leakage, stale tokens, overbroad scopes, copied credentials, untracked rotation and confusing successful authentication with authorization.
What to watch: secret reference/version, least-privilege retrieval, redaction, rotation/expiry and revocation; principal identity, scope, storage/binding, expiry/rotation and authorization outcome.
Before you retry a change, read the target's current state first, using secret reference/key ID, credential principal, scope/audience, version and target service identity.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
Secret Management governs the end-to-end lifecycle of sensitive automation values: creation, classification, storage, access policy, retrieval, injection, use, rotation, revocation, recovery and auditable destruction.
Subtopic PasswordsPasswords in automation are reusable shared secrets whose risk is dominated by storage, transmission, reuse, lifetime and the breadth of the account they authenticate.
Subtopic API KeysAPI Keys are application credentials presented to an API to identify or authorize a caller, often long-lived and bearer-like, so secure automation must constrain their scope, storage, transport, rotation and observability.
Subtopic TokensTokens are bearer or proof-bearing credentials whose security depends on issuer trust, audience, scopes/claims, lifetime, storage and validation at the target—not merely on the token string being accepted.
Subtopic SSH KeysSSH Keys used by automation are asymmetric credentials whose safety depends on private-key custody, public-key placement, host trust, algorithm strength, principals/options, rotation and provable removal of obsolete keys.
Subtopic CertificatesCertificates used by automation bind a public key to an identity under a trust chain and policy; automation must manage the private key, issuance profile, SAN/subject identity, trust anchors, validity window, renewal and revocation independently.
Subtopic Environment VariablesEnvironment Variables are a common runtime injection channel for configuration and secrets, but they are process state—not a secret store—and can leak through debugging, child processes, crash reports, orchestration metadata and environment dumps.
Subtopic Secret StoresSecret Stores are authoritative systems or services that protect secret values and metadata with access control, encryption, auditability and lifecycle functions; automation should reference them rather than duplicate plaintext secrets.
Subtopic EncryptionEncryption protects secret confidentiality only across the specific at-rest or in-transit boundary where keys, algorithms and trust are correctly managed; it does not replace access control, secret minimization or rotation.
Subtopic RotationRotation replaces a credential generation while preserving required service continuity and proving that every intended consumer uses the new generation and the previous generation is revoked or expired.
Subtopic ExpirationExpiration constrains credential lifetime so stale or forgotten secrets eventually stop authenticating, but effective expiry depends on target enforcement, clock behavior, caches/sessions and renewal readiness.
Subtopic Least PrivilegeLeast Privilege for secrets limits both who can retrieve credential material and what the resulting credential can do, reducing blast radius if automation, a runner or a secret is compromised.
- Secret present ≠ secret safely handled.
- Credential valid ≠ credential authorized for the intended operation.
- Encrypted at rest ≠ protected during retrieval, injection, use or logging.
- Rotation requested ≠ old credential revoked everywhere.
gitleaks detect --source .— secrets in reposvault status— secret store- Credential inventory with owners — governance
ReferenceWhat it is1 section · depth on demand
Core model
Start with the workload identity and exact operation, choose the narrowest credential type and privilege, retrieve the secret from an authoritative protected source at execution time, expose it only to the required process or session, prevent persistence and disclosure, correlate usage to an auditable identity, then rotate or revoke it and verify that old material no longer works.
ReferenceWhy it matters1 section · depth on demand
In depth
Secrets and credentials are the passwords, API keys, tokens, SSH keys and certificates that automation uses to authenticate. They are the most valuable thing an automation platform holds, so they need storage, access control, rotation and auditing.
| Rule | Reason |
|---|---|
| Never in Git or images | History and copies are permanent |
| Least privilege per credential | Limit damage |
| Short-lived where possible | Reduce exposure window |
| Central secret store | Rotation and audit |
Mask in logs (no_log, ::add-mask::) | Avoid leaks in job output |
Assume any secret that appeared in a log, ticket or chat is compromised and rotate it.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Secrets & Credentials owns generic credential lifecycle, storage, injection and rotation semantics. Automation Security owns broader execution hardening and supply-chain controls; Security-domain IAM/PKI/Cryptography own their deeper security theory and platform-specific controls.
Mechanics
Automation → Secrets & Credentials is owned at runtime by the secret store/identity provider, automation runtime that retrieves scoped credentials and the target system that authorizes them. Durable intent is least-privilege credential policy with versioned secret references, ownership, rotation/expiry and non-export requirements; stable identity is secret reference/key ID, credential principal, scope/audience, version and target service identity. The consumer-visible target is the authorization capability granted to the automation without exposing the secret material itself. The operating invariants are that secret values are not logged, references are stable, scopes are minimal, rotation/expiry are handled, transport is protected and use can be audited. Follow the chain of components secret source → retrieval/authentication → runtime binding → transport → target authorization → audit/logging → rotation/revocation and record which layer currently owns truth.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
A fresh noninteractive execution should be reproducible from source-controlled intent plus documented prerequisites, and the release must retain enough identity to tie every result back to secret reference/key ID, credential principal, scope/audience, version and target service identity.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Secrets & Credentials. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Secrets & Credentials credential proof-boundary map
Fast identity, handling/execution, effective-outcome and closure proof boundaries for Secrets & Credentials.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Ownership / source | Credential owner, purpose, consumers and authoritative store/issuer are explicit | Shared or orphaned credentials exist outside a controlled source with unclear consumers |
| Retrieval / exposure | Workload retrieves only required material and plaintext exposure is transient and bounded | Secrets leak to source, logs, command lines, artifacts, caches, child processes or unrelated jobs |
| Effective outcome | Target-side authentication/authorization or secure control outcome is independently observed | Tool/job success substitutes for target authorization, effective state or workload proof |
| Closure / next action | Rotation/revocation, denied-path tests, audit evidence and residual exceptions are explicit | Old credentials remain valid, policy bypass exists, audit gaps are unknown or broad success is inferred from one signal |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum secret reference, principal, scope/audience, credential version/expiry, target service, auth result/error, audit correlation and rotation status.
For Secrets & Credentials, rely on structured fields and stable IDs (secret reference/version, least-privilege retrieval, redaction, rotation/expiry and revocation; principal identity, scope, storage/binding, expiry/rotation and authorization outcome) rather than text formatted for display.