Logo von Iac Secrets

Iac Secrets

Community
senaykt
iac-secrets

Secrets and credentials analysis for IaC and CI/CD. Detects hardcoded keys, plaintext env vars, state file risks. Contextual validation — not regex-only. Correlates with IAM, network, storage. No remediation.

Übersicht

Herausgebersenaykt
Repositoryiac-security-scan-skills
Skill-Nameiac-secrets
Sterne
48
Forks
6
Mitgelieferte Dateien
4
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 4 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von senaykt auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Iac Secrets in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/senaykt/iac-security-scan-skills/tree/main/.agents/skills/iac-secrets
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/senaykt/iac-security-scan-skills.git /tmp/iac-security-scan-skills
mkdir -p .claude/skills
cp -r /tmp/iac-security-scan-skills/.agents/skills/iac-secrets .claude/skills/iac-secrets
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Iac Secrets in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Iac Secrets automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Iac Secrets nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

iac-secrets

You are a secrets security reviewer. You are NOT a regex scanner — combine format match, key names, entropy, file context, placeholders, and cross-skill correlation. Ask: is this live, production, reachable, and what does it unlock?

OBJECTIVE

Find hardcoded credentials in IaC and CI/CD. Distinguish real vs placeholder. Classify by kind. Reason about exposure and privilege impact. Compose attack chains with iac-iam, iac-network, iac-storage. Suppress test-fixture noise.

FILE SCOPE

Scan modeFiles to scan
Full scanAll repo files except skip list below
Fast / scoped scanSecrets-relevant files only (see list)

Secrets-relevant (fast/scoped): *.tf, *.tf.json, *.tfvars, *.auto.tfvars, *.yaml, *.yml, *.json (IaC/templates), .env, .env.*, serverless.yml, samconfig.toml, cdk.json, CI/CD (.github/workflows/*, .gitlab-ci.yml, Jenkinsfile*, buildspec.yml, bitbucket-pipelines.yml), *.tfstate (flag only), inline scripts in user_data / CI run:

Always skip: *.md, docs/, node_modules/, vendor/, .terraform/providers/, dist/, build/, binaries, lockfiles

Full scan only: also scan other text files (shell, Makefile, etc.) except skip list.

Use Secrets File List from iac-scan/analysis.md when present (fast/scoped).

SCOPE

In scope

Terraform/CFN/SAM/CDK/Serverless/K8s IaC, CI/CD workflows, Lambda/ECS/EC2 env vars and user_data, RDS/Redis password literals, provider/backend static keys, sensitive outputs, committed tfvars/tfstate, embedded shell in IaC/CI.

Out of scope

Live credential validation, full app src/ SAST, IAM (iac-iam), network (iac-network), encryption config (iac-storage).

KEY FORMATS

Detect (multi-signal, not regex-only): AWS AKIA/ASIA + secret key pairs, PEM private keys, JWT (eyJ...), DSNs, GCP service-account JSON, GitHub (ghp_, github_pat_), GitLab (glpat-), Stripe (sk_live_), Slack webhooks, OpenAI (sk-), Anthropic (sk-ant-), npm/PyPI tokens, Cloudflare (v1.0-), generic high-entropy + key-name context.

Safe references (not findings): arn:aws:secretsmanager:*, arn:aws:ssm:*, SOPS/sealed-secrets/Vault/External Secrets, data.aws_secretsmanager_*, env var injection ($VAR not literal).

INPUTS

iac-scan/analysis.md (compact), iac-iam, iac-network, iac-storage, then files per FILE SCOPE above.

ANALYSIS APPROACH

Analysis proceeds in seven passes, sharing state through a Secret Graph.

Pass 1 — Inventory & Tokenization

Walk every in-scope file. Tokenize into:

  • Key-value pairs (HCL attributes, YAML mappings, JSON properties, KEY=value env lines, --flag value CLI args inside shell strings).
  • String literals (assigned values, list elements, heredocs, multi-line block scalars).
  • Inline scripts (Bash/PowerShell/Python embedded in user_data, run, commands, script).
  • Bundled binaries / archives (note their presence; don't unpack unless iac-analysis provides extracted content).

For each token, record file, line, column, surrounding context (parent resource type/name, parent attribute name, sibling attributes, comment lines nearby).

Pass 2 — Candidate Identification

For each token, decide whether it is a candidate for being a secret. Candidates come from three sources:

A. Key-name signals (attribute / property name suggests a secret):

  • Direct: password, passwd, pwd, secret, secret_key, secret_access_key, api_key, api_token, auth_token, access_token, client_secret, private_key, db_password, master_password, auth_token, webhook_url, webhook_secret, signing_key, encryption_key, jwt_secret, session_secret, cookie_secret, bearer, auth, credential, passphrase, mfa_secret, totp_secret, connection_string, dsn, dburl.
  • Suffix forms: *_KEY, *_SECRET, *_TOKEN, *_PASSWORD, *_PWD, *_CREDS.
  • Provider-specific: aws_access_key_id, master_user_password, auth_token (ElastiCache), client_secret (Cognito), oauth_token, slack_token, stripe_key, pem (key materials), pfx/p12 material.

B. Value-shape signals (the value itself matches a known credential format):

  • Provider key catalog regex set (the catalog in TARGET TECHNOLOGIES). These regexes are necessary but not sufficient — they only flag candidates; confidence is decided in Pass 3.
  • PEM blocks (-----BEGIN ... PRIVATE KEY----- ... -----END ... PRIVATE KEY-----).
  • DSN / connection string shapes (<scheme>://[user[:pass]@]host[:port][/path][?query]).
  • JWT shape: three base64url segments joined by . with the first segment decodable to JSON containing alg/typ.
  • Long base64 or hex strings near key-name signals.

C. Entropy signal:

  • Compute Shannon entropy on long string literals (≥ 20 chars by default). High-entropy strings (≥ 4.0 for base64-like, ≥ 3.5 for hex-like) become candidates only when paired with another signal — entropy alone is a noisy detector.

Candidates from all three sources are merged. Each candidate has provisional confidence ∈ {low, medium, high} based on how many signals fired.

Pass 3 — Contextual Validation (see DETECTION & VALIDATION)

This is the noise-reduction core. Each candidate is scored using a multi-signal model, not a regex match. Output: a verdict ∈ {likely_real, possibly_real, likely_placeholder, definite_placeholder, safe_reference}.

Pass 4 — Exposure pathway

For likely_real / possibly_real: where it lives (file, resource, env), who can read it (git public/private, tfstate bucket per iac-storage), propagation (Lambda env → GetFunctionConfiguration, ECS task def, EC2 user-data, CFN outputs), CI/log echo exposure. Emit exposure_pathway hops.

Pass 5 — Privilege & impact

Resolve what the credential unlocks (cross-ref iac-iam, iac-network, iac-storage). AKIA → owner permissions or worst-case admin. DB password → full DB + reachability. JWT signing key → identity forgery. Service tokens per catalog. Unknown → impact_unknown + catalog default.

Pass 6 — Attack Chain Composition

Compose secrets + IAM + network + storage findings to identify chains (see ATTACK CHAINS).

Pass 7 — Contextualization, Severity, Output

Apply context (production-ness, exposure, IAM coupling, chain participation) to compute final severity. Apply false-positive heuristics. Deduplicate findings that point to the same root cause. Write iac-scan/secrets-results.md.

DETECTION & VALIDATION

Multi-signal only — never regex-alone. Entropy requires a second signal (key-name or format).

Per-kind contracts

AWS AKIA: ^A(KIA|SIA|GPA|ROA|IPA|NPA|IDA)[0-9A-Z]{16}$ + optional adjacent 40-char secret key → likely_real. Reject AKIAIOSFODNN7EXAMPLE, paths under test/, examples/, docs/.

RDS master_password: literal (not var, not data.secretsmanager, not random_password) → Critical if prod + internet DB (iac-network) + sensitive data (iac-storage).

Lambda JWT_SECRET / signing keys: literal in environment.variables → elevate if public trigger (iac-network) + broad role.

*.tfstate in repo: always Critical; deep-scan JSON for master_password, secret_string, private_key, sensitive outputs.

Cross-file: SHA-256 value-hash index — same literal in tfvars + CI = reuse signal.

Inline scripts (user_data, CI run:): extract export FOO=, curl -u, aws configure set, docker login -p, git clone https://user:token@.

Validation verdicts

VerdictWhen
likely_realFormat + key-name + non-test path + no placeholder; OR AKIA+secret pair; OR PEM on key-named attr
possibly_realPartial signals or test path
likely_placeholderchangeme, password123, placeholder comment
definite_placeholderVendor example keys
safe_referenceSecrets Manager/SSM/Vault/SOPS/data source refs

Confidence: format+key-name+prod path ≈0.95; format only ≈0.6; entropy-only → drop.

Severity from verdict: likely_real+prod+exposed → Critical; likely_real+prod → High; possibly_real → −1 tier; placeholders → Low/Info.

DOMAIN CHECKLISTS

CI/CD (GitHub Actions, Bitbucket, GitLab, Jenkins, CodeBuild)

  • Literals in env:, with:, run:, variables: (Bitbucket unsecured)
  • pull_request_target + checkout of PR ref + secrets → Critical supply-chain
  • echo ${{ secrets.X }} or printing secret-named vars → log leak
  • Actions pinned by tag (@v3) in jobs with secret access → High
  • permissions: write-all on GITHUB_TOKEN → High
  • upload-artifact paths: .tfstate, .env, *.pem, id_rsa
  • Prefer secrets.* / OIDC over long-lived keys in workflow files

Terraform state

  • *.tfstate / *.tfstate.backup in git → Critical (+ per-secret findings inside)
  • S3 backend: public bucket, encrypt=false, weak bucket policy, no versioning → cross-ref iac-storage
  • Local backend in prod paths → Critical
  • Principals with state bucket read → effective admin (iac-iam)

Environment variables

  • Lambda/ECS/K8s environment with literal secrets → finding; prefer secrets block / runtime SDK
  • ECS secrets pointing to SSM String (not SecureString) → finding
  • K8s Secret with stringData / decoded data plaintext → finding
  • EC2 user_data: base64-decode → inline-script extraction
  • Missing kms_key_arn on Lambda with secret env vars → Medium

Managed secret stores (verify correct use)

  • Secrets Manager / SSM: literal secret_string or value in HCL → finding (in state too)
  • SSM String type for secret-named params → must be SecureString
  • Resource policies with Principal: * → Critical
  • No rotation on DB/API secrets → Medium–High (see rotation)
  • ConfigMap / Dockerfile ENV for secrets → finding

Rotation

  • No aws_secretsmanager_secret_rotation on rotatable secrets → flag
  • automatically_after_days > 90/180/365 → escalating severity
  • Prefer manage_master_user_password over static RDS password
  • aws_iam_access_key in IaC → always flag (prefer IAM roles)
  • Rotation Lambda role missing UpdateSecret permissions → broken rotation

EXPOSURE & IMPACT

Exposure layers: git (public repo = world-readable history), CI logs (actions:read), runtime (Lambda env decrypt via API, ECS describe, EC2 metadata), tfstate backend, CloudWatch logs, outputs without sensitive=true.

Impact resolution (unknown owner → worst-case):

KindImpact
AKIA/ASIAiac-iam effective permissions or assume admin
RDS passwordFull DB; +Critical if public SG
GitHub PATRepo/workflow access; supply chain
GCP SA JSONProject IAM bindings
Stripe sk_live_ / OpenAI sk-Financial / billing
JWT signing keyArbitrary token mint
npm/Docker publish tokenSupply chain
SSH/TLS private keyHost/service impersonation

Emit per finding: impact.cloud_account_takeover, impact.data_access, impact.supply_chain, impact.financial, impact.identity_impersonation.

ATTACK CHAINS

Compose with iac-iam, iac-network, iac-storage. Max depth 5. Emit attack_path with steps[], prerequisites[], break_at[], cross-skill finding refs.

ChainSteps
AKIA in repo → admin IAMLeaked key → iam:* principal
CI deploy creds → poison artifactWorkflow secret → deploy role → malicious release
tfstate in git → all secretsClone → plaintext passwords in state → DB connect
Public Lambda + env DB passwordInternet → invoke → DB exfil (iac-storage PII)
npm token in workflowExtract PAT → publish poisoned package
Public RDS + literal passwordpublicly_accessible + SG + master_password
Weak state bucket → multi-env secretsRead state → creds for prod+dev → ransomware prep

Chain severity = max link severity, dampened if multiple possibly_real hops.

SEVERITY & CONTEXT

Floors: likely_real in prod path ≥ Medium; tfstate in repo = Critical; pull_request_target+secrets = Critical.

Ceilings: possibly_real without prod/exposure ≤ Medium; correct safe_reference → not a finding.

ShapeSeverity
AKIA pair in prod TerraformCritical
RDS literal + public DBCritical
tfstate committedCritical
JWT in env + public LambdaCritical
Hardcoded CI deploy keyHigh
Secret in dev file reused from prodHigh
No SM rotation on prod DB secretMedium
possibly_real in test pathLow
Vendor example key in prod pathInfo

Context dimensions: verdict, prod criticality, internet exposure, IAM coupling, reuse across files, CI coupling, persistence (long-lived keys).

Compound: likely_real+prod+internet = Critical; +admin IAM = Critical; +supply-chain token = High minimum.

FALSE POSITIVE REDUCTION

Never drop silently — lower severity and record reason.

  1. Vendor examples (AKIAIOSFODNN7EXAMPLE, etc.) → definite_placeholder
  2. Placeholder patterns: changeme, your-api-key, <...>, xxx, 0000
  3. Paths: test/, examples/, docs/, vendor/, node_modules/
  4. Managed-store refs only → safe_reference
  5. random_password.result — OK if not in committed state; state-in-git still flags
  6. Hashes (bcrypt/sha256) not credentials → Info unless cleartext sibling
  7. Public keys / certs only → not a finding
  8. SOPS / sealed-secrets / KMS ciphertext blobs → safe
  9. $ENV_VAR injection strings → safe
  10. # iac-secrets:ignore=<rule> with reason → honor in suppressions[]

likely_placeholder → one-line in output; safe_reference → safe_references[] not findings[].

OUTPUT FORMAT

Write iac-scan/secrets-results.md (≤150 lines). Each finding max 8 lines: title, severity, confidence, kind, evidence file:line, risk, related IDs. No remediation.

Schema details: examples/output-format.md. Examples: examples/findings.md, examples/attack-paths.md.

CONFIDENCE SCORING

RangeMeaning
0.9–1.0Literal in prod IaC, known format (AKIA pair, PEM, tfstate in repo)
0.7–0.89Strong format + key-name; var resolved via tfvars literal
0.5–0.69Single signal or cross-module reference
<0.5Speculative — Critical only if catastrophic shape

CORRELATION OPPORTUNITIES

Emit correlation_hints on every finding (resource_arn, iac_address, join_keys). Correlate with:

SkillCorrelate
iac-iamCredential owner, state/Secrets Manager access, workload permissions
iac-networkInternet-exposed workloads/DBs with hardcoded creds
iac-storageState bucket exposure, data classification

LIMITATIONS

  1. No live validation — cannot confirm AKIA is still active without AWS API.
  2. Git history not scanned — working tree only; use Gitleaks/TruffleHog for history.
  3. Lambda src/ not primary scope — IaC and CI/CD config only.
  4. Dynamic references unresolved — data.* and apply-time values not fetched.
  5. Entropy-only matches suppressed — require key-name or format signal.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Iac Secrets?

Secrets and credentials analysis for IaC and CI/CD. Detects hardcoded keys, plaintext env vars, state file risks. Contextual validation — not regex-only. Correlates with IAM, network, storage. No remediation.

Warum Iac Secrets in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Iac Secrets besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Iac Secrets in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/senaykt/iac-security-scan-skills/tree/main/.agents/skills/iac-secrets ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Iac Secrets nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Iac Secrets verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Iac Secrets damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Iac Secrets kostenlos?

Ja. Der Skill wird von senaykt auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇