Cloud Config Sanitizer

Paste a Kubernetes, Terraform, or Crossplane manifest to detect secrets, security smells, and generate a sanitized copy. Nothing leaves your browser.

ZERO UPLOAD · ALL LOCAL
  1. Paste a Kubernetes, Terraform, or Crossplane manifest into the input area, or drop a .yaml, .yml, .json, or .tf file.
  2. Findings appear instantly — each document is analyzed separately, with severity-coded rows showing the exact key path and type of each secret or smell.
  3. Review the Sanitized Output area — all detected secrets have been replaced with safe placeholders like __REDACTED_AWS_ACCESS_KEY_1__.
  4. Click Download .yaml to get the clean manifest with placeholders, safe to share or commit.
  5. Click Download .env template to get a ready-to-fill .env file listing all stripped keys — paste in your real values and keep it out of version control.

What to look for

  • AKIA + 16 uppercase letters/digits
  • 40 characters
  • >=4.5 bits/char over 16+ characters

A critical AKIA match should prompt you to inspect nearby high-entropy findings for the paired secret.

What to look for

  • ghp_ + 36 base62 characters
  • gho_ (OAuth), ghs_ (installation), ghr_ (refresh), github_pat_ (fine-grained)

Only the classic ghp_ shape matches the dedicated rule; other prefixes rely on the entropy and suspicious-key fallbacks.

What to look for

  • xoxb-, xoxp-, xoxr-, xoxs-
  • xapp- (caught by the entropy fallback instead)

Slack tokens do not expire by default; assume a leaked one is still live until revoked.

What to look for

  • sk_live_
  • sk_test_
  • up to 7 days

Test-mode keys are redacted too; both modes still expose the integration shape an attacker would study.

What to look for

  • -----BEGIN <=30 chars PRIVATE KEY-----
  • PRIVATE KEY, RSA PRIVATE KEY, EC PRIVATE KEY, ENCRYPTED PRIVATE KEY

Base64 key material inside a Kubernetes Secret's data/stringData is redacted unconditionally by a separate rule, even with no visible BEGIN line.

What to look for

  • three dot-separated base64url segments, header starting eyJ
  • secret, private_key, jwt_secret, signing_key

A leaked signing secret is worse than a leaked token: it lets an attacker mint unlimited tokens with arbitrary claims.

What to look for

  • postgres://, mysql://, mongodb://, redis://
  • a userinfo section (user:password@) before the host

A credential-free URI like postgres://localhost:5432/dev produces no finding; the rule only fires when userinfo is present.

What to look for

  • 16 characters
  • 4.5 bits per character
  • hex-only strings max out at 4 bits/char and never trigger this rule

Provider prefix rules run first; a high-entropy-only finding means the string matched no known credential shape.

Input (Manifest)

Drop .yaml / .yml / .json / .tf here

or click to browse

── or paste below ──

Output (Sanitized manifest)

Why offline?

Kubernetes manifests and Terraform configs frequently contain secrets: API keys hardcoded into environment variables, database connection strings in ConfigMaps, cloud provider bearer tokens in CronJob templates, or JWT signing secrets embedded in Deployment specs.12 The moment you paste one of these files into an online linter, attach it to a ticket, or share it in a chat for debugging help, the secret is effectively exposed to every system that touches the request.

Browser-only parsing

CapyToolkit runs the entire analysis in your browser using JavaScript. All parsing, pattern matching, and redaction happen locally with the yaml library. No manifest content is ever uploaded, transmitted, or written to disk. You can verify this yourself by opening DevTools and watching the Network tab while you work, and you will see no outbound requests when you paste or drop a file.

Because the tool works fully offline after the initial page load, you can use it on air-gapped machines, in CI pipelines with no external egress, or behind strict network proxies that block third-party services. There are no API calls, no analytics pings, and no tokens stored in localStorage between sessions.

Supported formats

The tool accepts YAML (including multi-document files separated by ---) and JSON.3 You can paste a manifest directly into the input area or drop a .yaml, .yml, .json, or .tf file onto the page. Kubernetes manifests, Terraform HCL-in-JSON, and Crossplane compositions all parse correctly, and the sanitizer detects which format you are using before running any rules.

Input methods

Native HCL (.tf syntax without a JSON wrapper) is not yet supported because the parser relies on standard YAML or JSON deserialization. If your workflow uses raw HCL, convert your files to JSON first with terraform show -json or a similar converter before pasting them here. Once the file is loaded, the sanitizer splits multi-document YAML files on the --- separator and analyzes each document independently so that every resource in a bundle gets its own findings section.

Rule engine

The analyzer walks every string value in the parsed document once and runs through three layers of detection in sequence: provider patterns for known token formats, entropy and key-name heuristics for values that look secret but do not match a known prefix, and then Kubernetes-specific security flags for non-string fields like booleans on a pod’s securityContext. The pipeline runs in a single pass so that large manifests stay responsive.

Provider-specific patterns

Each string value is checked in order against known provider token formats, including AWS access key IDs beginning with AKIA.4 GitHub classic personal access tokens begin with ghp_, and GitLab personal access tokens default to glpat-.56 Slack access tokens use xox[bprs]- style prefixes,7 Stripe secret keys use sk_live_ or sk_test_,8 Google API keys use the AIza prefix,9 npm tokens use npm_,10 and Twilio Account SIDs start with AC followed by 32 hexadecimal characters.11

A concrete example ties the rule to the output. A ConfigMap entry reading AWS_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE matches the AKIA prefix pattern and appears in the sanitized manifest as AWS_ACCESS_KEY_ID: __REDACTED_AWS_ACCESS_KEY_1__, with the real value moved into the downloaded .env template under the same key. AKIAIOSFODNN7EXAMPLE is AWS's own published example key ID, used throughout their documentation specifically because it never resolves to a real account.

Entropy and key-name heuristics

After the provider rules run, every string is checked against a Shannon entropy threshold of 4.5 on strings of 16 or more characters (high severity).12 The analyzer then compares each parent key name against a list of suspicious labels that frequently hold secrets, including password, secret, and api_key (medium severity). This catches values that do not match a known provider format but are stored under obviously sensitive key names.

Kubernetes security flags

Non-string values and numeric or boolean fields are checked for Kubernetes security smell flags that increase the blast radius of a compromised pod. The analyzer flags privileged: true, hostNetwork: true, and hostPID: true at info severity.13 Missing or false readOnlyRootFilesystem and runAsNonRoot on a container’s securityContext are also flagged, since a writable root filesystem and a root user both make it easier for an attacker who gains code execution inside the container to persist or escalate.14

All values inside a Kubernetes Secret’s .data or .stringData map are always flagged critical regardless of their content, since those fields are the canonical place where Kubernetes stores credentials and the sanitized output should never include the raw values.1 Placeholder names use the redacted key type so you can find and replace each one with a real secret from your environment.

Security model

The sanitized manifest replaces each detected value with a unique placeholder like __REDACTED_AWS_ACCESS_KEY_1__ that preserves the key path and value type so you can find and replace each secret in your environment. The placeholder name includes both the matched rule and a sequential counter so that two AWS keys in the same document never collide. The original values are never stored, cached, or transmitted anywhere. When you close the tab or reload the page, the parsed document and all findings are discarded with it.

What redaction covers

The sanitizer redacts string values that match a known provider pattern or exceed the entropy threshold, plus boolean and numeric fields that trigger a Kubernetes security smell. Each finding records the exact dotted key path into the nested document so that you can locate the original line in your source file. The .env template lists every redacted key on its own line, ready for you to fill in real values from a secrets manager or your local environment.

NOTE Pattern-based detection catches known secret formats but cannot guarantee completeness, since novel credential types and local conventions may not match any rule. Always review the findings list against your own knowledge of the manifest and treat the sanitized output as a best-effort redaction, not a security certification or a substitute for a dedicated secrets manager.

How secrets end up in manifests

Credentials in configuration files typically arrive through one of a few common paths. A developer testing a deployment locally hard-codes a database password in a ConfigMap rather than setting up a proper Secret reference, intending to fix it before merge but forgetting. A Helm values file gets a real SendGrid API key placed in a comment used as a placeholder example. A Terraform workspace stores sensitive outputs in state that gets committed alongside the configuration.2 In each case the credential was never intended to persist, but it ends up in version control. Tools that only check committed code miss in-progress files; this sanitizer checks whatever you paste, including working drafts before they are staged.

High-entropy strings are the harder case. A random 32-character string used as a session signing key does not look like a known credential format, so pattern-based tools that only check for known prefixes like AKIA or ghp_ will miss it. Consequently, this tool adds a Shannon entropy threshold: any string of 16 or more characters with entropy above 4.5 bits per character is flagged as a probable secret.12 This catches custom-generated tokens and opaque API keys that real-pattern rules miss, at the cost of occasional false positives on machine-generated identifiers that are not actually sensitive.

Kubernetes security posture beyond secrets

Besides credential leakage, Kubernetes manifests commonly contain configuration patterns that create privilege escalation or container escape risks. Containers running with privileged: true have essentially the same capabilities as root on the node and can mount host filesystems, modify kernel parameters, and break out of the container namespace. The hostNetwork: true setting shares the node's network namespace, giving the container direct access to services bound to localhost on the host that should not be reachable from pods. Similarly, hostPID: true allows the container to see and signal all processes on the node.13

Missing readOnlyRootFilesystem: true and runAsNonRoot: true in a container's securityContext are weaker signals but worth flagging in a review. A writable root filesystem makes it easier for an attacker who gains code execution inside the container to modify binaries or install tools. Running as root inside the container increases the blast radius if the container runtime has a privilege escalation vulnerability.14 The sanitizer flags all five of these patterns at info severity so that each one prompts a deliberate decision rather than slipping through unnoticed in a large manifest.

Secret Detection Thresholds

  • 4.5 bits/char on 16+ character strings
  • 12 provider-specific formats
  • Always flagged critical

Paste your own manifest above and check its findings against these detection thresholds.

Sources
  1. 1.

    AWS, "Data encryption and secrets management - Amazon EKS," docs.aws.amazon.com, accessed June 2026. https://docs.aws.amazon.com/eks/latest/best-practices/data-encryption-and-secrets-management.html

  2. 2.

    HashiCorp, "Protect sensitive input variables," developer.hashicorp.com, accessed June 2026. https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables

  3. 3.

    YAML Language Development Team, "YAML Ain’t Markup Language (YAML™) revision 1.2.2," github.com, October 2021. https://github.com/yaml/yaml-spec/blob/main/spec/1.2.2/spec.md

  4. 4.

    AWS, "GetAccessKeyInfo," docs.aws.amazon.com, accessed June 2026. https://docs.aws.amazon.com/STS/latest/APIReference/API_GetAccessKeyInfo.html

  5. 5.

    GitHub, "Keeping your account secure with a personal access token," docs.github.com, accessed June 2026. https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

  6. 6.

    GitLab, "Patents and personal access tokens," docs.gitlab.com, accessed June 2026. https://docs.gitlab.com/user/profile/personal_access_tokens/

  7. 7.

    Microsoft, "Slack access token entity definition," learn.microsoft.com, November 2025. https://learn.microsoft.com/en-us/purview/sit-defn-slack-access-token

  8. 8.

    Stripe, "API keys," docs.stripe.com, accessed June 2026. https://docs.stripe.com/keys

  9. 9.

    Microsoft, "Google API key entity definition," learn.microsoft.com, November 2025. https://learn.microsoft.com/en-us/purview/sit-defn-google-api-key

  10. 10.

    GitHub, "npm has a new access token format," github.blog, September 2021. https://github.blog/changelog/2021-09-23-npm-has-a-new-access-token-format/

  11. 11.

    Twilio, "What is a String Identifier (SID)?," www.twilio.com, accessed June 2026. https://www.twilio.com/docs/glossary/what-is-a-sid

  12. 12.

    C. E. Shannon, "A mathematical theory of communication," Bell System Technical Journal, vol. 27, pp. 379–423, July 1948. https://ieeexplore.ieee.org/document/6773024

  13. 13.

    Kubernetes, "Pod Security Standards," kubernetes.io, accessed June 2026. https://kubernetes.io/docs/concepts/security/pod-security-standards/

  14. 14.

    Kubernetes, "Configure a Security Context for a Pod or Container," kubernetes.io, accessed June 2026. https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

FAQ