{
 "format": "atarus-captures/1",
 "book": "AWS Identity and Secrets",
 "edition": "First edition",
 "page": "atarussecurity.com/books/aws-identity-and-secrets/captures",
 "note": "Every captured block printed in the book, in book order. sha256 is the hash on the block's header line: the SHA-256 of the block as printed below that line, final newline included. Account ids, key ids and addresses in the commands are the placeholders the book prints.",
 "count": 169,
 "runs": 25,
 "captures": [
  {
   "chapter": 1,
   "run": "r-20261111-033755-93b6",
   "step": "01-caller-identity",
   "utc": "2026-11-11T03:38:11Z",
   "command": "aws sts get-caller-identity --query '[Account,Arn]' --output text",
   "sha256": "5e7d1e9dad59ad8eee274aff9e26271df3a97f5f583854fd7e53d67484b9cd1c"
  },
  {
   "chapter": 1,
   "run": "r-20261111-033755-93b6",
   "step": "02-account-alias",
   "utc": "2026-11-11T03:38:12Z",
   "command": "aws iam list-account-aliases --query 'AccountAliases' --output text",
   "sha256": "c077b191ab390e1be5d25eb9211b28191d82be1c0cfb37b6b2011df32deedbf9"
  },
  {
   "chapter": 1,
   "run": "r-20261111-033755-93b6",
   "step": "03-organization-membership",
   "utc": "2026-11-11T03:38:13Z",
   "command": "aws organizations describe-organization --query 'Organization.[Id,MasterAccountId,FeatureSet]' --output text",
   "sha256": "0c5df215d1fe3248ebe3e14c409b19ac9d399c99203871f6a097b3ba455ee436"
  },
  {
   "chapter": 1,
   "run": "r-20261108-185059-ea1e",
   "step": "02-outside-region-is-refused",
   "utc": "2026-11-08T18:51:15Z",
   "command": "AWS_REGION=eu-west-1 aws lambda list-functions --query 'Functions[].FunctionName' --output text",
   "sha256": "acfa74499dbc2aefb0859dbab85df89f396ec618fa187e7738bd11db37ba91b7"
  },
  {
   "chapter": 1,
   "run": "r-20261111-033755-93b6",
   "step": "04-change-tested-by-dry-run",
   "utc": "2026-11-11T03:38:14Z",
   "command": "aws ec2 create-tags --dry-run --resources i-0abc1234def567890 --tags Key=atarus-scope,Value=check",
   "sha256": "82cf53a89c7c9404878046ed761e5186b07221f7dde2a05f50463c62110194e0"
  },
  {
   "chapter": 1,
   "run": "r-20261111-033755-93b6",
   "step": "05-cleanup-verify-no-tag",
   "utc": "2026-11-11T03:38:15Z",
   "command": "aws ec2 describe-tags --filters Name=resource-id,Values=i-0abc1234def567890 Name=key,Values=atarus-scope \\\n  --query 'Tags[].[Key,Value]' --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 1,
   "run": "r-20261111-035238-03cf",
   "step": "01-dry-run-event",
   "utc": "2026-11-11T03:52:54Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-11T03:38:00Z --end-time 2026-11-11T03:39:00Z \\\n  --lookup-attributes AttributeKey=EventName,AttributeValue=CreateTags \\\n  --query \"Events[?contains(Username || '', 'ci-deploy')].CloudTrailEvent\" --output text \\\n  | jq -r '[.eventTime, .eventName, (.readOnly|tostring), .errorCode] | @tsv'",
   "sha256": "0c3e2c519b835e103aa26368f82167ab0eb26f6d949b0b88c93bdf82b2974ad5"
  },
  {
   "chapter": 1,
   "run": "r-20261111-033850-2942",
   "step": "01-review-profile-identity",
   "utc": "2026-11-11T03:38:51Z",
   "command": "aws sts get-caller-identity --query '[Account,Arn]' --output text",
   "sha256": "3583cae0d998968f62dbc686840d23052430cc672a2d9dffdeda7b10177c4b3d"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "01-review-profile-identity",
   "utc": "2026-11-11T04:20:41Z",
   "command": "AWS_PROFILE=capture-a-review aws sts get-caller-identity --query '[Account,Arn]' --output text",
   "sha256": "3583cae0d998968f62dbc686840d23052430cc672a2d9dffdeda7b10177c4b3d"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "02-lab-values",
   "utc": "2026-11-11T04:20:41Z",
   "command": "aws sts get-caller-identity --query Account --output text\naws ec2 describe-instances --filters Name=tag:Name,Values=prod-api --query 'Reservations[].Instances[].InstanceId' --output text\naws kms describe-key --key-id alias/capture-a-data --query KeyMetadata.KeyId --output text\naws cloudtrail describe-trails --query 'trailList[?IsOrganizationTrail].TrailARN' --output text",
   "sha256": "625426bed6b195075dcbe24f00ddd2059f59a396d133355e32d675cf56dd060d"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "03-window-note",
   "utc": "2026-11-11T04:20:44Z",
   "command": "printf '%s %s\\n' \"2026-11-11T04:20:32Z\" \"2026-11-11T06:20:25Z\" > window.txt\ncat window.txt",
   "sha256": "33bdc2178b1e8afb5fe0654d28b17a9ddf9fcb99c1f590b684591774fa998992"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "04-create-package",
   "utc": "2026-11-11T04:20:44Z",
   "command": "mkdir -p ENG-LAB-capture/evidence/aws ENG-LAB-capture/findings/F-01-s3-partner-read\nprintf 'scope: lab Organization account capture-a, window %s to %s\\n' \"2026-11-11T04:20:32Z\" \"2026-11-11T06:20:25Z\" > ENG-LAB-capture/README.txt\nprintf 'utc\\tsource\\tidentity\\tkey_or_app\\tcall\\tresult\\tevidence\\n' > ENG-LAB-capture/operator-log.tsv\nfind ENG-LAB-capture | sort",
   "sha256": "34050001bf8c8fbb35dc12f5bcc04314bf513a4f13c36a425f2e0b139a77eb78"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "05-start-session",
   "utc": "2026-11-11T04:20:44Z",
   "command": "cd ENG-LAB-capture\nSRC=$(curl -s https://checkip.amazonaws.com)\nt=$(date -u +%Y-%m-%dT%H:%M:%SZ); ID=$(aws sts get-caller-identity --query Arn --output text); rc=$?\nprintf 'SRC=%s\\nID=%s\\n' \"$SRC\" \"$ID\" > session.env\nprintf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' \"$t\" \"$SRC\" \"$ID\" \"AKIAIOSFODNN7EXAMPLE\" \"aws sts get-caller-identity --query Arn --output text\" \"$rc\" session.env >> operator-log.tsv\ncat session.env\ncd ..",
   "sha256": "7bd313a68bd65fb3380020e75883a9551a522a2c5fa3a7a79ed2aec628f48f8d"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "06-ev-bucket-policy",
   "utc": "2026-11-11T04:20:45Z",
   "command": "cd ENG-LAB-capture\n. ./session.env; KEY=AKIAIOSFODNN7EXAMPLE\nev() {  # ev <cloud> <label> <command...>; SRC, ID and KEY come from the session\n  local t n f rc; t=$(date -u +%Y-%m-%dT%H:%M:%SZ); n=$(date -u +%Y-%m-%dT%H%MZ)\n  f=\"evidence/$1/$n-$2.txt\"; shift 2\n  printf '# %s %s %s\\n# %s\\n' \"$t\" \"$SRC\" \"$ID\" \"$*\" > \"$f\"\n  \"$@\" >> \"$f\" 2>&1; rc=$?\n  printf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' \"$t\" \"$SRC\" \"$ID\" \"$KEY\" \"$*\" \"$rc\" \"$f\" >> operator-log.tsv\n  cat \"$f\"\n}\nev aws s3-get-bucket-policy-exports aws s3api get-bucket-policy --bucket example-exports --query Policy --output text\ncd ..",
   "sha256": "9c116601478df2a257a0fa4b12ebd0bb8806e05fc37e8e52f4f4a989c71b1df3"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "07-ev-caller-identity-and-tags",
   "utc": "2026-11-11T04:20:46Z",
   "command": "cd ENG-LAB-capture\n. ./session.env; KEY=AKIAIOSFODNN7EXAMPLE\nev() {  # ev <cloud> <label> <command...>; SRC, ID and KEY come from the session\n  local t n f rc; t=$(date -u +%Y-%m-%dT%H:%M:%SZ); n=$(date -u +%Y-%m-%dT%H%MZ)\n  f=\"evidence/$1/$n-$2.txt\"; shift 2\n  printf '# %s %s %s\\n# %s\\n' \"$t\" \"$SRC\" \"$ID\" \"$*\" > \"$f\"\n  \"$@\" >> \"$f\" 2>&1; rc=$?\n  printf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' \"$t\" \"$SRC\" \"$ID\" \"$KEY\" \"$*\" \"$rc\" \"$f\" >> operator-log.tsv\n  cat \"$f\"\n}\nev aws sts-get-caller-identity aws sts get-caller-identity\nev aws s3-get-bucket-tagging-exports aws s3api get-bucket-tagging --bucket example-exports\ncd ..",
   "sha256": "89008bd1c249ac26180b715f056b3cf1051dea761129be6e0310d8c7f6891bc0"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "08-print-log",
   "utc": "2026-11-11T04:20:47Z",
   "command": "cat ENG-LAB-capture/operator-log.tsv",
   "sha256": "90487956840eb984401ec20056cc8ab961893b2ba71ae79da87590d9f02bc022"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "09-hash-package",
   "utc": "2026-11-11T04:20:47Z",
   "command": "cd ENG-LAB-capture\nfind README.txt session.env operator-log.tsv evidence findings -type f -print0 | sort -z | xargs -0 sha256sum > MANIFEST.sha256\nsha256sum -c --quiet MANIFEST.sha256 && echo \"manifest ok: $(wc -l < MANIFEST.sha256) files\"\nsha256sum MANIFEST.sha256\ncd ..",
   "sha256": "32cc33d5982e42ab38712db9c7f8ce987cec824e762e8a20b1ecffac00b9d953"
  },
  {
   "chapter": 2,
   "run": "r-20261111-042025-7a1c",
   "step": "10-cleanup-remove-package",
   "utc": "2026-11-11T04:20:47Z",
   "command": "rm -rf ENG-LAB-capture && echo removed\nls -A",
   "sha256": "bbcf325d1815643542e1da44b94e05832e8e2adaf8fffc4f159e8715771e13a2"
  },
  {
   "chapter": 2,
   "run": "r-20261108-191654-10a8",
   "step": "01-wrong-profile-empty-table",
   "utc": "2026-11-08T19:16:55Z",
   "command": "bash -o pipefail <<'SH'\nfor r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do\n  aws lambda list-functions --region \"$r\" --output json 2>/dev/null \\\n    | jq -r --arg r \"$r\" '.Functions[] | [$r, .FunctionName,\n        ((.Environment.Variables // {}) | keys | length),\n        ((.Environment.Variables // {}) | keys | map(select(test(\"pass|secret|token|key|cred|pwd\"; \"i\"))) | length)] | @tsv'\ndone | sort -t$'\\t' -k4,4nr\nSH",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 2,
   "run": "r-20261108-191654-10a8",
   "step": "02-wrong-profile-not-found",
   "utc": "2026-11-08T19:17:14Z",
   "command": "aws lambda get-function-configuration --region us-east-1 --function-name orders-sync \\\n  --query '[KMSKeyArn, keys(Environment.Variables || `{}`)]'",
   "sha256": "9a97992bb6c5ed89f3e5241de41edaf7d0ecf013071434673f9947558aa9ac45"
  },
  {
   "chapter": 2,
   "run": "r-20261108-184610-673f",
   "step": "02-cleanup-verify-no-writes",
   "utc": "2026-11-08T18:46:16Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:35:00Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "b2c33fe686a683bc2b4c5d3e3ee894f031c4fd3199e82a0ed3dcd2831df78160"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "01-write-policy-fixtures",
   "utc": "2026-11-08T19:14:51Z",
   "command": "cat > allow-s3-read.json <<'EOF'\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:ListBucket\"],\"Resource\":\"*\"}]}\nEOF\ncat > deny-exports.json <<EOF\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":\"s3:*\",\"Resource\":\"arn:aws:s3:::example-exports/*\"}]}\nEOF\ncat > allow-all-s3.json <<'EOF'\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"s3:*\",\"Resource\":\"*\"}]}\nEOF\ncat > boundary-read-only.json <<'EOF'\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"s3:Get*\",\"s3:List*\"],\"Resource\":\"*\"}]}\nEOF\ncat > caller-sts-only.json <<'EOF'\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"sts:GetCallerIdentity\",\"Resource\":\"*\"}]}\nEOF\ncat > bucket-policy.json <<EOF\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::111122223333:user/ci-deploy\"},\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::example-exports/*\"}]}\nEOF\ncat > session-s3-list.json <<'EOF'\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"s3:ListBucket\",\"Resource\":\"*\"}]}\nEOF\nls *.json",
   "sha256": "4a52ee9f2811637b0650fba7d36f313a675344525594481690a42b36a3e445d0"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "02-identity-allow",
   "utc": "2026-11-08T19:14:51Z",
   "command": "aws iam simulate-custom-policy --policy-input-list \"$(cat allow-s3-read.json)\" \\\n  --action-names s3:GetObject s3:PutObject --resource-arns arn:aws:s3:::example-exports/report.csv \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "9cef3e8b336c395a744069425c80360881eed43cd965dc61ffb83d1ae3b21e34"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "03-explicit-deny-wins",
   "utc": "2026-11-08T19:14:51Z",
   "command": "aws iam simulate-custom-policy --policy-input-list \"$(cat allow-s3-read.json)\" \"$(cat deny-exports.json)\" \\\n  --action-names s3:GetObject --resource-arns arn:aws:s3:::example-exports/report.csv \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision,MatchedStatements[].SourcePolicyId]' --output text",
   "sha256": "118da7ab8d028981d5a65ea5ef96ddf9b878746f42f982d3a4d3a61fa04733ba"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "04-boundary-caps-identity-policy",
   "utc": "2026-11-08T19:14:52Z",
   "command": "aws iam simulate-custom-policy --policy-input-list \"$(cat allow-all-s3.json)\" \\\n  --permissions-boundary-policy-input-list \"$(cat boundary-read-only.json)\" \\\n  --action-names s3:GetObject s3:PutObject s3:DeleteBucket --resource-arns arn:aws:s3:::example-exports/report.csv \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision,PermissionsBoundaryDecisionDetail.AllowedByPermissionsBoundary]' --output text",
   "sha256": "347cc71430b6e37598fe9d975a0e2419b64684ec35a4a2d31ad03cd390c63021"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "05-resource-policy-alone",
   "utc": "2026-11-08T19:14:53Z",
   "command": "aws iam simulate-custom-policy --policy-input-list \"$(cat caller-sts-only.json)\" \\\n  --resource-policy file://bucket-policy.json --resource-owner arn:aws:iam::111122223333:root \\\n  --caller-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names s3:GetObject --resource-arns arn:aws:s3:::example-exports/report.csv \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "679daf071034efd89055d3dba70b74fb9151f97b5306faa90a9a923d0584cb15"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "06-seeded-boundary-user",
   "utc": "2026-11-08T19:14:53Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/boundary-demo \\\n  --action-names s3:GetObject s3:PutObject iam:CreateUser \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision,PermissionsBoundaryDecisionDetail.AllowedByPermissionsBoundary]' --output text",
   "sha256": "dfe63500ebbccd2c8709c092ada7779113bbb2d9b2b59789477a9e4837498038"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "07-scp-in-the-simulation",
   "utc": "2026-11-08T19:14:54Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/boundary-demo \\\n  --action-names ses:SendEmail ec2:RunInstances \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision,OrganizationsDecisionDetail.AllowedByOrganizations]' --output text",
   "sha256": "4ee8a417287fca9e73f66e4f4a3c275711a802044ce948972c27ba80cc4c35a5"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "08-session-policy-narrows-a-role",
   "utc": "2026-11-08T19:14:55Z",
   "command": "aws sts assume-role --role-arn arn:aws:iam::111122223333:role/ops-break-glass --role-session-name atarus-session-policy \\\n  --policy file://session-s3-list.json --duration-seconds 900 --query '{session:AssumedRoleUser.Arn,packedPolicyPercent:PackedPolicySize}'",
   "sha256": "ecde8dc5f5d111765267989c12e2f83b2d2a5dceb09e5703ee503c90cc385389"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "08b-session-narrowing-proof",
   "utc": "2026-11-08T19:14:56Z",
   "command": "set -- $(aws sts assume-role --role-arn arn:aws:iam::111122223333:role/ops-break-glass --role-session-name atarus-narrowing-proof \\\n  --policy file://session-s3-list.json --duration-seconds 900 \\\n  --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text)\nif [ \"$#\" -eq 3 ]; then\n  AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 AWS_SESSION_TOKEN=$3 \\\n    aws s3api list-objects-v2 --bucket example-exports --query 'length(Contents[])' --output text\n  AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 AWS_SESSION_TOKEN=$3 \\\n    aws s3api head-object --bucket example-exports --key export-2026-01.csv --query 'ContentLength'\nelse\n  echo \"no session: the assume-role above was refused\" >&2\nfi",
   "sha256": "e5208e6ec40b57de98b0f5739c2cf01ad02146624d80c5ca320bfd440d3f863e"
  },
  {
   "chapter": 3,
   "run": "r-20261108-191450-c283",
   "step": "09-cleanup-remove-fixtures",
   "utc": "2026-11-08T19:14:58Z",
   "command": "rm -f allow-s3-read.json deny-exports.json allow-all-s3.json boundary-read-only.json caller-sts-only.json bucket-policy.json session-s3-list.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "01-caller-identity",
   "utc": "2026-11-08T04:05:50Z",
   "command": "aws sts get-caller-identity",
   "sha256": "ee852cf335818f9fa6e50e1c734affa9f8f54ee0fa1f78466991b5f5311c859e"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "02-list-attached-user-policies",
   "utc": "2026-11-08T04:05:51Z",
   "command": "aws iam list-attached-user-policies --user-name ci-deploy",
   "sha256": "46400cfe3d6614055691bf734fe4a9c9b101a66b73788ab0ecb3ebafdc03e38e"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "03-list-groups-for-user",
   "utc": "2026-11-08T04:05:52Z",
   "command": "aws iam list-groups-for-user --user-name ci-deploy",
   "sha256": "d5f6c5c3a37fe65f136655f9e5ee31ebe2b42a3b91739e3432b363f7d77068a0"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "04-authorization-details-dump",
   "utc": "2026-11-08T04:05:52Z",
   "command": "aws iam get-account-authorization-details > auth-details.json",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "05-authorization-details-size",
   "utc": "2026-11-08T04:05:57Z",
   "command": "jq '{users:(.UserDetailList|length),groups:(.GroupDetailList|length),roles:(.RoleDetailList|length),policies:(.Policies|length)}' auth-details.json",
   "sha256": "e4f6c835d4d9160d36c05e2781f1ca6dcd207b80eda4c229028674e57af224c4"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "06-simulate-escalation-actions",
   "utc": "2026-11-08T04:05:57Z",
   "command": "aws iam simulate-principal-policy \\\n  --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names iam:PassRole iam:CreatePolicyVersion lambda:CreateFunction \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "f1c9510c5ecbe407adeebc86f4b4462c1ec5e670e487f6c205eb244e25c79eb4"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "07-list-functions",
   "utc": "2026-11-08T04:05:58Z",
   "command": "aws lambda list-functions --query 'Functions[].FunctionName' --output text",
   "sha256": "93cb39a748d4e83eda9265a298ddd72a01230a2888a32f513053bd5435caa144"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "08-function-variable-names",
   "utc": "2026-11-08T04:05:59Z",
   "command": "aws lambda get-function-configuration --function-name orders-sync \\\n  --query 'keys(Environment.Variables || `{}`)'",
   "sha256": "0c7bb931f292080a564f5c1ac5b48d532aa663eb7aeb839c9d47a1a10f0dc795"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "09-user-data-secret-lines",
   "utc": "2026-11-08T04:06:00Z",
   "command": "aws ec2 describe-instance-attribute --instance-id i-0abc1234def567890 --attribute userData \\\n  --query 'UserData.Value' --output text | base64 -d \\\n  | grep -Ein 'password|secret|token|api[_-]?key' | cut -d: -f1",
   "sha256": "c699fe829129f2dd6b4067395eb6c1fbd113df50d073703eef9a541826fb7993"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "10-ssm-parameter-types",
   "utc": "2026-11-08T04:06:01Z",
   "command": "aws ssm describe-parameters --query 'Parameters[].[Name,Type]' --output table",
   "sha256": "928753a340d930e64e21b6cb0ed96e594acf4d85b809320a563eed44fa085c60"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "11-account-public-access-block",
   "utc": "2026-11-08T04:06:02Z",
   "command": "aws s3control get-public-access-block --account-id 111122223333",
   "sha256": "31f1f0a092cfdc6587c931923da09fc537545478aca3c5dcc2c060b73a91e4d9"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "12-snapshot-public-access-state",
   "utc": "2026-11-08T04:06:03Z",
   "command": "aws ec2 get-snapshot-block-public-access-state --region us-east-1",
   "sha256": "00981a44b0cca46894b2ec11827997b0312b59ff31ceacbf953a39a93d013451"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "13-function-url-configs",
   "utc": "2026-11-08T04:06:03Z",
   "command": "aws lambda list-function-url-configs --function-name orders-sync \\\n  --query 'FunctionUrlConfigs[].[FunctionUrl,AuthType]'",
   "sha256": "57b782f06dc0c1a3b743a015157562f5cd2d903b23fc0237f34352d5f5663285"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "14-describe-trails",
   "utc": "2026-11-08T04:06:04Z",
   "command": "aws cloudtrail describe-trails --query 'trailList[].[Name,IsMultiRegionTrail,IsOrganizationTrail]'",
   "sha256": "d8a2ddb311d41bf5b6b8d629daeca47361aa097f39d3e7fdb9e4e213e88f1ebc"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "15-trail-is-logging",
   "utc": "2026-11-08T04:06:05Z",
   "command": "aws cloudtrail get-trail-status --name arn:aws:cloudtrail:us-east-1:123456789012:trail/org-trail --query IsLogging",
   "sha256": "a17fcf0a2f50e2d495e4f90ce263410edc183add6c62699a2facbccf60410f74"
  },
  {
   "chapter": 4,
   "run": "r-20261108-040549-4d73",
   "step": "16-cleanup-remove-dump",
   "utc": "2026-11-08T04:06:06Z",
   "command": "rm -f auth-details.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 4,
   "run": "r-20261108-185059-ea1e",
   "step": "01-second-region-is-empty",
   "utc": "2026-11-08T18:51:14Z",
   "command": "AWS_REGION=us-west-2 aws lambda list-functions --query 'Functions[].FunctionName' --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 4,
   "run": "r-20261108-185059-ea1e",
   "step": "02-outside-region-is-refused",
   "utc": "2026-11-08T18:51:15Z",
   "command": "AWS_REGION=eu-west-1 aws lambda list-functions --query 'Functions[].FunctionName' --output text",
   "sha256": "acfa74499dbc2aefb0859dbab85df89f396ec618fa187e7738bd11db37ba91b7"
  },
  {
   "chapter": 4,
   "run": "r-20261108-185116-0764",
   "step": "01-user-data-value-on-webhooks-2",
   "utc": "2026-11-08T18:51:17Z",
   "command": "iid=$(aws ec2 describe-instances --filters Name=tag:Name,Values=webhooks-2 --query 'Reservations[0].Instances[0].InstanceId' --output text)\naws ec2 describe-instance-attribute --instance-id \"$iid\" --attribute userData --query 'UserData.Value' --output text",
   "sha256": "af5d8a21858f42808c9bcc17012b77bcc2fd6ab3b071dbd4a05f13f410470541"
  },
  {
   "chapter": 4,
   "run": "r-20261108-185116-0764",
   "step": "02-secret-lines-on-webhooks-2",
   "utc": "2026-11-08T18:51:19Z",
   "command": "iid=$(aws ec2 describe-instances --filters Name=tag:Name,Values=webhooks-2 --query 'Reservations[0].Instances[0].InstanceId' --output text)\naws ec2 describe-instance-attribute --instance-id \"$iid\" --attribute userData \\\n  --query 'UserData.Value' --output text | base64 -d \\\n  | grep -Ein 'password|secret|token|api[_-]?key' | cut -d: -f1",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "01-list-attached-user-policies",
   "utc": "2026-11-11T02:25:12Z",
   "command": "aws iam list-attached-user-policies --user-name ci-deploy --query 'AttachedPolicies[].PolicyArn' --output text",
   "sha256": "4f2494f75f97080b1361a749b871ec381711c151bc5e456fe13fa9a977b2fa0d"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "01b-groups-and-their-policies",
   "utc": "2026-11-11T02:25:13Z",
   "command": "for g in $(aws iam list-groups-for-user --user-name ci-deploy --query 'Groups[].GroupName' --output text); do\n  printf '%s\\tattached: %s\\tinline: %s\\n' \"$g\" \\\n    \"$(aws iam list-attached-group-policies --group-name \"$g\" --query 'AttachedPolicies[].PolicyName' --output text)\" \\\n    \"$(aws iam list-group-policies --group-name \"$g\" --query 'PolicyNames' --output text)\"\ndone",
   "sha256": "e9279f8b683fad482c454ee908c37bca2ac35b4d20b2280c94f8642af07cfc86"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "01c-inline-user-policies",
   "utc": "2026-11-11T02:25:15Z",
   "command": "aws iam list-user-policies --user-name ci-deploy --query 'PolicyNames' --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "02-list-policy-versions",
   "utc": "2026-11-11T02:25:16Z",
   "command": "aws iam list-policy-versions --policy-arn arn:aws:iam::111122223333:policy/ci-deploy-policy \\\n  --query 'Versions[].[VersionId,IsDefaultVersion,CreateDate]' --output text",
   "sha256": "fafc9f45d2230fcfa09f1806fa4f06f953fd0199dc04f958c7dfedcd54a3b40c"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "03-get-policy-version-v1",
   "utc": "2026-11-11T02:25:17Z",
   "command": "aws iam get-policy-version --policy-arn arn:aws:iam::111122223333:policy/ci-deploy-policy --version-id v1 \\\n  --query 'PolicyVersion.Document.Statement[].[Effect,Action]'",
   "sha256": "131c98a3627dd87b0facdc3383f10684dfcb66f26a2ca49d902bca4eec253363"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "03b-default-version",
   "utc": "2026-11-11T02:25:17Z",
   "command": "aws iam get-policy --policy-arn arn:aws:iam::111122223333:policy/ci-deploy-policy --query 'Policy.DefaultVersionId' --output text",
   "sha256": "1875add404b2a01dbb52d1e58dee41d1f480be457a34bd7e1bd2a69d53f35db3"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "03c-default-version-document",
   "utc": "2026-11-11T02:25:18Z",
   "command": "aws iam get-policy-version --policy-arn arn:aws:iam::111122223333:policy/ci-deploy-policy --version-id v3 --query 'PolicyVersion.Document' --output json",
   "sha256": "33ba43f13797dfca4559bc9d2d36da81bd8abcd63ea2b7f669323fb5254e5045"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "04-simulate-policy-version-actions",
   "utc": "2026-11-11T02:25:19Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names iam:CreatePolicyVersion iam:SetDefaultPolicyVersion iam:AttachUserPolicy iam:PutUserPolicy iam:CreateAccessKey \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "a0c269c7111903c7c7845700c1e76de6013748bf28b70eab27b536e9ddb342ff"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "04b-simulate-policy-version-named",
   "utc": "2026-11-11T02:25:20Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names iam:CreatePolicyVersion iam:SetDefaultPolicyVersion \\\n  --resource-arns arn:aws:iam::111122223333:policy/atarus-test-policy \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "2d3564c50d72847ceeebd480efbbe3391609ca8404a0b2680f9a99b34ca9f3cc"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "05-proof-create-policy-version",
   "utc": "2026-11-11T02:25:21Z",
   "command": "aws iam create-policy-version --policy-arn arn:aws:iam::111122223333:policy/atarus-test-policy \\\n  --policy-document file://unchanged.json --no-set-as-default",
   "sha256": "81ae2d5a78e71ccf551af1939177d8ae4b8da27a39f78aba84305c8260b1e32d"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "06-proof-delete-policy-version",
   "utc": "2026-11-11T02:25:22Z",
   "command": "aws iam delete-policy-version --policy-arn arn:aws:iam::111122223333:policy/atarus-test-policy --version-id v2",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "07-list-roles",
   "utc": "2026-11-11T02:25:22Z",
   "command": "aws iam list-roles --query 'Roles[].[RoleName,Arn]' --output text",
   "sha256": "601fae6ad483d2a96ded3a0d806dd4f27c63f93f17d2d23efe15c3c677188cac"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "08-get-role-trust",
   "utc": "2026-11-11T02:25:23Z",
   "command": "aws iam get-role --role-name app-deploy-role --query 'Role.AssumeRolePolicyDocument.Statement[].Principal'",
   "sha256": "41c425099ff828e0d0728200fa38bf6e250c0e3d0d38b3870bf3489b84310ed0"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "09-list-attached-role-policies",
   "utc": "2026-11-11T02:25:24Z",
   "command": "aws iam list-attached-role-policies --role-name app-deploy-role --query 'AttachedPolicies[].PolicyName' --output text",
   "sha256": "577e58839cb14b2ad10055f7b2489a6f55c7e0cca6c8ba828b374fb48d0d9fcd"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "10-simulate-passrole",
   "utc": "2026-11-11T02:25:25Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names iam:PassRole --resource-arns arn:aws:iam::111122223333:role/app-deploy-role \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "b4503c731ff11a02b202b0f0e2f970e112bdcad3f1d443f9d57272dc6e72ce75"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "11-simulate-compute-actions",
   "utc": "2026-11-11T02:25:26Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names lambda:CreateFunction lambda:InvokeFunction lambda:UpdateFunctionCode ec2:RunInstances \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "d9a4f37d6c962c7748463ece0a3ff6b7acacf5ed5373b4dec98da67b72d1d8c8"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "12-proof-lambda-create-function",
   "utc": "2026-11-11T02:25:26Z",
   "command": "aws lambda create-function --function-name atarus-passrole-proof --runtime python3.12 \\\n  --role arn:aws:iam::111122223333:role/app-deploy-role --handler proof.handler --zip-file fileb://proof.zip \\\n  --query '{FunctionName:FunctionName,Role:Role,State:State}'",
   "sha256": "b1beb4c8826967dda2a783b39dea23863442480904fc703da5dabaad8c04d16d"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "13-proof-lambda-wait-active",
   "utc": "2026-11-11T02:25:28Z",
   "command": "aws lambda wait function-active-v2 --function-name atarus-passrole-proof",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "14-proof-lambda-invoke",
   "utc": "2026-11-11T02:25:30Z",
   "command": "aws lambda invoke --function-name atarus-passrole-proof response.json && cat response.json",
   "sha256": "4b8fe9a3925ef9988cb29ee133e08c00069fedfdb6a99f2670b040c1c56a1578"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "15-proof-lambda-delete-function",
   "utc": "2026-11-11T02:25:33Z",
   "command": "aws lambda delete-function --function-name atarus-passrole-proof",
   "sha256": "2ca38e09ee7277bb80ed64448f2f8e4642c22a8b119d8064805f4ac997e68b19"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "16-list-roles-trusting-aws-principals",
   "utc": "2026-11-11T02:25:34Z",
   "command": "aws iam list-roles \\\n  --query \"Roles[?AssumeRolePolicyDocument.Statement[?Principal.AWS]].[RoleName,AssumeRolePolicyDocument.Statement[].Principal.AWS]\"",
   "sha256": "c37dbc65f3be4cba3a3e19bd46c0bed3f3a67d98eba1e36354092583410e38a5"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "17-simulate-assume-role",
   "utc": "2026-11-11T02:25:35Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names sts:AssumeRole --resource-arns arn:aws:iam::111122223333:role/ops-break-glass \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "f563db90ad1644b21b831eb133aa5cab604f14d8e8124b2dc1d8887805dc088e"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "18-proof-assume-role",
   "utc": "2026-11-11T02:25:36Z",
   "command": "aws sts assume-role --role-arn arn:aws:iam::111122223333:role/ops-break-glass --role-session-name atarus-test \\\n  --duration-seconds 900 --policy '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"sts:GetCallerIdentity\",\"Resource\":\"*\"}]}' \\\n  --query '{session:AssumedRoleUser.Arn,expires:Credentials.Expiration}'",
   "sha256": "aa99c5939e517440b4bbb4e852e358e887974d087f2fe00792b52634b791cd25"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "19-describe-instances",
   "utc": "2026-11-11T02:25:36Z",
   "command": "aws ec2 describe-instances \\\n  --query 'Reservations[].Instances[].[InstanceId,IamInstanceProfile.Arn,MetadataOptions.HttpTokens]' --output text",
   "sha256": "e30d794334cd588349ea2e520e81197b30cecbf0137fc0dceaa7502c8fbd5f1b"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "20-get-instance-profile",
   "utc": "2026-11-11T02:25:37Z",
   "command": "aws iam get-instance-profile --instance-profile-name prod-api-profile --query 'InstanceProfile.Roles[].RoleName' --output text",
   "sha256": "5453654b13bfe4d9a7864740f16f9761f25decac5f1b960982fd2122b0079513"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "21-simulate-instance-actions",
   "utc": "2026-11-11T02:25:38Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names ssm:SendCommand ssm:StartSession ec2-instance-connect:SendSSHPublicKey ec2:ModifyInstanceAttribute ec2:AssociateIamInstanceProfile \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "85a54b1b0ac8db79b202d8c6193093a37a077bbfd8075404a6f922de45f45556"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "21b-simulate-send-command-named",
   "utc": "2026-11-11T02:25:39Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names ssm:SendCommand \\\n  --resource-arns arn:aws:ec2:us-east-1:111122223333:instance/i-0abc1234def567890 arn:aws:ssm:us-east-1::document/AWS-RunShellScript \\\n  --query 'EvaluationResults[].ResourceSpecificResults[].[EvalResourceName,EvalResourceDecision]' --output text",
   "sha256": "7d917e82b06a714201b93a927467697d189534b9302ff83a92ea82ac543efba5"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "21c-start-prod-api",
   "utc": "2026-11-11T02:25:40Z",
   "command": "aws ec2 start-instances --instance-ids i-0abc1234def567890 --query 'StartingInstances[0].[PreviousState.Name,CurrentState.Name]' --output text",
   "sha256": "43b8b05b42363a4117af643a61ae63b41f9162c7184fea8b05f5d3270e0759aa"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "21d-wait-running",
   "utc": "2026-11-11T02:25:42Z",
   "command": "aws ec2 wait instance-running --instance-ids i-0abc1234def567890\naws ec2 describe-instances --instance-ids i-0abc1234def567890 --query 'Reservations[0].Instances[0].State.Name' --output text",
   "sha256": "a4ecc5c87d811bbff7a118c17ef8cf83318cb623a103c15b8549089aa2a7f0ac"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "21e-wait-ssm-online",
   "utc": "2026-11-11T02:25:59Z",
   "command": "for i in $(seq 1 40); do\n  s=$(aws ssm describe-instance-information --filters Key=InstanceIds,Values=i-0abc1234def567890 --query 'InstanceInformationList[0].PingStatus' --output text)\n  [ \"$s\" = Online ] && break\n  sleep 10\ndone\necho \"$s\"",
   "sha256": "9eafda3f0370942f57bb949586630c20a89a2c2ba4feb73fe106ac68ed3d48b4"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "22-proof-ssm-send-command",
   "utc": "2026-11-11T02:25:59Z",
   "command": "aws ssm send-command --instance-ids i-0abc1234def567890 --document-name AWS-RunShellScript \\\n  --parameters 'commands=[\"TOKEN=$(curl -s -X PUT http://169.254.169.254/latest/api/token -H X-aws-ec2-metadata-token-ttl-seconds:60)\",\"curl -s -H X-aws-ec2-metadata-token:$TOKEN http://169.254.169.254/latest/meta-data/iam/security-credentials/\",\"aws sts get-caller-identity --query Arn\"]' \\\n  --query 'Command.CommandId' --output text",
   "sha256": "34640ae912bceda75646d803edece4fee1aec1f88be042612b0fe41318756b04"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "23-proof-ssm-wait-command-executed",
   "utc": "2026-11-11T02:26:00Z",
   "command": "aws ssm wait command-executed --command-id \"$(aws ssm list-commands --instance-id i-0abc1234def567890 --query 'Commands[0].CommandId' --output text)\" --instance-id i-0abc1234def567890",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "24-proof-ssm-get-command-invocation",
   "utc": "2026-11-11T02:26:07Z",
   "command": "aws ssm get-command-invocation --command-id \"$(aws ssm list-commands --instance-id i-0abc1234def567890 --query 'Commands[0].CommandId' --output text)\" --instance-id i-0abc1234def567890 \\\n  --query StandardOutputContent --output text",
   "sha256": "c6979b2908e08dc0afb82969d2033c8bb8b2a20c8f0a67f0c8409afb4a452fab"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "25-cleanup-remove-local-output",
   "utc": "2026-11-11T02:26:08Z",
   "command": "rm -f response.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "26-cleanup-verify-policy-versions",
   "utc": "2026-11-11T02:26:08Z",
   "command": "aws iam list-policy-versions --policy-arn arn:aws:iam::111122223333:policy/atarus-test-policy \\\n  --query 'Versions[].[VersionId,IsDefaultVersion]' --output text",
   "sha256": "4b3da084cd401091aa23e1ecd7397c6455964556aa1bd78149d87b4d54463bb5"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "27-cleanup-verify-function-gone",
   "utc": "2026-11-11T02:26:09Z",
   "command": "aws lambda get-function --function-name atarus-passrole-proof",
   "sha256": "e2869358d51f0ce1808de6f87a8582a87de3be7476a2e66aee0d9a50d8227223"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "28-stop-prod-api",
   "utc": "2026-11-11T02:26:10Z",
   "command": "aws ec2 stop-instances --instance-ids i-0abc1234def567890 --query 'StoppingInstances[0].[PreviousState.Name,CurrentState.Name]' --output text",
   "sha256": "c0f492493540f0e94746c4c0da0ed8253c4ab94b4302685ebf808a0afb072cd2"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "29-wait-stopped",
   "utc": "2026-11-11T02:26:11Z",
   "command": "aws ec2 wait instance-stopped --instance-ids i-0abc1234def567890\naws ec2 describe-instances --instance-ids i-0abc1234def567890 --query 'Reservations[0].Instances[0].State.Name' --output text",
   "sha256": "f247a76b2893208aae7751dbf51f4c495efacfb6d9e743802870300f31ac45c8"
  },
  {
   "chapter": 5,
   "run": "r-20261111-022511-46ee",
   "step": "30-delete-proof-log-group",
   "utc": "2026-11-11T02:26:44Z",
   "command": "aws logs delete-log-group --log-group-name /aws/lambda/atarus-passrole-proof\naws logs describe-log-groups --log-group-name-prefix /aws/lambda/atarus-passrole-proof --query 'logGroups[].logGroupName' --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 5,
   "run": "r-20261108-185121-8436",
   "step": "01-instance-state",
   "utc": "2026-11-08T18:51:22Z",
   "command": "aws ec2 describe-instances --instance-ids i-0abc1234def567890 --query 'Reservations[0].Instances[0].State.Name' --output text",
   "sha256": "f247a76b2893208aae7751dbf51f4c495efacfb6d9e743802870300f31ac45c8"
  },
  {
   "chapter": 5,
   "run": "r-20261108-185121-8436",
   "step": "02-send-command-refused",
   "utc": "2026-11-08T18:51:22Z",
   "command": "aws ssm send-command --instance-ids i-0abc1234def567890 --document-name AWS-RunShellScript \\\n  --parameters 'commands=[\"TOKEN=$(curl -s -X PUT http://169.254.169.254/latest/api/token -H X-aws-ec2-metadata-token-ttl-seconds:60)\",\"curl -s -H X-aws-ec2-metadata-token:$TOKEN http://169.254.169.254/latest/meta-data/iam/security-credentials/\",\"aws sts get-caller-identity --query Arn\"]' \\\n  --query 'Command.CommandId' --output text",
   "sha256": "9832707a9f0fab05a4dc631d241c42eca7e69cee0b2bde58e451c724c00d3f66"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "01-list-analyzers",
   "utc": "2026-11-11T02:47:48Z",
   "command": "aws accessanalyzer list-analyzers --region us-east-1 --query 'analyzers[].[name,type,status]' --output text",
   "sha256": "b827816b4ab37e2b7c01512bb68d869652798db482a44fe832bdd61f9a91c0a7"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "02-active-findings",
   "utc": "2026-11-11T02:47:50Z",
   "command": "an=$(aws accessanalyzer list-analyzers --region us-east-1 --query 'analyzers[?type==`ACCOUNT`].arn | [0]' --output text)\naws accessanalyzer list-findings-v2 --region us-east-1 --analyzer-arn \"$an\" \\\n  --filter '{\"status\":{\"eq\":[\"ACTIVE\"]}}' \\\n  --query 'findings[].[resourceType,resource,resourceOwnerAccount,status]' --output text",
   "sha256": "418925f94b1f365d974b2b1b7f2e83aaecf5e3fc738ac4b1f143d28d6fa1a64c"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "03-account-public-access-block",
   "utc": "2026-11-11T02:47:52Z",
   "command": "aws s3control get-public-access-block --account-id 111122223333 --query PublicAccessBlockConfiguration",
   "sha256": "5f0bd0755ba288760466961b1d6d68a6ffda902afddf9451c7d2bf81b70d4085"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "04-bucket-policy-status",
   "utc": "2026-11-11T02:47:54Z",
   "command": "for b in $(aws s3api list-buckets --query 'Buckets[].Name' --output text); do\n  printf '%s\\t' \"$b\"\n  aws s3api get-bucket-policy-status --bucket \"$b\" --query PolicyStatus.IsPublic --output text 2>/dev/null || echo none\ndone",
   "sha256": "fb3e511aafd3391e25adcfd0edcb03902a374a43b5bac84eb4623b270dfce2a2"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "05-exports-bucket-statements",
   "utc": "2026-11-11T02:47:58Z",
   "command": "aws s3api get-bucket-policy --bucket example-exports --query Policy --output text \\\n  | jq -c '.Statement[] | {Sid, Principal, Action, Condition}'",
   "sha256": "62e55793fb45fd8fa1c070c2c11636bc84caf923feedda9ae01c080de85ef9f4"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "06-kms-key-policy",
   "utc": "2026-11-11T02:48:00Z",
   "command": "aws kms get-key-policy --region us-east-1 --key-id 1a2b3c4d-5e6f-7a8b-9c0d-EXAMPLE11111 --policy-name default \\\n  --query Policy --output text | jq -c '.Statement[] | select(.Effect==\"Allow\") | {Sid, Principal, Action, Condition}'",
   "sha256": "b00b4ab2cfe5cff4b580d0bcbcd44ae55098d5508fca914a44acda6f44440c45"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "07-secret-resource-policy",
   "utc": "2026-11-11T02:48:01Z",
   "command": "aws secretsmanager get-resource-policy --region us-east-1 --secret-id prod/partner/webhook \\\n  --query ResourcePolicy --output text | jq -c '.Statement[] | {Principal, Action, Condition}'",
   "sha256": "ca70d061a1807015b9f518d70f20c26bd19399d7c42b0e7975482a37a0aec1fc"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "08-ecr-repository-policy",
   "utc": "2026-11-11T02:48:02Z",
   "command": "aws ecr get-repository-policy --region us-east-1 --repository-name app-api \\\n  --query policyText --output text | jq -c '.Statement[] | {Sid, Principal, Action, Condition}'",
   "sha256": "51804de5adcdee3bf3bd9edb18654519c77ad15019d62756a5e417be970628eb"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "09-lambda-function-policy",
   "utc": "2026-11-11T02:48:03Z",
   "command": "aws lambda get-policy --region us-east-1 --function-name order-webhook --query Policy --output text \\\n  | jq -c '.Statement[] | {Sid, Principal, Action, Condition}'",
   "sha256": "495e46b497e5ab57dd57e842da2306d269ec25892d2c037e7331570d7749799a"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "10-sqs-queue-policy",
   "utc": "2026-11-11T02:48:04Z",
   "command": "aws sqs get-queue-attributes --region us-east-1 --queue-url https://sqs.us-east-1.amazonaws.com/111122223333/orders-inbound \\\n  --attribute-names Policy --query Attributes.Policy --output text | jq -c '.Statement[] | {Principal, Action, Condition}'",
   "sha256": "f11df3772ae7db572c7b3c403c5f420fd8f6ad681a960c3855801f7d5538865a"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "11-sns-topic-policy",
   "utc": "2026-11-11T02:48:05Z",
   "command": "aws sns get-topic-attributes --region us-east-1 --topic-arn arn:aws:sns:us-east-1:111122223333:alerts \\\n  --query Attributes.Policy --output text | jq -c '.Statement[] | {Sid, Principal, Action, Condition}'",
   "sha256": "0286c6ab8a26895c56af67c46b9c3baaaf859f30ef0a8109952712c54c4f2c46"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "12-write-open-policy-fixtures",
   "utc": "2026-11-11T02:48:06Z",
   "command": "cat > open-queue-policy.json <<EOF\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"},\"Action\":\"sqs:SendMessage\",\"Resource\":\"arn:aws:sqs:us-east-1:111122223333:orders-inbound\"}]}\nEOF\ncat > open-function-policy.json <<EOF\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"PublicUrl\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"lambda:InvokeFunctionUrl\",\"Resource\":\"arn:aws:lambda:us-east-1:111122223333:function:order-webhook\",\"Condition\":{\"StringEquals\":{\"lambda:FunctionUrlAuthType\":\"NONE\"}}}]}\nEOF\nls open-*.json",
   "sha256": "3b543b77bb5388425cfc1f46c98d17072697e50e930c9892bf2adf772aef12bf"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "13-judge-open-policies-without-applying",
   "utc": "2026-11-11T02:48:06Z",
   "command": "aws accessanalyzer check-no-public-access --policy-document file://open-queue-policy.json --resource-type AWS::SQS::Queue \\\n  --query '[result,message]' --output text\naws accessanalyzer check-no-public-access --policy-document file://open-function-policy.json --resource-type AWS::Lambda::Function \\\n  --query '[result,message]' --output text",
   "sha256": "30edcdfe2d8606bfa036014c1be0bf85fc6b4469bcacf234eee80c049d073351"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "13b-check-access-not-granted",
   "utc": "2026-11-11T02:48:08Z",
   "command": "aws accessanalyzer check-access-not-granted --policy-document file://open-queue-policy.json --policy-type RESOURCE_POLICY \\\n  --access actions=sqs:SendMessage --query '[result,message]' --output text",
   "sha256": "0a98c4bddec6d9661e4a769e5bf85ac8e45df81c26ab0ea4e082cef9fe89facb"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "14-rest-apis",
   "utc": "2026-11-11T02:48:09Z",
   "command": "aws apigateway get-rest-apis --region us-east-1 \\\n  --query \"items[].[id,name,endpointConfiguration.types[0],length(policy || '')]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "15-exports-data-class",
   "utc": "2026-11-11T02:48:09Z",
   "command": "aws s3api get-bucket-tagging --bucket example-exports --query 'TagSet[?Key==`DataClass`].Value' --output text",
   "sha256": "dc75eb42ed779f9dee82891e926bf6b0fc72e2ac35b2e1fa57d16662ec72e05d"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "16-exports-object-count",
   "utc": "2026-11-11T02:48:10Z",
   "command": "aws cloudwatch get-metric-statistics --region us-east-1 --namespace AWS/S3 --metric-name NumberOfObjects \\\n  --dimensions Name=BucketName,Value=example-exports Name=StorageType,Value=AllStorageTypes \\\n  --start-time \"$(date -u -d '-3 days' +%Y-%m-%dT00:00:00Z)\" --end-time \"$(date -u +%Y-%m-%dT00:00:00Z)\" --period 86400 --statistics Average \\\n  --query 'sort_by(Datapoints,&Timestamp)[-1].Average' --output text",
   "sha256": "64342505aa59f739d87352bbe5ae4f97f3c4e7348bb6372a7f9ec6859d11f99e"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "17-exports-size",
   "utc": "2026-11-11T02:48:11Z",
   "command": "aws cloudwatch get-metric-statistics --region us-east-1 --namespace AWS/S3 --metric-name BucketSizeBytes \\\n  --dimensions Name=BucketName,Value=example-exports Name=StorageType,Value=StandardStorage \\\n  --start-time \"$(date -u -d '-3 days' +%Y-%m-%dT00:00:00Z)\" --end-time \"$(date -u +%Y-%m-%dT00:00:00Z)\" --period 86400 --statistics Average \\\n  --query 'sort_by(Datapoints,&Timestamp)[-1].Average' --output text",
   "sha256": "7758c4acef3ac9af657a4cbedb37bd591070dc26c8aa62ca38f57ba55cf7ac2b"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "18-cleanup-remove-fixtures",
   "utc": "2026-11-11T02:48:12Z",
   "command": "rm -f open-queue-policy.json open-function-policy.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024730-5cb2",
   "step": "19-cleanup-verify-no-writes",
   "utc": "2026-11-11T02:48:12Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-11T02:47:30Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 6,
   "run": "r-20261111-030405-14d2",
   "step": "01-write-check-later",
   "utc": "2026-11-11T03:04:21Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-11T02:47:48Z --end-time 2026-11-11T02:48:14Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 6,
   "run": "r-20261111-030405-14d2",
   "step": "02-positive-control",
   "utc": "2026-11-11T03:04:22Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-11T02:47:48Z --end-time 2026-11-11T02:48:14Z \\\n  --lookup-attributes AttributeKey=EventName,AttributeValue=GetKeyPolicy \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "556f5bd589e063487ab8c7d051b702bfdeacca8465ebfc8173d4e55e88291439"
  },
  {
   "chapter": 6,
   "run": "r-20261111-030659-a284",
   "step": "01-metric-read-no-datapoint",
   "utc": "2026-11-11T03:07:00Z",
   "command": "aws cloudwatch get-metric-statistics --region us-east-1 --namespace AWS/S3 --metric-name NumberOfObjects \\\n  --dimensions Name=BucketName,Value=example-exports-typo Name=StorageType,Value=AllStorageTypes \\\n  --start-time \"$(date -u -d '-3 days' +%Y-%m-%dT00:00:00Z)\" --end-time \"$(date -u +%Y-%m-%dT00:00:00Z)\" --period 86400 --statistics Average \\\n  --query 'sort_by(Datapoints,&Timestamp)[-1].Average' --output text",
   "sha256": "af5d8a21858f42808c9bcc17012b77bcc2fd6ab3b071dbd4a05f13f410470541"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024813-3b88",
   "step": "01-policy-check-as-ci-deploy",
   "utc": "2026-11-11T02:48:15Z",
   "command": "printf '%s' '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"sqs:SendMessage\",\"Resource\":\"*\"}]}' > f.json\naws accessanalyzer check-no-public-access --policy-document file://f.json --resource-type AWS::SQS::Queue \\\n  --query '[result,message]' --output text",
   "sha256": "df15e0313c67e0f1c80d5e0a2b15d34b56d632897a4b3a9e4af30bd83fe2fcf1"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024813-3b88",
   "step": "03-cleanup-remove-document",
   "utc": "2026-11-11T02:48:16Z",
   "command": "rm -f f.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 6,
   "run": "r-20261111-031240-ff0a",
   "step": "01-check-outside-lab-directory",
   "utc": "2026-11-11T03:12:41Z",
   "command": "aws accessanalyzer check-no-public-access --policy-document file://open-queue-policy.json --resource-type AWS::SQS::Queue \\\n  --query '[result,message]' --output text",
   "sha256": "c5d869fb0d48e5a7ef17b0d780a28eabe0853a93d7914f85c69055c2c05d3caa"
  },
  {
   "chapter": 6,
   "run": "r-20261111-024813-3b88",
   "step": "02-repository-with-no-policy",
   "utc": "2026-11-11T02:48:15Z",
   "command": "aws ecr get-repository-policy --region us-east-1 --repository-name base/python \\\n  --query policyText --output text | jq -c '.Statement[] | {Sid, Principal, Action, Condition}'",
   "sha256": "5ddbc212607b860f41e78526fe686786d47b117baca004f14b23bbdb18d1b23d"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "01-functions-by-secret-count",
   "utc": "2026-11-08T18:46:18Z",
   "command": "bash -o pipefail <<'SH'\nfor r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do\n  aws lambda list-functions --region \"$r\" --output json 2>/dev/null \\\n    | jq -r --arg r \"$r\" '.Functions[] | [$r, .FunctionName,\n        ((.Environment.Variables // {}) | keys | length),\n        ((.Environment.Variables // {}) | keys | map(select(test(\"pass|secret|token|key|cred|pwd\"; \"i\"))) | length)] | @tsv'\ndone | sort -t$'\\t' -k4,4nr\nSH",
   "sha256": "d515e6ec2140fa59ca41400d0f86e7dc8704065c3bbc4fc3efcb3b93618cd600"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "02-orders-sync-key-and-names",
   "utc": "2026-11-08T18:46:37Z",
   "command": "aws lambda get-function-configuration --region us-east-1 --function-name orders-sync \\\n  --query '[KMSKeyArn, keys(Environment.Variables || `{}`)]'",
   "sha256": "2e565f11e6633fd78927c769883c1b60f09a14993ed207db7342a6a8fff33a6a"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "03-instance-ids",
   "utc": "2026-11-08T18:46:38Z",
   "command": "aws ec2 describe-instances --region us-east-1 --query 'Reservations[].Instances[].InstanceId' --output text",
   "sha256": "3e52a440e17a401cceaa319cfe810c16a3bd2a95f3adbd00f332e2baf1f67e68"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "04-user-data-secret-names",
   "utc": "2026-11-08T18:46:39Z",
   "command": "aws ec2 describe-instance-attribute --region us-east-1 --instance-id i-0abc1234def567890 --attribute userData \\\n  --query 'UserData.Value' --output text | base64 -d \\\n  | grep -Eion '[A-Za-z_]*(password|passwd|secret|token|api[_-]?key|access[_-]?key)[A-Za-z_]*='",
   "sha256": "4c2d39104aec8262d41bc741ebfe66eaf93406832a024f11974dd158f1dbfa86"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "05-launch-template-versions",
   "utc": "2026-11-08T18:46:40Z",
   "command": "bash -o pipefail <<'SH'\naws ec2 describe-launch-template-versions --region us-east-1 --launch-template-name web-tier \\\n  --query 'LaunchTemplateVersions[].[VersionNumber,DefaultVersion,LaunchTemplateData.UserData]' --output text \\\n  | while IFS=$'\\t' read -r v d ud; do printf '%s\\t%s\\t%s\\n' \"$v\" \"$d\" \\\n      \"$(printf '%s' \"$ud\" | base64 -d 2>/dev/null | grep -Eioc '(password|secret|token|api[_-]?key)[A-Za-z_]*=')\"; done\nSH",
   "sha256": "2b870773240bc6de0a00c01675b70dd614d8122ed228ad4003a43335bb740dd3"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "06-launch-configurations",
   "utc": "2026-11-08T18:46:40Z",
   "command": "aws autoscaling describe-launch-configurations --region us-east-1 \\\n  --query 'LaunchConfigurations[].LaunchConfigurationName' --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "07-task-definitions",
   "utc": "2026-11-08T18:46:41Z",
   "command": "aws ecs list-task-definitions --region us-east-1 --status ACTIVE --query 'taskDefinitionArns[]' --output text",
   "sha256": "0f4e00aa25e2a473a9afb79107dfa3a8a524f4e5ec21252a098c0a3b9e962eb7"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "08-task-definition-env-names",
   "utc": "2026-11-08T18:46:42Z",
   "command": "aws ecs describe-task-definition --region us-east-1 --task-definition orders-api:1 \\\n  --query 'taskDefinition.containerDefinitions[].{container:name,plain:environment[].name,referenced:secrets[].name}'",
   "sha256": "647a64fcde046abc2de94b6b2eaab5b32bfd894cbfcf54c34651323131910168"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "09-owned-ssm-documents",
   "utc": "2026-11-08T18:46:43Z",
   "command": "aws ssm list-documents --region us-east-1 --filters Key=Owner,Values=Self \\\n  --query 'DocumentIdentifiers[].[Name,DocumentType]' --output text",
   "sha256": "1f52af3bb4271101f6e327c2fc9f862b9baecc16b44981adbe23a41381743b89"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "10-ssm-document-secret-lines",
   "utc": "2026-11-08T18:46:43Z",
   "command": "aws ssm get-document --region us-east-1 --name patch-and-join --query Content --output text \\\n  | grep -Eion '[A-Za-z_]*(password|secret|token|api[_-]?key)[A-Za-z_]*(=|\":)'",
   "sha256": "98a7ae7183b8fdf20726d82671750caab6496b2cb909d357231e75dc27ed4ef1"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "11-stack-parameters-and-outputs",
   "utc": "2026-11-08T18:46:44Z",
   "command": "aws cloudformation describe-stacks --region us-east-1 \\\n  --query 'Stacks[].{stack:StackName,params:Parameters[].ParameterKey,masked:Parameters[?ParameterValue==`****`].ParameterKey,outputs:Outputs[].OutputKey}'",
   "sha256": "92a1a47612a9f42291a648b08bb974d7656492fc868228290b3ab79ebc28a65d"
  },
  {
   "chapter": 7,
   "run": "r-20261108-184617-3cb7",
   "step": "12-cleanup-verify-no-writes",
   "utc": "2026-11-08T18:46:45Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:35:00Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 7,
   "run": "r-20261108-193150-7240",
   "step": "01-write-check-later",
   "utc": "2026-11-08T19:31:51Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:18Z --end-time 2026-11-08T18:46:46Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 7,
   "run": "r-20261108-193150-7240",
   "step": "02-positive-control",
   "utc": "2026-11-08T19:31:52Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:18Z --end-time 2026-11-08T18:46:46Z \\\n  --lookup-attributes AttributeKey=EventName,AttributeValue=GetFunctionConfiguration20150331v2 \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "479254a2ed94b8a5dd37f6084b95ebd20c12cf51b71451d26e61d130d7dab9ce"
  },
  {
   "chapter": 7,
   "run": "r-20261108-191654-10a8",
   "step": "01-wrong-profile-empty-table",
   "utc": "2026-11-08T19:16:55Z",
   "command": "bash -o pipefail <<'SH'\nfor r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do\n  aws lambda list-functions --region \"$r\" --output json 2>/dev/null \\\n    | jq -r --arg r \"$r\" '.Functions[] | [$r, .FunctionName,\n        ((.Environment.Variables // {}) | keys | length),\n        ((.Environment.Variables // {}) | keys | map(select(test(\"pass|secret|token|key|cred|pwd\"; \"i\"))) | length)] | @tsv'\ndone | sort -t$'\\t' -k4,4nr\nSH",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 7,
   "run": "r-20261108-191654-10a8",
   "step": "02-wrong-profile-not-found",
   "utc": "2026-11-08T19:17:14Z",
   "command": "aws lambda get-function-configuration --region us-east-1 --function-name orders-sync \\\n  --query '[KMSKeyArn, keys(Environment.Variables || `{}`)]'",
   "sha256": "9a97992bb6c5ed89f3e5241de41edaf7d0ecf013071434673f9947558aa9ac45"
  },
  {
   "chapter": 7,
   "run": "r-20261108-191654-10a8",
   "step": "03-unset-instance-id",
   "utc": "2026-11-08T19:17:14Z",
   "command": "unset LAB_INSTANCE_ID\naws ec2 describe-instance-attribute --region us-east-1 --instance-id $LAB_INSTANCE_ID --attribute userData \\\n  --query 'UserData.Value' --output text | base64 -d \\\n  | grep -Eion '[A-Za-z_]*(password|passwd|secret|token|api[_-]?key|access[_-]?key)[A-Za-z_]*='",
   "sha256": "a190dadcd066ab79df00444dfbf780fbf72533c41ed65ddc589afc2207a3bc71"
  },
  {
   "chapter": 7,
   "run": "r-20261108-191654-10a8",
   "step": "04-unset-window-start",
   "utc": "2026-11-08T19:17:15Z",
   "command": "unset LAB_WINDOW_START\naws cloudtrail lookup-events --start-time $LAB_WINDOW_START \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "10359866aff6d1ec90fa91dd7fb8e66275a5f0848de87e35536407fc49d02492"
  },
  {
   "chapter": 7,
   "run": "r-20261108-194440-890d",
   "step": "01-plain-name-finds-nothing",
   "utc": "2026-11-08T19:44:40Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:18Z --end-time 2026-11-08T18:46:46Z \\\n  --lookup-attributes AttributeKey=EventName,AttributeValue=GetFunctionConfiguration \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 7,
   "run": "r-20261108-194440-890d",
   "step": "02-names-in-the-window",
   "utc": "2026-11-08T19:44:41Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:18Z --end-time 2026-11-08T18:46:46Z \\\n  --lookup-attributes AttributeKey=Username,AttributeValue=atarus-review \\\n  --query \"Events[?starts_with(EventName, 'GetFunction')].EventName\" --output text",
   "sha256": "e24ca22e303fce5e73bb09a39210404cd6c0107da740230cdf09adf4bc8cc71c"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "01-secrets-and-rotation",
   "utc": "2026-11-08T18:46:47Z",
   "command": "aws secretsmanager list-secrets --region us-east-1 \\\n  --query 'SecretList[].[Name,RotationEnabled,LastRotatedDate,KmsKeyId]' --output text",
   "sha256": "958e8505f9911003411405b3989b244742b1a3af1425550858a2152f9fc7d2e2"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "02-secret-resource-policy",
   "utc": "2026-11-08T18:46:47Z",
   "command": "aws secretsmanager get-resource-policy --region us-east-1 --secret-id prod/payments/api-key \\\n  --query ResourcePolicy --output text | jq '.Statement[] | {Effect, Principal, Action}'",
   "sha256": "ac3340d764a78bd0738dadfcb438e17c1d967b12095b703951b744d3575cb7bc"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "03-simulate-reporting-batch-read",
   "utc": "2026-11-08T18:46:48Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:role/reporting-batch \\\n  --action-names secretsmanager:GetSecretValue \\\n  --resource-arns \"$(aws secretsmanager describe-secret --region us-east-1 --secret-id prod/payments/api-key --query ARN --output text)\" \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "880b933340c25ba185692db28ecdd240dee8a921566a6cfb5f2f00c945264e45"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "04-key-policy-allows",
   "utc": "2026-11-08T18:46:50Z",
   "command": "aws kms get-key-policy --region us-east-1 --key-id 1a2b3c4d-5e6f-7a8b-9c0d-EXAMPLE11111 \\\n  --policy-name default --query Policy --output text \\\n  | jq -c '.Statement[] | select(.Effect == \"Allow\") | {Sid, Principal, Action, Condition}'",
   "sha256": "b00b4ab2cfe5cff4b580d0bcbcd44ae55098d5508fca914a44acda6f44440c45"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "05-key-grants",
   "utc": "2026-11-08T18:46:50Z",
   "command": "aws kms list-grants --region us-east-1 --key-id 1a2b3c4d-5e6f-7a8b-9c0d-EXAMPLE11111 \\\n  --query 'Grants[].[GranteePrincipal,join(`,`,Operations)]' --output text",
   "sha256": "0fe1a3ae3e45aef801afc1f4fb6eeced0f523ec05fd037db81a4f72e346274e2"
  },
  {
   "chapter": 8,
   "run": "r-20261108-192835-0d12",
   "step": "01-secret-key",
   "utc": "2026-11-08T19:28:51Z",
   "command": "aws secretsmanager describe-secret --region us-east-1 --secret-id prod/payments/api-key --query KmsKeyId --output text",
   "sha256": "07832f3d9f74c6a12c43bbac934b0c697d796e82bcaf352d26303b7323639011"
  },
  {
   "chapter": 8,
   "run": "r-20261108-192835-0d12",
   "step": "02-simulate-reporting-batch-decrypt",
   "utc": "2026-11-08T19:28:54Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:role/reporting-batch \\\n  --action-names kms:Decrypt \\\n  --resource-arns arn:aws:kms:us-east-1:111122223333:key/1a2b3c4d-5e6f-7a8b-9c0d-EXAMPLE11111 \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "65b82771cb82f80e0c4e04510eb68b2f4a31686243d8625c5f46f9243f2a2548"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "06-judge-wildcard-key-policy",
   "utc": "2026-11-08T18:46:51Z",
   "command": "cat > wildcard-key-policy.json <<EOF\n{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Enable IAM User Permissions\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::111122223333:root\"},\"Action\":\"kms:*\",\"Resource\":\"*\"},{\"Sid\":\"Allow use of the key\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"kms:Decrypt\",\"kms:DescribeKey\"],\"Resource\":\"*\"}]}\nEOF\naws accessanalyzer check-no-public-access --policy-document file://wildcard-key-policy.json --resource-type AWS::KMS::Key \\\n  --query '[result,message]' --output text",
   "sha256": "821dc7cd701a6f53a5bed594302d5416e2f338136c2218be0040afa2746d2693"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "07-parameter-types",
   "utc": "2026-11-08T18:46:52Z",
   "command": "aws ssm describe-parameters --region us-east-1 \\\n  --query 'Parameters[].[Name,Type,KeyId]' --output text | grep -iE 'secret|token|password|key'",
   "sha256": "08ca64d637676582230a2bfdc99c225d082f8dae73cc63453154541df1b9f78f"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "08-cleanup-remove-fixture",
   "utc": "2026-11-08T18:46:53Z",
   "command": "rm -f wildcard-key-policy.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184646-4194",
   "step": "09-cleanup-verify-no-writes",
   "utc": "2026-11-08T18:46:53Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:35:00Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 8,
   "run": "r-20261108-193943-8063",
   "step": "01-write-check-later",
   "utc": "2026-11-08T19:39:59Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:47Z --end-time 2026-11-08T18:46:55Z \\\n  --lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  {
   "chapter": 8,
   "run": "r-20261108-193943-8063",
   "step": "02-positive-control",
   "utc": "2026-11-08T19:40:00Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:47Z --end-time 2026-11-08T18:46:55Z \\\n  --lookup-attributes AttributeKey=EventName,AttributeValue=DescribeSecret \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "574c06e07b0a9b0303ed31755f4e00be2ac57b6fb6c789b195dcd97034e5386d"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184325-6736",
   "step": "01-check-no-public-access-denied",
   "utc": "2026-11-08T18:43:26Z",
   "command": "printf '%s' '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"kms:Decrypt\",\"kms:DescribeKey\"],\"Resource\":\"*\"}]}' > f1-key-policy.json\naws accessanalyzer check-no-public-access --policy-document file://f1-key-policy.json --resource-type AWS::KMS::Key \\\n  --query '[result,message]' --output text",
   "sha256": "b90f0c95e65b6640b7e02a5f58437c4db584d62fe7e3e5c97c1d236731804557"
  },
  {
   "chapter": 8,
   "run": "r-20261108-184325-6736",
   "step": "02-cleanup-remove-document",
   "utc": "2026-11-08T18:43:27Z",
   "command": "rm -f f1-key-policy.json && echo removed",
   "sha256": "6b95743f7339e0aff16c1d1b9f453711ffcdc3fed9b6787af264f9601c4e2961"
  },
  {
   "chapter": 8,
   "run": "r-20261108-191550-c6be",
   "step": "01-no-resource-policy-prints-none",
   "utc": "2026-11-08T19:15:50Z",
   "command": "aws secretsmanager get-resource-policy --region us-east-1 --secret-id prod/db/app --query ResourcePolicy --output text",
   "sha256": "af5d8a21858f42808c9bcc17012b77bcc2fd6ab3b071dbd4a05f13f410470541"
  },
  {
   "chapter": 8,
   "run": "r-20261108-191550-c6be",
   "step": "02-jq-on-none-fails",
   "utc": "2026-11-08T19:15:51Z",
   "command": "aws secretsmanager get-resource-policy --region us-east-1 --secret-id prod/db/app --query ResourcePolicy --output text \\\n  | jq '.Statement[] | {Effect, Principal, Action}'",
   "sha256": "e933b737909be2b75c5ca19b9ebac7c613f4086133d385cb2599659ab42b0353"
  },
  {
   "chapter": 8,
   "run": "r-20261108-191550-c6be",
   "step": "03-key-policy-by-alias-refused",
   "utc": "2026-11-08T19:15:52Z",
   "command": "aws kms get-key-policy --region us-east-1 --key-id alias/capture-a-data --policy-name default --query Policy --output text",
   "sha256": "d4b2071d6900ab3003b517d2494751356c5d4165431b120899a177d3206fcb65"
  },
  {
   "chapter": 8,
   "run": "r-20261108-191550-c6be",
   "step": "04-key-id-from-alias",
   "utc": "2026-11-08T19:15:53Z",
   "command": "aws kms describe-key --region us-east-1 --key-id alias/capture-a-data --query KeyMetadata.KeyId --output text",
   "sha256": "ebda56fce1cf26a1c04ea8499ee62fca7be43de11b6c393bcd3f24a8c0bd2c1c"
  },
  {
   "chapter": 9,
   "run": "r-20261111-033755-93b6",
   "step": "01-caller-identity",
   "utc": "2026-11-11T03:38:11Z",
   "command": "aws sts get-caller-identity --query '[Account,Arn]' --output text",
   "sha256": "5e7d1e9dad59ad8eee274aff9e26271df3a97f5f583854fd7e53d67484b9cd1c"
  },
  {
   "chapter": 9,
   "run": "r-20261108-191450-c283",
   "step": "06-seeded-boundary-user",
   "utc": "2026-11-08T19:14:53Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/boundary-demo \\\n  --action-names s3:GetObject s3:PutObject iam:CreateUser \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision,PermissionsBoundaryDecisionDetail.AllowedByPermissionsBoundary]' --output text",
   "sha256": "dfe63500ebbccd2c8709c092ada7779113bbb2d9b2b59789477a9e4837498038"
  },
  {
   "chapter": 9,
   "run": "r-20261108-040549-4d73",
   "step": "06-simulate-escalation-actions",
   "utc": "2026-11-08T04:05:57Z",
   "command": "aws iam simulate-principal-policy \\\n  --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names iam:PassRole iam:CreatePolicyVersion lambda:CreateFunction \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "f1c9510c5ecbe407adeebc86f4b4462c1ec5e670e487f6c205eb244e25c79eb4"
  },
  {
   "chapter": 9,
   "run": "r-20261111-022511-46ee",
   "step": "10-simulate-passrole",
   "utc": "2026-11-11T02:25:25Z",
   "command": "aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::111122223333:user/ci-deploy \\\n  --action-names iam:PassRole --resource-arns arn:aws:iam::111122223333:role/app-deploy-role \\\n  --query 'EvaluationResults[].[EvalActionName,EvalDecision]' --output text",
   "sha256": "b4503c731ff11a02b202b0f0e2f970e112bdcad3f1d443f9d57272dc6e72ce75"
  },
  {
   "chapter": 9,
   "run": "r-20261111-022511-46ee",
   "step": "14-proof-lambda-invoke",
   "utc": "2026-11-11T02:25:30Z",
   "command": "aws lambda invoke --function-name atarus-passrole-proof response.json && cat response.json",
   "sha256": "4b8fe9a3925ef9988cb29ee133e08c00069fedfdb6a99f2670b040c1c56a1578"
  },
  {
   "chapter": 9,
   "run": "r-20261111-022511-46ee",
   "step": "27-cleanup-verify-function-gone",
   "utc": "2026-11-11T02:26:09Z",
   "command": "aws lambda get-function --function-name atarus-passrole-proof",
   "sha256": "e2869358d51f0ce1808de6f87a8582a87de3be7476a2e66aee0d9a50d8227223"
  },
  {
   "chapter": 9,
   "run": "r-20261111-024730-5cb2",
   "step": "05-exports-bucket-statements",
   "utc": "2026-11-11T02:47:58Z",
   "command": "aws s3api get-bucket-policy --bucket example-exports --query Policy --output text \\\n  | jq -c '.Statement[] | {Sid, Principal, Action, Condition}'",
   "sha256": "62e55793fb45fd8fa1c070c2c11636bc84caf923feedda9ae01c080de85ef9f4"
  },
  {
   "chapter": 9,
   "run": "r-20261108-184617-3cb7",
   "step": "01-functions-by-secret-count",
   "utc": "2026-11-08T18:46:18Z",
   "command": "bash -o pipefail <<'SH'\nfor r in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do\n  aws lambda list-functions --region \"$r\" --output json 2>/dev/null \\\n    | jq -r --arg r \"$r\" '.Functions[] | [$r, .FunctionName,\n        ((.Environment.Variables // {}) | keys | length),\n        ((.Environment.Variables // {}) | keys | map(select(test(\"pass|secret|token|key|cred|pwd\"; \"i\"))) | length)] | @tsv'\ndone | sort -t$'\\t' -k4,4nr\nSH",
   "sha256": "d515e6ec2140fa59ca41400d0f86e7dc8704065c3bbc4fc3efcb3b93618cd600"
  },
  {
   "chapter": 9,
   "run": "r-20261108-184646-4194",
   "step": "02-secret-resource-policy",
   "utc": "2026-11-08T18:46:47Z",
   "command": "aws secretsmanager get-resource-policy --region us-east-1 --secret-id prod/payments/api-key \\\n  --query ResourcePolicy --output text | jq '.Statement[] | {Effect, Principal, Action}'",
   "sha256": "ac3340d764a78bd0738dadfcb438e17c1d967b12095b703951b744d3575cb7bc"
  },
  {
   "chapter": 9,
   "run": "r-20261108-184646-4194",
   "step": "04-key-policy-allows",
   "utc": "2026-11-08T18:46:50Z",
   "command": "aws kms get-key-policy --region us-east-1 --key-id 1a2b3c4d-5e6f-7a8b-9c0d-EXAMPLE11111 \\\n  --policy-name default --query Policy --output text \\\n  | jq -c '.Statement[] | select(.Effect == \"Allow\") | {Sid, Principal, Action, Condition}'",
   "sha256": "b00b4ab2cfe5cff4b580d0bcbcd44ae55098d5508fca914a44acda6f44440c45"
  },
  {
   "chapter": 9,
   "run": "r-20261108-193150-7240",
   "step": "02-positive-control",
   "utc": "2026-11-08T19:31:52Z",
   "command": "aws cloudtrail lookup-events --start-time 2026-11-08T18:46:18Z --end-time 2026-11-08T18:46:46Z \\\n  --lookup-attributes AttributeKey=EventName,AttributeValue=GetFunctionConfiguration20150331v2 \\\n  --query \"Events[?contains(Username || '', 'atarus-review')].[EventTime,EventName]\" --output text",
   "sha256": "479254a2ed94b8a5dd37f6084b95ebd20c12cf51b71451d26e61d130d7dab9ce"
  }
 ]
}
