# Secrets Management
> Secrets management is the full lifecycle of machine credentials (API keys, cloud keys, tokens, signing and encryption keys, passwords): keeping them out of code and artifacts, storing and issuing them safely, detecting leaks, and revoking them fast. Attackers increasingly log in with a leaked secret rather than exploit a vulnerability.
## What it is
The discipline covers every place a credential is **created, copied, stored, used and invalidated**. A secret is a bearer capability, so every copy works as well as the original. Exposure is therefore the number of copies multiplied by how long each one stays valid. Appsec owns both sides of that: preventing copies (code, bundles, images, CI, endpoints) and shortening validity (federation, dynamic credentials, revocation).
Why it matters, by the numbers:
- **Sprawl.** GitGuardian counted 28.65M new hardcoded secrets in public GitHub commits in 2025 (+34% YoY). That includes 1.28M AI-service secrets (+81%). 32.2% of internal repos hold a secret, against 5.6% of public ones. 28% of incidents never touch code at all: they sit in Slack, Jira and Confluence ([[raw/blog.gitguardian.com/the-state-of-secrets-sprawl-2026-ai-service-leaks-surge-81-3771|GitGuardian 2026]], [[raw/thehackernews.com/the-state-of-secrets-sprawl-2026-9-takeaways-for-cisos-3777|THN 9 takeaways]]). Finance-linked public repos run at 6.9%: 48,819 secrets, 446 of 2,639 sensitive ones valid at first detection ([[raw/blog.gitguardian.com/financial-services-cybersecurity-vs-artex-credentials-in-plain-sight-15763|GitGuardian, finance vs ARTEX]]). GitHub reported 39M secret leaks in 2024 ([[raw/github.blog/github-found-39m-secret-leaks-in-2024-the-github-blog-4711|GitHub blog]]).
- **The web itself.** A dynamic crawl of 10M rendered sites found 1,748 valid keys for 14 providers, including AWS, Stripe, OpenAI, SendGrid and Twilio. 62% of JavaScript exposures existed *only* in compiled bundles and 16% arrived through third-party inclusions, so repo-based static scanning misses them. Keys stayed public for an average of 12 months, and disclosure got about half of them removed ([[raw/gsmaragd.github.io/keys-on-doormats-exposed-api-credentials-on-the-web-ccs-2026-15764|Keys on Doormats, CCS 2026]]).
- **Speed.** Leaked AWS keys get used within about 5 minutes of a public push ([[raw/unit42.paloaltonetworks.com/cloudkeys-in-the-air-exposed-iam-keys-cryptojacking-4069|Unit 42 EleKtra-Leak]], [[raw/tachyon.so/what-happened-after-we-pushed-our-env-to-a-public-repo-10676|Tachyon canary]]). AI agents went from a GitHub search to exfiltrating Azure Key Vault data in five minutes ([[raw/microsoft.com/threat-actors-use-agentic-ai-tooling-to-find-and-abuse-exposed-secrets-13575|Microsoft]]).
- **Persistence.** 64% of secrets valid in 2022 were still valid in January 2026. 81% of the live keys Truffle disclosed still worked six months later ([[raw/gitguardian.com/the-state-of-secrets-sprawl-2026-gitguardian-annual-report-4349|GitGuardian report]], [[raw/trufflesecurity.com/truffle-security-secrets-revocation-program-13348|Truffle revocation program]]).
## Core concepts
- **Copy inventory, not "the secret".** One leaked production key in GitGuardian's walk-through had 13 copies: a hardcoded fallback, a config file, a stale pipeline variable that overrode the vault, a Jira ticket. The team knew about one of them ([[Credential Rotation and Revocation]]).
- **Leak surfaces.** Source and client artifacts ([[Hardcoded Secrets]]), history and its mirrors ([[Secrets in Git History]]), laptops and CI runners ([[Developer Workstation Secrets]]), plus runtime credential providers reachable after code execution or [[Server-Side Request Forgery|SSRF]] ([[Cloud Metadata Service Exploitation]], [[IMDSv2]]).
- **Deleted ≠ revoked.** Git is append-only. Force-pushed "oops commits" remain retrievable and show up in GH Archive. Only invalidation ends a leak ([[Secrets in Git History]]).
- **Client-shipped means public.** Anything inside a JS bundle, `NEXT_PUBLIC_*`, an APK/IPA or firmware is readable by every user. Obfuscation and encoding only slow a reader down ([[Hardcoded Secrets]], [[JavaScript Analysis]]).
- **Signing keys are auth bypasses.** A leaked JWT, HMAC, cookie or `SECRET_KEY` value lets an attacker forge sessions ([[JWT Secret Cracking]], [[Session Management]]). That includes keys published by mistake: a JWKS carrying `d`/`p`/`q` or an `oct` key's `k` hands out the signing key ([[raw/medium.com/jwks-and-kid-explained-how-to-find-the-key-that-signed-your-token-and-15966|Avada Labs]]; [[Hardcoded Secrets]]).
- **Prompts are a leak surface.** Secrets in LLM prompts travel to every inference hop; "Zero Data Retention" binds only the first. Dragos's canary study caught three breached providers and keys tested within hours ([[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|THN]]; [[Leaked Cloud Credentials]]).
- **"Who can decrypt?" is the perimeter.** A vault moves the question from where the value lives to which identities can read or decrypt it ([[Vaults and Secret Stores]]).
- **Secretless, but not trustless.** Federation removes the static key, so the trust policy and the role's blast radius become the asset to protect ([[Workload Identity Federation]]).
- **Time-to-revoke** = `confirmed_invalidation_ts - validation_ts`. This is the metric that matters. MTTR can close on a ticket while the key still works.
- **Verified vs critical.** Live verification makes findings actionable, but 46% of critical secrets are missed by validation-only prioritization ([[Secret Scanning]]).
## How to approach it
1. **Inventory every copy.** Cover repos and full history, CI variables, container images, built bundles, collaboration tools, endpoints and runners. For service accounts, run SCALER: Scale → Classify → Assign owner → Lifecycle → Enforce → Rotate ([[Credential Rotation and Revocation]]).
2. **Scan in layers.** Pre-commit → push protection → CI → org-wide and public monitoring → artifacts, collaboration tools and endpoints. Use more than one engine ([[Secret Scanning]]).
3. **Scan what you ship, not only what you commit.** Rendered pages, compiled bundles and third-party scripts carry keys that never appear in repo scans ([[raw/gsmaragd.github.io/keys-on-doormats-exposed-api-credentials-on-the-web-ccs-2026-15764|Keys on Doormats]]). Storybook CVE-2025-68429 bundled `.env` values into published static builds ([[Hardcoded Secrets]]).
4. **Remove static secrets.** Use OIDC, IRSA/Pod Identity or IAM Roles Anywhere for anything that talks to a cloud or SaaS with federation support. Follow AWS SEC02-BP03's order: remove, replace with short-term credentials, then store and rotate only what is left ([[Workload Identity Federation]]).
5. **Vault the remainder.** Give least-privilege read and decrypt access per secret, audit every access, prefer dynamic or leased credentials, and deliver them by mounted file or sidecar rather than environment variables ([[Vaults and Secret Stores]]).
6. **Review decrypt paths.** Ask whether any CI identity, build system, agent tool or co-tenant process can resolve production secrets to plaintext. Railway and AgentCore both failed on this question.
7. **Rehearse the runbook.** Validate → scope → revoke in blast-radius order → confirm the old value fails → review logs from the *exposure* time → only then clean history ([[Credential Rotation and Revocation]]).
8. **Propagate fixes to clones.** Rotating production does not fix the training, staging and RC environments cloned from the same template. An airline rotated a default Keycloak admin password on production, but its training instance still accepted `admin:admin123` 18 days later ([[raw/infosecwriteups.com/admin-admin123-how-default-keycloak-credentials-on-a-cargo-training-en-15806|Keycloak write-up]]).
## Key techniques
### Finding leaked secrets (offense and assessment)
- **Bundles and client code.** Grep built JS for provider prefixes. Check Next.js and Vite env-prefix mistakes, and run the TruffleHog Chrome extension for keys and exposed `.git`/`.env` ([[JavaScript Analysis]], [[Hardcoded Secrets]]).
- **Mobile binaries.** Decompile and grep strings. AI-assisted review of decompiled code found customer-database passwords in hotel and restaurant apps ([[Android App Security]], [[iOS App Security]]).
- **History and oops commits.** Run `gitleaks git . --log-opts="--all"` and `trufflehog git file://. --results=verified`. Truffle's Force Push Scanner mines GH Archive for dangling commits ([[Secrets in Git History]]).
- **Search and dorks.** GitHub code search and dorks such as `/AIza[0-9A-Za-z_-]{35}/ path:/.env`, plus web-exposed `.env` files ([[Google Dorking]], [[Content Discovery]]). Attackers now automate this with agents that combine an org name with secret keywords ([[raw/microsoft.com/threat-actors-use-agentic-ai-tooling-to-find-and-abuse-exposed-secrets-13575|Microsoft]]).
- **Diagnostic endpoints.** Spring Boot Actuator `/env` and `/configprops` return env-injected keys in clear once value masking (`show-values`) or endpoint security is turned off ([[raw/medium.com/how-your-apis-key-ends-up-readable-through-actuator-4-mistakes-to-avoi-15941|Bytebantz]]; [[Secrets in Logs and Build Artifacts]]).
- **JWKS audits.** Fetch `/.well-known/jwks.json` or `jwks_uri` and flag private parameters, symmetric keys, missing/duplicate `kid` and RSA < 2048 ([[raw/medium.com/jwks-and-kid-explained-how-to-find-the-key-that-signed-your-token-and-15966|Avada Labs]]).
- **Stealer-log exposure.** Infostealer datasets now hold corporate AI-service logins (ChatGPT, Claude, Gemini, Copilot, Cursor); Brandefense's free check searches one source by domain, so a negative result proves nothing ([[raw/medium.com/your-company-s-ai-credentials-could-already-be-exposed-and-google-won-15910|Lerner]]; [[Developer Workstation Secrets]]).
- **Proxied traffic.** The TruffleHog Burp extension verifies more than 800 secret types in proxied traffic. Hirdman Radar shows, per host, how many leaked records (infostealer logs, breach credentials) mention it, and ranks mail, VPN and SSO hosts first ([[Burp Suite Extensions]], [[raw/github.com/hirdman-radar-burp-extension-showing-subdomains-and-leak-counts-per-ho-15671|hirdman-radar]]).
- **Forgotten environments.** Wayback CDX recon (`web.archive.org/cdx/search/cdx?url=*.example.com/*`) surfaced cloned hosts that wildcard certificates hid from CT logs ([[Subdomain Enumeration]], [[raw/infosecwriteups.com/admin-admin123-how-default-keycloak-credentials-on-a-cargo-training-en-15806|Keycloak write-up]]).
- **Secrets via another bug.** SSTI that reaches the Django signer leaks `SECRET_KEY`. In Arize Phoenix (CVE-2026-53998, CVSS 10), a GraphQL `applyChatTemplate` f-string template walks into Python globals, leaks `PHOENIX_SECRET`, and with it forges admin sessions and decrypts stored LLM keys. It needs no auth on default installs ([[GraphQL Security]], [[AI Infrastructure Vulnerabilities]], [[raw/stackurity.ai/arize-phoenix-cve-2026-53998-graphql-format-string-secrets-leak-15629|Stackurity]]).
### What attackers do with them
- **Cloud keys.** Expect validation with `sts:GetCallerIdentity`, then `secretsmanager:ListSecrets` and `GetValue`, followed by cryptojacking, `.env` extortion or LLMjacking. AWS's `AWSCompromisedKeyQuarantine` policy does **not** revoke the key or block `GetSecretValue` ([[Leaked Cloud Credentials]]).
- **Runtime providers.** IMDS `169.254.169.254`, ECS `169.254.170.2`, EKS Pod Identity `169.254.170.23`, and the IRSA token file ([[Cloud Metadata Service Exploitation]], [[SSRF in Kubernetes and Containers]], [[Capital One Breach]]).
- **GitHub PAT → cloud.** A write-scope PAT adds a workflow that exfiltrates double-base64'd secrets past log masking, or rides the repo's OIDC trust ([[GitHub Actions Security]], [[Workload Identity Federation]]).
- **CI secret harvesting.** tj-actions printed secrets to logs. The trivy-action tags were force-pushed to read runner memory. GhostAction pushed workflows that send repo secrets out (3,325 secrets in 2025, about 1,900 accounts and 30,000+ repos targeted in October 2026). Shai-Hulud 2.0 published every repo secret ([[tj-actions changed-files Compromise]], [[Shai-Hulud Worm]], [[CI-CD Pipeline Attacks]], [[raw/sonarsource.com/inside-secretless-analysis-from-ci-identity-to-project-scoped-access-15755|Sonar secretless analysis]]).
- **Platform credential reuse.** On Rackspace Spot, leaked credentials let an attacker act as customer users, create pods and read every Kubernetes Secret in their clusters ([[raw/bleepingcomputer.com/rackspace-spot-breach-let-hackers-access-customer-kubernetes-secrets-15960|BleepingComputer]]).
- **Endpoint looting.** Infostealers and worms sweep `~/.aws`, `.npmrc`, SSH keys, browser sessions and AI-agent configs. Each live secret sat in about 8 locations per machine, and 59% of Shai-Hulud 2 victims were CI runners ([[Developer Workstation Secrets]], [[Malicious Packages]]).
- **Forging auth.** Hardcoded JWT secrets (Tensei CVE-2026-129552, BISHENG CVE-2026-130840, Simple Admin Core), a constant HMAC salt in a WordPress plugin (WebToffee, [[raw/github.com/webtoffee-product-feed-hard-coded-cryptographic-key-15967|GHSA-rr2m-87q5-43hh]]), and a test Rails secret left in production ($18k) enabled token and cookie forgery ([[Hardcoded Secrets]], [[JWT Secret Cracking]]).
### Controls
- **Layered scanning** with custom rules and unique prefixes for internal tokens ([[Secret Scanning]]).
- **Workload identity federation.** Pin `sub` to owner/repo plus an environment, prefer ID-based subjects, and grant no IAM write ([[Workload Identity Federation]]). The SaaS version of the pattern is SonarQube Cloud's secretless analysis: the GitHub or GitLab OIDC JWT is exchanged via RFC 8693 for a token that scans one project for 30 minutes. The exchange checks the RS256 signature against a configured JWKS, plus `iss`, `aud` set to region, expiry, single-use `jti`, and a repo binding by **ID, not name**, which defeats repo-jacking ([[raw/sonarsource.com/inside-secretless-analysis-from-ci-identity-to-project-scoped-access-15755|Sonar]]).
- **Vaults.** Vault/OpenBao dynamic engines, the Secrets Store CSI Driver, Vault Secrets Operator, and SOPS or Sealed Secrets for GitOps. Kubernetes `Secret` objects are only base64-encoded ([[Vaults and Secret Stores]]).
- **Rotation patterns.** Dual-credential overlap, staged Secrets Manager rotation (`AWSPENDING` → `AWSCURRENT`), dynamic leases, and single-swap-with-revert ([[Credential Rotation and Revocation]]).
- **Endpoint hardening.** Non-exportable SSH keys (Secure Enclave, Secretive), short-lived CLI sessions, `.env` kept outside agent working directories, and sandboxed coding agents ([[Developer Workstation Secrets]], [[AI Coding Assistant Risks]], [[MCP Security]]).
## Tools
| Need | Tool | Notes / command |
|---|---|---|
| Pre-commit | Gitleaks, detect-secrets | `gitleaks git -v --redact`; `gitleaks:allow` inline; baselines for brownfield |
| CI and verification | TruffleHog | `trufflehog git file://. --since-commit main --branch feature-1 --results=verified,unknown --fail` |
| Org-wide | TruffleHog, GitHub/GitLab secret scanning | `trufflehog github --org=acme --exclude-archived`; GitHub covers all branches, issues, PRs, wikis |
| Images and artifacts | TruffleHog | `trufflehog docker --image acme/app:latest --results=verified`; `gitleaks dir ./build` for bundles |
| Second engine | Kingfisher, Betterleaks | On 7.25M Gitee repos, TruffleHog and Kingfisher shared only 1,001 findings |
| History cleanup | BFG, git filter-repo | Only *after* revocation; forks and GH Archive keep the old objects |
| Testing traffic | TruffleHog Burp/Chrome extensions, Hirdman Radar | Burp leak counts per host; private-project mode sends nothing |
| Stores | Vault/OpenBao, AWS Secrets Manager, CSI Driver, VSO, SOPS | `vault read aws/creds/deploy` mints a leased IAM key |
| Federation | GitHub OIDC + `aws-actions/configure-aws-credentials`, IRSA, Roles Anywhere | `permissions: id-token: write` |
| Training | OWASP WrongSecrets | 65+ challenges across code, Docker, Kubernetes and cloud ([[raw/github.com/owasp-wrongsecrets-6950|repo]]) |
Validate a found AWS key read-only with `aws sts get-caller-identity`. The CCS study verified keys the same way, through read-only provider endpoints (STS `GetCallerIdentity`, Slack `auth.test`, Cloudflare `tokens/verify`) ([[raw/gsmaragd.github.io/keys-on-doormats-exposed-api-credentials-on-the-web-ccs-2026-15764|Keys on Doormats]]).
## Pitfalls
- **Deleting instead of revoking.** 75% of developers who removed a secret from a Docker image never rotated it ([[raw/flare.io/thousands-of-secrets-exposed-on-docker-hub-4067|Flare]]).
- **Treating AWS quarantine as containment.** Tachyon's canary key drained Secrets Manager *after* the quarantine policy was attached ([[Leaked Cloud Credentials]]).
- **Revoking before you find the consumers.** The next deploy breaks, and the outage teaches teams not to rotate. Updating the vault while a stale pipeline variable overrides it is the same failure in reverse ([[Credential Rotation and Revocation]]).
- **Scanning only repos.** Bundles (62% of web JS exposures), third-party scripts, Slack and Jira (28% of incidents), images and endpoints are all outside git.
- **Trusting one scanner, or verification alone.** Generic secrets made up 63% of the `settings.local.json` leaks. Gitleaks and TruffleHog together missed 1 in 5 leaking files ([[Secret Scanning]]).
- **Env-var fallbacks.** `process.env.JWT_SECRET || 'auth-secret-key'` quietly becomes the production key ([[Hardcoded Secrets]]).
- **Environment variables as storage.** They are readable via `/proc/<pid>/environ`, inherited by child processes, dumped in crash logs, and baked into images by `ENV`/`ARG` ([[Vaults and Secret Stores]]).
- **Over-broad federated roles.** UNC6426 rode GitHub→AWS OIDC into a role allowed to create IAM roles, reaching admin in 72h ([[Workload Identity Federation]]).
- **Disabled guardrails.** The CISA contractor turned off GitHub's secret blocking before pushing GovCloud admin keys ([[raw/krebsonsecurity.com/cisa-admin-leaked-aws-govcloud-keys-on-github-8102|Krebs]]).
- **AI agents committing and "fixing".** Agents remove the secret at HEAD and stop. "Don't ask again" writes keys into `.claude/settings.local.json` ([[Secrets in Git History]], [[AI Coding Assistant Risks]]).
- **Cloned environments and defaults.** Training and RC instances inherit template credentials. One Keycloak instance ran EOL version 12.0.3 with ROPC enabled for `admin-cli` and leaked 766 employee accounts ([[raw/infosecwriteups.com/admin-admin123-how-default-keycloak-credentials-on-a-cargo-training-en-15806|write-up]], [[Authentication Security]]).
## Real-world cases
- **CISA "Private-CISA"**: a public sync repo held AWS GovCloud admin keys and stayed valid about 48h after takedown ([[raw/krebsonsecurity.com/cisa-admin-leaked-aws-govcloud-keys-on-github-8102|Krebs]]).
- **EleKtra-Leak**: GitHub-leaked AWS keys were used within 5 min for EC2 Monero mining ([[raw/unit42.paloaltonetworks.com/cloudkeys-in-the-air-exposed-iam-keys-cryptojacking-4069|Unit 42]]).
- **.env extortion**: exposed `.env` files on 110,000 domains led to S3 exfiltration and ransom notes ([[raw/unit42.paloaltonetworks.com/leaked-env-variables-allow-large-scale-cloud-extortion-4063|Unit 42]]).
- **LLMjacking**: stolen keys drove AI spend spikes of over $100k/day, up to $1M ([[raw/thehackernews.com/google-warns-llmjacking-attacks-are-costing-some-enterprises-up-to-1-m-13136|THN/GTIG]]).
- **ARTEX / Storm-3358**: an agentic framework hit finance targets. A GitHub search reached Key Vault in 5 min, and 102 forks appeared in the week of the takedown ([[raw/blog.gitguardian.com/financial-services-cybersecurity-vs-artex-credentials-in-plain-sight-15763|GitGuardian]], [[raw/stepsecurity.io/artex-attackers-adopted-this-ai-pentesting-tool-in-three-months-leaked-14704|StepSecurity]]).
- **ARTEX lab test**: an agent with no secrets scanner found 8 of 9 planted secrets using git and grep, 7 of them outside current files ([[raw/blog.gitguardian.com/financial-services-cybersecurity-vs-artex-credentials-in-plain-sight-15763|GitGuardian]]).
- **UNC6426**: the nx stealer took a GitHub token, the actor abused the OIDC trust, and reached AWS admin in 72h ([[raw/thehackernews.com/unc6426-exploits-nx-npm-supply-chain-attack-to-gain-aws-admin-access-i-4935|THN]]).
- **LiteLLM PyPI**: the stealer swept CI runners, leaving 153 GB of loot from 2,488 orgs ([[raw/blog.gitguardian.com/inside-the-litellm-hack-153gb-433-909-files-2-488-organizations-11384|GitGuardian]]).
- **Railway**: a build-system privilege escalation gave CI credentials that could decrypt, exposing env vars for up to about 100,000 workspaces, followed by mass revocation upstream ([[raw/medium.com/the-railway-breach-from-a-build-system-privilege-escalation-to-decrypt-13147|write-up]]).
- **trivy-action / GhostAction**: tag force-push read runner memory, and workflow-pushing campaigns harvested repo secrets ([[raw/sonarsource.com/inside-secretless-analysis-from-ci-identity-to-project-scoped-access-15755|Sonar]]).
- **GitHub oops commits**: a scan of dangling commits since 2020 earned about $25k, including an Istio admin PAT ([[raw/infoq.com/researcher-unearths-thousands-of-leaked-secrets-in-github-s-oops-commi-2770|InfoQ]]).
- **Gitee 7.25M repos**: 26,400 live credentials, about half from 2025 ([[raw/peris.ai/26-400-working-keys-in-7-25m-repos-deleting-from-git-does-not-revoke-13287|Peris]]).
- **Docker Hub**: 10,000+ images leaked secrets in one month, LLM keys most common ([[raw/flare.io/thousands-of-secrets-exposed-on-docker-hub-4067|Flare]]).
- **Claude Code `settings.local.json`**: 31,088 secrets on public GitHub, 5,343 of them valid ([[raw/blog.gitguardian.com/claude-code-settings-local-json-secrets-17-months-of-exposure-on-githu-13955|GitGuardian]]).
- **Rackspace Spot (17 Nov 2026)**: leaked credentials → pods in customer clusters, all cluster Secrets and Spot API/refresh tokens readable; console outage delayed rotation for four days ([[raw/bleepingcomputer.com/rackspace-spot-breach-let-hackers-access-customer-kubernetes-secrets-15960|BleepingComputer]]).
- **AI inference prompt theft (Jul–Nov 2026)**: canary AWS keys in prompts stolen from breached providers and abused within hours (S3, Secrets Manager, Parameter Store, Bedrock key creation, IAM users); OpenRouter dropped three providers. Together AI's prompt samples were stolen after an AI coding agent committed a credential to a public repo ([[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|THN]]).
- **BISHENG < 3.0.0 (CVE-2026-130840)** and **Tensei ≤ 0.11.5 (CVE-2026-129552)**: hard-coded JWT signing secrets, offline-forged admin tokens, CVSS 9.3 ([[raw/vulncheck.com/bisheng-auth-bypass-via-hard-coded-jwt-signing-secret-15965|VulnCheck]], [[raw/vulncheck.com/tensei-auth-bypass-via-hard-coded-jwt-secret-15964|VulnCheck]]).
- **Swarm bee-js 13.3.0 / Desktop 0.56.2**: maintainer credentials plus the release bot's token let the pipeline publish without a second approver; stage-2 stole node keys and passwords ([[raw/ethswarm.org/swarm-incident-malicious-bee-js-13-3-0-and-swarm-desktop-0-56-2-15953|Swarm Foundation]]; [[Software Supply Chain Security]]).
- **Rails test secret in production**: signed-cookie forgery led to deserialization, paid at $18,000 ([[raw/medium.com/a-test-secret-in-production-how-a-rails-session-cookie-earned-18-000-f-15524|write-up]]).
- **Arize Phoenix CVE-2026-53998**: an unauthenticated GraphQL format string leaked `PHOENIX_SECRET` and the stored LLM keys ([[raw/stackurity.ai/arize-phoenix-cve-2026-53998-graphql-format-string-secrets-leak-15629|Stackurity]]).
- **Airline cargo Keycloak**: `admin:admin123` on a cloned training environment exposed 766 accounts ([[raw/infosecwriteups.com/admin-admin123-how-default-keycloak-credentials-on-a-cargo-training-en-15806|write-up]]).
- **Leaked TLS keys**: 2,600 valid certificates mapped to leaked private keys, but only 24 were revoked via CRL ([[raw/blog.gitguardian.com/2-622-valid-certificates-exposed-google-gitguardian-study-4071|GitGuardian/Google]]).
## Checklist
- [ ] Inventory covers repos and full history, CI variables, images, built bundles and third-party scripts, chat and ticketing, endpoints and runners.
- [ ] Scanning runs at pre-commit, at push, in CI, org-wide, in public monitoring and on artifacts, with at least two engines and generic rules enabled.
- [ ] Custom detectors exist for internal token formats, and internal tokens use unique prefixes.
- [ ] No IAM users or static cloud keys in CI. OIDC trust pins owner/repo/environment by ID, and roles have no IAM write.
- [ ] Remaining static secrets sit in a store with per-secret least privilege, audit logs and mounted-file delivery, not environment variables.
- [ ] No CI identity, build system or agent tool can decrypt production secrets.
- [ ] No fallback defaults: the app fails closed when a secret is missing. Default admin passwords are changed on *every* cloned environment.
- [ ] Client-shipped values (bundles, apps, firmware) are treated as public. Vendor calls are proxied or use per-user server-minted tokens.
- [ ] The leak runbook ends in confirmed invalidation, then a log review from the exposure time. Time-to-revoke is tracked.
- [ ] Every credential has an owner, an expiry and a rollback plan for rotation.
- [ ] Canary credentials are seeded in repos, CI and agent/prompt context, and any use pages someone ([[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|THN]]).
- [ ] Public JWKS contain public parameters only; diagnostic endpoints (Actuator `/env`) are unexposed or masked.
- [ ] Developer and agent endpoints use non-exportable SSH keys, short-lived CLI sessions and `.env` outside agent working directories.
- [ ] Self-hosted AI and observability tools (Phoenix, LiteLLM and similar) are inventoried and patched, and their master keys are rotated after exposure.
## Sub-pages
- [[Hardcoded Secrets]]: fallbacks, vendor and firmware credentials, keys in JS bundles and mobile apps, signing keys.
- [[Secrets in Git History]]: deleted is not gone. Covers oops commits, forks, caches and the remediation order for history rewrites.
- [[Secrets in Logs and Build Artifacts]] — app and CI logs, telemetry, image layers, build caches, packages and source maps.
- [[Developer Workstation Secrets]]: laptops and CI runners as credential stores, infostealers, AI-agent config files.
- [[Leaked Cloud Credentials]]: harvesting pipelines, Bedrock and Gemini keys, cryptojacking, extortion, LLMjacking, PAT→cloud.
- [[Secret Scanning]]: match, decode and verify stages, scan points, Gitleaks vs TruffleHog, precision and noise.
- [[Vaults and Secret Stores]]: Vault/OpenBao, Secrets Manager, CSI Driver, VSO, SOPS, store hardening, decrypt-path review.
- [[Workload Identity Federation]]: GitHub OIDC, IRSA, Pod Identity, Roles Anywhere, and trust-policy pitfalls.
- [[Credential Rotation and Revocation]]: time-to-revoke, rotation patterns, the leaked-credential runbook, SCALER inventory.
Related topics: [[Software Supply Chain Security]] · [[CI-CD Pipeline Attacks]] · [[GitHub Actions Security]] · [[Pwn Requests]] · [[Server-Side Request Forgery]] · [[Cloud Metadata Service Exploitation]] · [[JWT Secret Cracking]] · [[JSON Web Tokens]] · [[JavaScript Analysis]] · [[AI and LLM Security]] · [[OpenID Connect Security]] · [[Authentication Security]]
## Sources
- [[raw/cheatsheetseries.owasp.org/secrets-management-owasp-cheat-sheet-series-2716|Secrets Management - OWASP Cheat Sheet Series]]
- [[raw/blog.gitguardian.com/the-state-of-secrets-sprawl-2026-ai-service-leaks-surge-81-3771|The State of Secrets Sprawl 2026: AI-Service Leaks Surge 81%]]
- [[raw/thehackernews.com/the-state-of-secrets-sprawl-2026-9-takeaways-for-cisos-3777|The State of Secrets Sprawl 2026: 9 Takeaways for CISOs]]
- [[raw/gitguardian.com/the-state-of-secrets-sprawl-2026-gitguardian-annual-report-4349|The State of Secrets Sprawl 2026 - GitGuardian Annual Report]]
- [[raw/github.blog/github-found-39m-secret-leaks-in-2024-the-github-blog-4711|GitHub Found 39M Secret Leaks in 2024]]
- [[raw/unit42.paloaltonetworks.com/cloudkeys-in-the-air-exposed-iam-keys-cryptojacking-4069|CloudKeys in the Air: Exposed IAM Keys Cryptojacking]]
- [[raw/unit42.paloaltonetworks.com/leaked-env-variables-allow-large-scale-cloud-extortion-4063|Leaked Env Variables Allow Large-Scale Cloud Extortion]]
- [[raw/tachyon.so/what-happened-after-we-pushed-our-env-to-a-public-repo-10676|What happened after we pushed our .env to a public repo]]
- [[raw/thehackernews.com/google-warns-llmjacking-attacks-are-costing-some-enterprises-up-to-1-m-13136|Google Warns LLMjacking Attacks Are Costing Some Enterprises Up to $1M]]
- [[raw/thehackernews.com/unc6426-exploits-nx-npm-supply-chain-attack-to-gain-aws-admin-access-i-4935|UNC6426 Exploits nx npm Supply-Chain Attack to Gain AWS Admin Access]]
- [[raw/krebsonsecurity.com/cisa-admin-leaked-aws-govcloud-keys-on-github-8102|CISA Admin Leaked AWS GovCloud Keys on Github]]
- [[raw/trufflesecurity.com/truffle-security-secrets-revocation-program-13348|Truffle Security Secrets Revocation Program]]
- [[raw/microsoft.com/threat-actors-use-agentic-ai-tooling-to-find-and-abuse-exposed-secrets-13575|Threat actors use agentic AI tooling to find and abuse exposed secrets]]
- [[raw/stepsecurity.io/artex-attackers-adopted-this-ai-pentesting-tool-in-three-months-leaked-14704|ARTEX: Attackers Adopted This AI Pentesting Tool in Three Months]]
- [[raw/blog.gitguardian.com/financial-services-cybersecurity-vs-artex-credentials-in-plain-sight-15763|Financial services cybersecurity vs ARTEX: credentials in plain sight]]
- [[raw/gsmaragd.github.io/keys-on-doormats-exposed-api-credentials-on-the-web-ccs-2026-15764|Keys on Doormats: Exposed API Credentials on the Web (CCS 2026)]]
- [[raw/infosecwriteups.com/admin-admin123-how-default-keycloak-credentials-on-a-cargo-training-en-15806|admin:admin123 — How Default Keycloak Credentials on a Cargo Training Environment Exposed 766 Employee Accounts]]
- [[raw/sonarsource.com/inside-secretless-analysis-from-ci-identity-to-project-scoped-access-15755|Inside secretless analysis: from CI identity to project-scoped access]]
- [[raw/stackurity.ai/arize-phoenix-cve-2026-53998-graphql-format-string-secrets-leak-15629|Arize Phoenix CVE-2026-53998: GraphQL format-string secrets leak]]
- [[raw/github.com/hirdman-radar-burp-extension-showing-subdomains-and-leak-counts-per-ho-15671|hirdman-radar: Burp extension showing subdomains and leak counts per host]]
- [[raw/github.com/owasp-wrongsecrets-6950|OWASP/wrongsecrets]]
- [[raw/flare.io/thousands-of-secrets-exposed-on-docker-hub-4067|Thousands of Secrets Exposed on Docker Hub]]
- [[raw/infoq.com/researcher-unearths-thousands-of-leaked-secrets-in-github-s-oops-commi-2770|Researcher Unearths Thousands of Leaked Secrets in GitHub's Oops Commits]]
- [[raw/peris.ai/26-400-working-keys-in-7-25m-repos-deleting-from-git-does-not-revoke-13287|26,400 working keys in 7.25M repos: deleting from Git does not revoke]]
- [[raw/blog.gitguardian.com/claude-code-settings-local-json-secrets-17-months-of-exposure-on-githu-13955|Claude Code settings.local.json Secrets: 17 Months of Exposure]]
- [[raw/blog.gitguardian.com/inside-the-litellm-hack-153gb-433-909-files-2-488-organizations-11384|Inside the LiteLLM hack: 153GB, 433,909 Files, 2,488 Organizations]]
- [[raw/medium.com/the-railway-breach-from-a-build-system-privilege-escalation-to-decrypt-13147|The Railway Breach: From a Build-System Privilege Escalation to Decrypted Customer Secrets]]
- [[raw/medium.com/a-test-secret-in-production-how-a-rails-session-cookie-earned-18-000-f-15524|A Test Secret in Production: How a Rails Session Cookie Earned $18,000]]
- [[raw/blog.gitguardian.com/2-622-valid-certificates-exposed-google-gitguardian-study-4071|2,622 Valid Certificates Exposed: Google-GitGuardian Study]]
- [[raw/blog.gitguardian.com/why-is-credential-rotation-so-hard-follow-one-leaked-production-key-15022|Why Is Credential Rotation So Hard? Follow One Leaked Production Key]]
- [[raw/blog.gitguardian.com/how-to-measure-time-to-revoke-for-exposed-credentials-10653|How to Measure Time to Revoke for Exposed Credentials]]
- [[raw/blog.gitguardian.com/rotating-1-000-service-account-passwords-with-zero-outages-why-the-inv-12422|Rotating 1,000 Service Account Passwords With Zero Outages]]
- [[raw/blog.gitguardian.com/every-laptop-is-a-credential-store-where-secrets-hide-10236|Every Laptop Is a Credential Store: Where Secrets Hide]]
- [[raw/github.com/trufflehog-find-verify-and-analyze-leaked-credentials-2776|TruffleHog - Find, Verify, and Analyze Leaked Credentials]]
- [[raw/github.com/gitleaks-find-secrets-with-gitleaks-2775|Gitleaks - Find Secrets with Gitleaks]]
- [[raw/docs.aws.amazon.com/sec02-bp03-store-and-use-secrets-securely-aws-well-architected-4493|SEC02-BP03 Store and use secrets securely]]
- [[raw/docs.github.com/oidc-security-hardening-for-github-actions-4060|OIDC Security Hardening for GitHub Actions]]
- [[raw/miggo.io/cve-2025-68429-storybook-env-secrets-exposure-4064|CVE-2025-68429: Storybook .env Secrets Exposure]]
- [[raw/developer.hashicorp.com/aws-secrets-engine-hashicorp-vault-2769|AWS Secrets Engine - HashiCorp Vault]]
- [[raw/bleepingcomputer.com/rackspace-spot-breach-let-hackers-access-customer-kubernetes-secrets-15960|Rackspace Spot breach let hackers access customer Kubernetes secrets]]
- [[raw/ethswarm.org/swarm-incident-malicious-bee-js-13-3-0-and-swarm-desktop-0-56-2-15953|Swarm incident: malicious bee-js 13.3.0 and Swarm Desktop 0.56.2]]
- [[raw/github.com/webtoffee-product-feed-hard-coded-cryptographic-key-15967|WebToffee Product Feed hard-coded cryptographic key]]
- [[raw/medium.com/jwks-and-kid-explained-how-to-find-the-key-that-signed-your-token-and-15966|JWKS and kid Explained: How to Find the Key That Signed Your Token (and Spot a Leaked Private Key)]]
- [[raw/medium.com/your-company-s-ai-credentials-could-already-be-exposed-and-google-won-15910|Your Company's AI Credentials Could Already Be Exposed — and Google Won't Help You Find Them]]
- [[raw/medium.com/how-your-apis-key-ends-up-readable-through-actuator-4-mistakes-to-avoi-15941|How Your APIs Key Ends Up Readable Through Actuator: 4 Mistakes to Avoid]]
- [[raw/thehackernews.com/openrouter-drops-3-providers-after-researchers-catch-months-of-prompt-15915|OpenRouter Drops 3 Providers After Researchers Catch Months of Prompt Theft at AI Hosting Firms]]
- [[raw/vulncheck.com/bisheng-auth-bypass-via-hard-coded-jwt-signing-secret-15965|BISHENG auth bypass via hard-coded JWT signing secret]]
- [[raw/vulncheck.com/tensei-auth-bypass-via-hard-coded-jwt-secret-15964|Tensei auth bypass via hard-coded JWT secret]]