AETERNAE AI RESEARCH LLC INDEPENDENT RESEARCH
ÆAETERNAERESEARCH
Sign inRequest access
← Malware catalog

Attributed metadata history

REPORTPUBLIC METADATA

Stop Hand-Writing Least-Privilege IAM Policies: Policy Sentry + Parliament (and the KMS Trap)

Lately I've been doing IAM security remediation at work, and I keep running into policies like "Action": "s3:*", "Resource": "*". Everyone agrees on "least privilege", but writing it by hand is painful: figuring out which actions you actually need takes forever once it's written, you're never quite sure it's really minimal a typo won't show up until terraform apply (or production) So I tried two tools that let you stop hand-writing policies: Tool What it does Policy Sentry Generates a least-privilege policy from "which ARNs do I read / write" Parliament Lints a policy (typos, unnecessary *, resource mismatches) Both run offline, without an AWS account, so they're easy to try locally. All screenshots in this post are real command output from my Linux box. ARNs and the account ID (111122223333) are dummies. The flow The example is a typical batch job's IAM role: read files from input/ in an S3 bucket write results to output/ (encrypted with SSE-KMS) read config from SSM Parameter Store decrypt with a KMS key Environment Item Version OS Ubuntu 24.04 Python 3.13 policy_sentry 0.13.2 parliament 1.6.4 pip install policy_sentry parliament Step 1: Create a template policy_sentry create-template --output-file crud.yml --template-type crud You list ARNs under the official AWS access levels: read, write, list, tagging, permissions-management. My first attempt (the KMS key is "just for reading", so read, right?): # crud_v1.yml mode: crud name: 'ReportBatch' read: - 'arn:aws:s3:::example-report-bucket/input/*' - 'arn:aws:ssm:ap-northeast-1:111122223333:parameter/report-batch/*' - 'arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab' write: - 'arn:aws:s3:::example-report-bucket/output/*' list: - 'arn:aws:s3:::example-report-bucket' Trap #1: putting the KMS key under read does NOT give you Decrypt The generated KMS statement only had kms:DescribeKey, kms:GetKeyPolicy and friends — no kms:Decrypt. The reason: in AWS's own definitions, kms:Decrypt has the access level "Write". Policy Sentry can show you: Decrypt sits in the same Write bucket as ScheduleKeyDeletion. So if you think "fine, I'll put it under write"... Trap #2: under write you also get key deletion The red lines are the scary part: KmsWriteKey now includes kms:ScheduleKeyDeletion, kms:DisableKey, kms:CreateAlias... and a MultMultNone statement adds kms:CreateKey on Resource: * MultMultNone is where Policy Sentry puts dependent actions (actions AWS says you also need when calling another action). Because kms:CreateKey depends on kms:PutKeyPolicy and kms:TagResource, they get pulled in too. Fix: trim with exclude-actions Policy Sentry supports exclude-actions with wildcards. For KMS I keep only Decrypt (reading) and GenerateDataKey (writing with SSE-KMS). For S3 I drop ACL, replication and delete actions. # crud_v3.yml mode: crud name: 'ReportBatch' read: - 'arn:aws:s3:::example-report-bucket/input/*' - 'arn:aws:ssm:ap-northeast-1:111122223333:parameter/report-batch/*' write: - 'arn:aws:s3:::example-report-bucket/output/*' - 'arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab' list: - 'arn:aws:s3:::example-report-bucket' exclude-actions: # S3: no ACL / torrent / replication - 's3:*Acl' - 's3:*Torrent' - 's3:*ForReplication' - 's3:*Attributes' # S3: no delete / retention / replication either - 's3:Delete*' - 's3:*Replicat*' - 's3:RestoreObject' - 's3:*Retention' - 's3:*LegalHold' # KMS: drop every write action except Decrypt / GenerateDataKey - 'kms:Cancel*' - 'kms:Connect*' - 'kms:Create*' - 'kms:Delete*' - 'kms:Derive*' - 'kms:Disable*' - 'kms:Disconnect*' - 'kms:Enable*' - 'kms:Encrypt' - 'kms:GenerateDataKeyPair*' - 'kms:GenerateDataKeyWithout*' - 'kms:GenerateMac' - 'kms:GenerateRandom' - 'kms:Import*' - 'kms:ReEncrypt*' - 'kms:Replicate*' - 'kms:Rotate*' - 'km

Reference details

Source category
research-report
First reported
Dec 02, 2026 06:20 UTC
Last reported
Dec 02, 2026 06:20 UTC
Catalog updated
Dec 02, 2026 06:23 UTC
Record ID
6b32c3e85742ee647d8e1335aca8287ae22e4556fec121a8b2f16ef0a0e3b27c

Published indicators

Network indicators are visibly defanged. This page does not make them clickable or send them to another service.

No validated file hashes or network indicators are stored for this record.

Source observations

intelligence_src_6dc544294b7f21f98a

Source-provided label
Publisher RSS metadata
Evidence class
mentioned in report
Confidence
Not reported
Observed
Dec 02, 2026 06:20 UTC
Retrieved
Dec 02, 2026 06:23 UTC

This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.

Feed collection status

Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.

1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.

Review source update dates and status
  • intelligence_src_6dc544294b7f21f98aRecent successful batchLast successful batch: Last attempt:

Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.