Logo: Auditing Terraform State And Backend Trust

Auditing Terraform State And Backend Trust

Organisatioun
UnboundCompute
auditing-terraform-state-and-backend-trust

Iwwerpréift d'Späicherung vum Infrastrukturzoustand an de Backend op Expositioun a Manipulatioun: eng State-Datei mat Geheimnisser am Kloertext an engem Backend, op deen ze vill Principals zougräife kënnen; e State-Bucket oder Backend ouni Verschlësselung, Versiounéierung oder ageschränkten Zougrëff; e feelende oder net duerchgesate State-Lock, deen et erlaabt, datt gläichzäiteg Schreifoperatioune Korruptioun verursaachen; an eng Backend-Konfiguratioun, duerch déi en Ugräifer de State op eng Plaz ëmleede kann, déi e kontrolléiert. Ëmfaasst Terraform an ähnlech Tools, bei deenen d’State-Datei reell Ressource-Attributer an dacks geheim Wäerter enthält, an bei deenen all Persoun, déi de State liese oder schreiwe kann, dës Geheimnisser liese kann oder déi nächst Applikatiounsoperatioun sabotéiere kann. Benotzt dëse Skill, wann den Infrastrukturzoustand an engem gedeelt genotzte Backend gespäichert ass an dee Backend d’Vertrauensgrenz duerstellt. De Principal, deen de State liese oder schreiwe kann, ass d’Quell; de State-Store ass d’Zil; an d’exposéiert Geheimnis oder de manipulierbare State ass de Feeler.

Iwwersiicht

EditeurUnboundCompute
Repositorysecurity-agent-skills
Skill-Nummauditing-terraform-state-and-backend-trust
Stären
27
Forks
8
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    UnboundCompute huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Auditing Terraform State And Backend Trust an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-terraform-state-and-backend-trust
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-terraform-state-and-backend-trust .claude/skills/auditing-terraform-state-and-backend-trust
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Auditing Terraform State And Backend Trust an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Auditing Terraform State And Backend Trust automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Auditing Terraform State And Backend Trust net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Auditing Terraform state and backend trust: when the state file is the crown jewels

Infrastructure state is not a build artifact; it is a live record of every resource and, very often, the plaintext of the secrets those resources were created with, database passwords, generated keys, tokens. It also drives the next apply: whatever the state says exists is what the tool reconciles against. That makes the state backend a high-value target on two axes. Anyone who can read the state file can read the secrets in it, so a backend readable by too many principals is a secret-disclosure bug. Anyone who can write or redirect the state can corrupt the next apply or point it at resources they control, so a missing lock or a mutable backend configuration is a tampering bug. You audit these by checking who can read the state, how it is protected at rest, and whether writes are locked and the backend is fixed.

When to use

  • Infrastructure state is stored in a shared backend such as an object store or a remote state service.
  • The state file may contain plaintext secrets from resources it manages.
  • State access, encryption, versioning, locking, or backend configuration may be loose or unenforced.

Scope check

Audit state and backends only for infrastructure you own or are authorized to assess, on non-production state. Reading a state file exposes real secrets, so stay inside the authorized backend and treat any secret in state as sensitive within scope, never exfiltrating it. If you can't name the authorization, stop.

The loop

  1. Establish who legitimately needs state access first. Name the principals that must read and write the state for this infrastructure: the specific pipeline identity, the specific operators. This is the false-positive killer: a backend scoped to exactly those principals with encryption and locking is correct. Name the legitimate set, then compare actual access to it.

  2. Determine what secrets the state actually holds. Read whether the managed resources write secret values into state (generated passwords, keys, connection strings). If they do, every principal who can read the state reads those secrets, so the read-access set is a secret-disclosure boundary, not just an operational one. Confirm the sensitivity of what state contains.

  3. Scope the read access to the backend. Compute who can read the state store: the bucket or backend policy, identity policies, and any broad grant. Compare that set to the legitimate readers. A state bucket readable by a broad role, an entire account, or a wildcard is a direct path to the secrets in state.

  4. Check protection at rest and history. Confirm the backend encrypts state at rest, retains versions so a corrupting write can be recovered, and does not expose old versions to a wider set than current state. A backend without encryption or versioning leaves the secrets and the recovery path unprotected.

  5. Check locking and backend integrity. Confirm state locking is configured and enforced so two applies cannot write concurrently and corrupt the state, and that the backend configuration cannot be redirected by an attacker to a state location they control. A missing lock allows a corrupting race; a mutable backend pointer lets an attacker feed a poisoned state into the next apply.

  6. Confirm and record. Confirm by reading a secret from the state file as a principal that should not have state access but is admitted, or by showing state writes are unlocked or the backend is redirectable, within scope and without exfiltrating secrets or corrupting real state. Kill the lead if state read access is scoped to legitimate principals, state is encrypted and versioned, locking is enforced, and the backend configuration is fixed. Record the admitted principal, the state store sink, and the exposed secret or the tamperable state.

Where state and backend trust leak

  • State holds plaintext secrets. Generated passwords and keys land in state, so read access to the backend is read access to those secrets.
  • A broadly readable backend is secret disclosure. A state bucket open to a wide role or account exposes everything in state to that set.
  • No encryption or versioning removes protection and recovery. Unencrypted state exposes secrets at rest; no versioning means a corrupting write cannot be rolled back.
  • A missing lock allows corrupting races. Concurrent applies without a lock can leave state inconsistent with reality, breaking the next reconcile.
  • A redirectable backend poisons the next apply. If an attacker can change where state is read from, they feed a state that drives the tool to act on resources they control.

Worked example (a confirm and a kill)

Confirm. State is stored in an object bucket readable by a broad operations role, and the managed database resource writes its generated password into state in plaintext. The operations role, never intended to hold database credentials, reads the password from the state file. Confirmed secret disclosure through over-broad state access, high, remediation = scope the state bucket to the pipeline identity and named operators only, enable encryption at rest and versioning, and move generated secrets out of state into a managed secrets store where feasible.

Kill. The state backend is readable and writable only by the pipeline identity and two named operators, is encrypted at rest with versioning enabled, enforces state locking on every apply, and its backend configuration is fixed and not attacker-redirectable. A principal outside the set cannot read state and concurrent writes are blocked. Killed, kill_reason = "state access scoped to legitimate principals with encryption, versioning, and enforced locking, and a fixed backend; no unintended reader sees secrets and no unlocked or redirected write corrupts state."

Rationalizations to reject

  • "State is just infrastructure metadata." → State commonly holds plaintext generated secrets; read access to the backend is read access to those secrets.
  • "The bucket is internal." → Internal is not scoped; compute who can actually read the backend and compare to the legitimate reader set.
  • "We do not need versioning." → Without it, a corrupting write is unrecoverable; versioning is part of state integrity, not just convenience.
  • "Applies never overlap." → Confirm locking is enforced; an unlocked backend allows a corrupting race the moment two runs coincide.
  • "The backend config is in the repo." → Confirm it cannot be redirected by an attacker; a mutable backend pointer poisons the next apply regardless of where it lives.

Executing this in practice

You need the legitimate state readers and writers, what secrets the state holds, the read and write access to the backend, the encryption/versioning/locking posture, and whether the backend configuration is fixed. For each backend, compare the access set to the legitimate one and confirm protection and locking. Reading the backend policy shows the intended boundary; reading a secret from state as an unintended principal, or showing an unlocked write, shows whether it holds.

Related

  • auditing-infrastructure-as-code-exposures - the resource-declaration side; state is the runtime record of what those declarations produced, secrets included.
  • reviewing-secrets-manager-access-policy-trust - the better home for the secrets that leak through state; moving them there is the durable remediation.
  • auditing-iac-module-and-provider-supply-chain - the code side of the same pipeline; state trust and module trust are the two halves of IaC security.
  • hunting-non-human-identity-and-secret-reachability - the pipeline identity that reads and writes state is a machine credential; that skill traces what it can reach.
  • FINDING-SCHEMA.md - source = the principal who can read or write state, sink = the state store, evidence = the exposed secret or the tamperable state.

Heefeg gestallte Froen

Wat mécht de KI-Skill Auditing Terraform State And Backend Trust?

Iwwerpréift d'Späicherung vum Infrastrukturzoustand an de Backend op Expositioun a Manipulatioun: eng State-Datei mat Geheimnisser am Kloertext an engem Backend, op deen ze vill Principals zougräife kënnen; e State-Bucket oder Backend ouni Verschlësselung, Versiounéierung oder ageschränkten Zougrëff; e feelende oder net duerchgesate State-Lock, deen et erlaabt, datt gläichzäiteg Schreifoperatioune Korruptioun verursaachen; an eng Backend-Konfiguratioun, duerch déi en Ugräifer de State op eng Plaz ëmleede kann, déi e kontrolléiert. Ëmfaasst Terraform an ähnlech Tools, bei deenen d’State-Date...

Firwat Auditing Terraform State And Backend Trust op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Auditing Terraform State And Backend Trust besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Auditing Terraform State And Backend Trust an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-terraform-state-and-backend-trust an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Auditing Terraform State And Backend Trust benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Auditing Terraform State And Backend Trust benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Auditing Terraform State And Backend Trust domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Auditing Terraform State And Backend Trust gratis?

Jo. UnboundCompute huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇