Logo: Auditing Kms Key Policy And Envelope Encryption

Auditing Kms Key Policy And Envelope Encryption

Organisatioun
UnboundCompute
auditing-kms-key-policy-and-envelope-encryption

Iwwerpréift Schlësselverwaltungsrichtlinnen an den Design vun der Envelope-Verschlësselung op en Entschlësselungswee, dee méi breet ass wéi virgesinn: eng Schlësselrichtlinn oder eng Berechtegung, déi engem Prinzipal Entschlësselung erlaabt, deen dat ni dierft kënnen; eng Wildcard-Ressource fir Schlësselen an enger Identitéitsrichtlinn, déi och net dozougehéierend Schlësselen ëmfaasst; en Encryption Context, deen net duerchgesat gëtt, soudatt en Dateschlëssel och ausserhalb vu sengem virgesinnenen Ëmfang entschlësselt; an eng schlësselbezunnen Berechtegung tëscht Konten, déi d’Zuel vun deenen, déi entschlëssele kënnen, erweidert. Dat gëllt fir Cloud-Schlësselverwaltungsservicer, Schlësselrichtlinnen a Berechtegungen, souwéi fir Envelope-Verschlësselung, bei där en Dateschlëssel d’Notzdate schützt an d’Schlësselrichtlinn den Dateschlëssel. Benotzt dëst, wann Date mat engem verwaltete Schlëssel geschützt sinn an d'Schlësselrichtlinn zesumme mam Encryption Context bestëmmt, wien entschlëssele kann. De Prinzipal, deem d’Schlësselrichtlinn Zougang gëtt, ass d’Quell; d’Entschlësselungsoperatioun ass d’Zil; an de Feeler ass en Entschlësseler, deen net zu de virgesinnenen Empfänger vun den Date gehéiert.

Iwwersiicht

EditeurUnboundCompute
Repositorysecurity-agent-skills
Skill-Nummauditing-kms-key-policy-and-envelope-encryption
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 Kms Key Policy And Envelope Encryption 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-kms-key-policy-and-envelope-encryption
  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-kms-key-policy-and-envelope-encryption .claude/skills/auditing-kms-key-policy-and-envelope-encryption
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Auditing Kms Key Policy And Envelope Encryption 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 Kms Key Policy And Envelope Encryption 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 Kms Key Policy And Envelope Encryption 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 KMS key policy and envelope encryption: who can actually decrypt

Envelope encryption protects data with a data key and protects the data key with a managed master key, so the real access boundary is the master key's policy plus whatever encryption context constrains the data key. That indirection hides over-broad access. A key policy or grant can admit a principal who should never decrypt this data; a wildcard key resource in an identity policy can cover keys the author never considered; and an encryption context, meant to bind a data key to a specific scope, does nothing if the decrypt path does not enforce it. Cross-account grants widen the set further. The payload can be perfectly encrypted while the decrypt set quietly includes the wrong principals. You audit these by computing who can decrypt and comparing that to who should read the data.

When to use

  • Data is protected by a managed key through envelope encryption, with a data key under a master key.
  • Decrypt access is governed by a key policy, key grants, and identity policies that may use wildcards.
  • An encryption context is used to scope a data key, and you need to confirm it is enforced on decrypt.

Scope check

Audit key access only in accounts and key stores you own or are authorized to assess. Confirming a decrypt recovers real plaintext, so stay inside the authorized keys and treat recovered data as sensitive within scope, never exfiltrating it. If you can't name the authorization, stop.

The loop

  1. Establish the data's intended readers first. For the data a key protects, name the principals that legitimately need to decrypt it. This is the false-positive killer: a key policy admitting exactly those readers is correct however sensitive the key is. Name the intended readers, then compute the decrypt set against them.

  2. Read the key policy and grants for who they admit. The master key's policy and any grants name the principals allowed to decrypt. Determine the true admitted set, noting broad principals (an account-wide grant, a wildcard) and any condition intended to scope it. Grants are easy to miss because they live apart from the policy document.

  3. Add identity policies with key wildcards. A principal whose identity policy grants decrypt on a wildcard key resource can decrypt with keys the key policy never named, if the key policy also delegates to identity policies. Expand wildcard key resources against the real key inventory and add every principal they admit to the decrypt set.

  4. Check that the encryption context is enforced. An encryption context binds a data key to a scope (a tenant, a purpose) only if every decrypt call supplies and the policy requires the matching context. If the context is set on encrypt but not required on decrypt, any holder of decrypt permission recovers the data regardless of scope. Confirm the context is a required condition, not a convention.

  5. Resolve cross-account and service grants. A grant to another account or to a service principal widens the decrypt set beyond the key's home account. Confirm each cross-account decrypt grant corresponds to an intended reader and is scoped, not a broad delegation that admits an entire external account.

  6. Confirm and record. Confirm by decrypting the data as a principal that should not be a reader but is admitted by the combined policy, or by decrypting a data key without supplying the intended encryption context, within scope and without exfiltrating plaintext. Kill the lead if the union of key policy, grants, and identity policies admits only intended readers, the encryption context is required on decrypt, and no cross-account grant widens the set beyond intent. Record the admitting term, the decrypt sink, and the decryptor beyond intended readers.

Where KMS and envelope encryption leak

  • The decrypt set is a union, and grants hide. Key policy, grants, and identity policies each add principals; a grant living apart from the policy is the common miss.
  • A wildcard key resource covers unrelated keys. An identity policy granting decrypt on all keys reaches keys the author never considered.
  • An unenforced encryption context scopes nothing. If decrypt does not require the matching context, the data key decrypts outside its intended scope.
  • Cross-account grants widen the set beyond the home account. A broad delegation admits an entire external account to the decrypt path.
  • Encrypted is not the same as access-controlled. Strong encryption with a loose key policy protects the bytes on disk but not against an admitted decryptor.

Worked example (a confirm and a kill)

Confirm. A per-tenant data key is encrypted with a tenant-scoped encryption context, but the decrypt path does not require the context, and an analytics role holds decrypt on the master key. The analytics role decrypts any tenant's data key without supplying that tenant's context, recovering cross-tenant plaintext. Confirmed cross-tenant decrypt through unenforced encryption context, high, remediation = require the tenant encryption context as a condition on every decrypt, scope the analytics role's decrypt to the keys it needs, and confirm the effective decrypt set matches intended readers per tenant.

Kill. The master key policy, grants, and identity policies together admit only the per-tenant service roles, decrypt requires the matching tenant encryption context as a policy condition, and no cross-account grant widens the set. A principal outside a tenant's readers, or a decrypt without the tenant context, is denied. Killed, kill_reason = "combined key policy, grants, and identity policies admit only intended readers, the encryption context is required on decrypt, and no cross-account grant widens access; no unintended principal recovers plaintext."

Rationalizations to reject

  • "The data is encrypted." → Encryption protects the bytes; the key policy decides who decrypts. Compute the decrypt set separately.
  • "The key policy is tight." → Add grants and wildcard identity policies; a grant apart from the policy or a broad identity policy widens the set.
  • "We set an encryption context." → Confirm decrypt requires it; a context set on encrypt but not enforced on decrypt scopes nothing.
  • "It is only shared with a partner account." → A cross-account grant to a whole account admits every principal in it; scope it to the intended reader.
  • "Analytics needs to read across the board." → Broad decrypt on a master key makes analytics a reader of everything it protects; scope to the specific keys and require the context.

Executing this in practice

You need the data's intended readers, the master key policy and grants, identity policies with key wildcards, the encryption context and whether decrypt enforces it, and any cross-account grants. Compute the effective decrypt set as the union and compare it to the readers. Reading the policies and the context requirement shows the intended boundary; decrypting as an unintended-but-admitted principal shows whether it holds.

Related

  • reviewing-secrets-manager-access-policy-trust - the secret side of the same union; a broad decrypt grant here is a back door there, so audit the two together.
  • hunting-non-human-identity-and-secret-reachability - the reachability companion; once the decrypt set is known, that skill traces which identity actually performs the decrypt.
  • finding-crypto-misuse - envelope-encryption design errors beyond access, such as reusing a data key across scopes, are that skill's territory.
  • adjudicating-taint-paths - use it to confirm an admitted principal's credentials reach the decrypt call with or without the required context.
  • FINDING-SCHEMA.md - source = the principal the key policy admits, sink = the decrypt operation, evidence = the decryptor beyond the data's intended readers.

Heefeg gestallte Froen

Wat mécht de KI-Skill Auditing Kms Key Policy And Envelope Encryption?

Iwwerpréift Schlësselverwaltungsrichtlinnen an den Design vun der Envelope-Verschlësselung op en Entschlësselungswee, dee méi breet ass wéi virgesinn: eng Schlësselrichtlinn oder eng Berechtegung, déi engem Prinzipal Entschlësselung erlaabt, deen dat ni dierft kënnen; eng Wildcard-Ressource fir Schlësselen an enger Identitéitsrichtlinn, déi och net dozougehéierend Schlësselen ëmfaasst; en Encryption Context, deen net duerchgesat gëtt, soudatt en Dateschlëssel och ausserhalb vu sengem virgesinnenen Ëmfang entschlësselt; an eng schlësselbezunnen Berechtegung tëscht Konten, déi d’Zuel vun deen...

Firwat Auditing Kms Key Policy And Envelope Encryption op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Auditing Kms Key Policy And Envelope Encryption 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 Kms Key Policy And Envelope Encryption 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-kms-key-policy-and-envelope-encryption 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 Kms Key Policy And Envelope Encryption 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 Kms Key Policy And Envelope Encryption benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Auditing Kms Key Policy And Envelope Encryption 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 Kms Key Policy And Envelope Encryption 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 👇