[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A90YNPPRG20CEM0WXZ20W2":3,"skill-same:01M7A90YNPPRG20CEM0WXZ20W2":142},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M7A90YNPPRG20CEM0WXZ20W2","iam-key-rotation-automator",null,"Designs and implements IAM access key rotation automation pipelines. Detects aged access keys via get-access-key-last-used and credential reports, wires EventBridge scheduled rules for 90-day rotation, deploys Lambda rotation flows (create, verify, deactivate, delete), manages graceful overlap windows, sends Slack\u002FSNS pre-rotation notifications, handles break-glass exception lists, syncs keys cross-account, integrates programmatic access advisor, automates credential reports, and migrates permanent keys to STS temporary credentials. Emits AUTOMATION_DEPLOYED with IaC template or REVIEW_REQUIRED with the specific gap.","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: iam-key-rotation-automator\ndescription: Designs and implements IAM access key rotation automation pipelines. Detects aged access keys via get-access-key-last-used and credential reports, wires EventBridge scheduled rules for 90-day rotation, deploys Lambda rotation flows (create, verify, deactivate, delete), manages graceful overlap windows, sends Slack\u002FSNS pre-rotation notifications, handles break-glass exception lists, syncs keys cross-account, integrates programmatic access advisor, automates credential reports, and migrates permanent keys to STS temporary credentials. Emits AUTOMATION_DEPLOYED with IaC template or REVIEW_REQUIRED with the specific gap.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline workflow design. Live deployment uses aws iam list-access-keys, create-access-key, update-access-key, delete-access-key, get-access-key-last-used, generate-credential-report, aws events put-rule\u002Fput-targets, aws lambda create-function, aws sns publish, aws sts get-caller-identity.\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '4'\n  supports_pipeline: 'true'\n  family: Security\n  task_type: automate\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: AUTOMATION_DEPLOYED | REVIEW_REQUIRED\n  when_to_use: Building IAM access key rotation automation, wiring EventBridge schedules for key rotation, deploying Lambda rotation flows with overlap windows, managing break-glass exceptions, integrating access advisor, automating credential reports, or migrating permanent keys to STS temporary credentials.\n  activation_triggers: automate IAM key rotation, access key age detection, credential report automation, 90-day key rotation, Lambda rotation flow, overlap window rotation, break-glass exception list, access advisor integration, STS temporary credentials migration, cross-account key sync\n  invocation_schema: 'Input: either (a) a list of IAM users with access key metadata (key ID, creation date, last-used date, status), OR (b) a key rotation automation requirement. Output: deterministic ROTATION block per key — DETECTION\u002FROTATION_FLOW\u002FOVERLAP\u002FNOTIFICATION\u002F EXCEPTIONS\u002FAUDIT\u002FVERDICT.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: IAM access key, key rotation, credential report, get-access-key-last-used, EventBridge scheduled rule, Lambda rotation, access advisor, break-glass exception, overlap window, STS temporary credentials, assume role, cross-account key sync\n  tags: aws-iam, key-rotation, security, access-keys, eventbridge, lambda, automate\n---\n\n# IAM Key Rotation Automator\n\n## Mindset\n\n**One-line takeaway:** every key rotation pipeline is a five-stage\nchain — **detect** (key age via credential report + last-used) →\n**notify** (Slack\u002FSNS pre-rotation warning) → **rotate** (create new,\nverify, update app) → **deactivate** (overlap window, access advisor\nconfirms last-used) → **delete** (old key removed after final\nverification). A gap in ANY stage produces an app outage (key removed\nwhile still in use) or a security exposure (old key never deleted).\n\n- **The rotation flow MUST include an overlap window.** The\n  non-negotiable sequence: create → verify new key → deactivate old →\n  verify app works → delete old. Skipping ANY verification step risks\n  an outage.\n- **Access advisor confirms last-used before deactivation.** Never\n  deactivate a key used in the last 24 hours.\n- **The long-term goal is key elimination.** Migrate permanent keys\n  to STS temporary credentials (assume role). Rotation is a stopgap.\n\n## Quick navigation\n\n| You want to... | Go to |\n|---|---|\n| Detect aged keys | Step 2 |\n| Wire EventBridge schedule | Step 3 |\n| Build Lambda rotation flow | Step 4 |\n| Design overlap window | Step 5 |\n| Send pre-rotation notifications | Step 6 |\n| Handle break-glass exceptions | Step 7 |\n| Sync keys cross-account | Step 8 |\n| Integrate access advisor | Step 9 |\n| Automate credential reports | Step 10 |\n| Migrate to STS | Step 11 |\n| Audit key API calls | Step 12 |\n\n## Critical rules at a glance\n\n1. **The overlap window is non-negotiable.** Create → verify → wait →\n   deactivate → verify → wait → delete. NEVER skip a step or combine\n   create+delete in one operation.\n2. **IAM users can have at most 2 access keys.** The rotation uses\n   the second slot. If both are Active, defer rotation until one frees.\n3. **Access advisor must confirm last-used before deactivation.**\n   `get-access-key-last-used` — if used in the last 24 hours, defer.\n4. **Break-glass accounts must be on the exception list.** Never\n   auto-rotate emergency access — it can lock out incident responders.\n5. **STS temporary credentials are the destination.** The rotation\n   pipeline is a stopgap; the end state is assume-role (no keys).\n\n## Pre-flight: data requirements\n\n| Input | Source | Why |\n|---|---|---|\n| Users + key metadata | `iam list-access-keys` | Rotation targets |\n| Key creation date | `AccessKeyMetadata.CreateDate` | Age |\n| Key last-used | `iam get-access-key-last-used` | Activity check |\n| Credential report | `iam get-credential-report` | Fleet-wide status |\n| Exception list | SSM Parameter \u002F DynamoDB | Break-glass accounts |\n| App config store | Secrets Manager \u002F SSM | Where keys are consumed |\n| CloudTrail trail | `cloudtrail describe-trails` | Audit |\n\n## Process — Rotation pipeline design\n\n### Step 0: Expert knowledge — non-obvious IAM key behaviors\n\n> **Moved verbatim** → [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) § \"Step 0: Expert knowledge\".\n> Load when: designing the pipeline — 2-slot limit, last-used eventual consistency, session survival after deactivation, irreversible delete, 4h-stale reports.\n\n### Step 1: Classify the access key\n\n| Key class | Age | Last used | Action |\n|---|---|---|---|\n| Active, in use | \u003C 90 days | Recent | Schedule at 90 days |\n| Active, in use | >= 90 days | Recent (\u003C 24h) | **Rotate now** (overdue) |\n| Active, unused | >= 90 days | Never \u002F > 90 days ago | **Deactivate** |\n| Inactive, aged | Any | N\u002FA | **Delete** (cleanup) |\n| Break-glass | Any | N\u002FA | **Exception** |\n| Both slots full | Any | Recent | **Defer** |\n\n### Step 2: Key age detection (credential report + last-used)\n\n```bash\n# Generate fresh credential report\naws iam generate-credential-report\naws iam get-credential-report --query 'Content' --output text | base64 -d | column -t -s,\n\n# Per-key detail\naws iam list-access-keys --user-name deployment-user\naws iam get-access-key-last-used --access-key-id AKIAXYZ123\n```\n\n> **Moved verbatim** → [references\u002Fiam-key-rotation-flows.md](references\u002Fiam-key-rotation-flows.md) § \"Step 2 — key age detection (Python)\".\n> Load when: computing per-key age and days-since-used in Python instead of the CLI.\n\n**Risk classification:**\n\n| Risk | Criteria | Action |\n|---|---|---|\n| CRITICAL | Age > 180 days AND active | Immediate rotation |\n| HIGH | Age > 90 days AND active | Rotate within 24 hours |\n| MEDIUM | Age > 90 days AND inactive | Deactivate + investigate |\n| LOW | Age > 90 days AND never used | Delete (stale) |\n| OK | Age \u003C 90 days AND active | No action |\n\n### Step 3: EventBridge scheduled rule for 90-day rotation\n\n```bash\naws events put-rule --name iam-key-rotation-daily \\\n  --schedule-expression \"rate(1 day)\" --state ENABLED\n\naws events put-targets --rule iam-key-rotation-daily \\\n  --targets '[{\"Id\":\"key-rotation-lambda\",\"Arn\":\"arn:aws:lambda:us-east-1:111111111111:function:iam-key-rotation\",\"DeadLetterConfig\":{\"Arn\":\"arn:aws:sqs:us-east-1:111111111111:key-rotation-dlq\"}}]'\n```\n\nThe Lambda scans all users daily, skips exceptions, and queues keys\npast 90 days for rotation with SNS notification.\n\n### Step 4: Lambda rotation flow (create → verify → deactivate → delete)\n\n> **Moved verbatim** → [references\u002Fiam-key-rotation-flows.md](references\u002Fiam-key-rotation-flows.md) § \"Step 4 — Lambda rotation flow code\".\n> Load when: implementing the four-phase rotation Lambda (create, verify, deactivate, delete).\n\n### Step 5: Overlap window design (graceful rotation)\n\nThe period where BOTH keys are active, allowing the app to transition\nwithout downtime.\n\n| Phase | Duration | Action |\n|---|---|---|\n| Create + verify | Day 0 | New key created, stored, verified via STS |\n| App config update | Day 0-1 | App picks up new key from Secrets Manager\u002FSSM |\n| Monitor | Day 1-7 | Both keys active; monitor old key usage |\n| Deactivate | Day 7 | Old key deactivated (if not used in 24h) |\n| Monitor | Day 7-10 | App on new key only; old key Inactive |\n| Delete | Day 10 | Old key deleted |\n\n**Key considerations:** Apps reading keys from env vars need redeploy.\nApps using Secrets Manager can hot-reload. Shorten to 24h for non-prod,\nextend to 14 days for critical production apps.\n\n### Step 6: Pre-rotation notification (Slack\u002FSNS)\n\n| When | Recipient | Message |\n|---|---|---|\n| 7 days before | Owner + Slack | \"Key X for user Y rotates in 7 days\" |\n| 1 day before | Owner + Slack | \"Key X rotates tomorrow\" |\n| Create day | Owner + Slack | \"New key created. App config updated.\" |\n| Deactivate day | Owner + Slack | \"Old key deactivated. Verify app health.\" |\n| Delete day | Owner + Slack | \"Old key deleted. Rotation complete.\" |\n\n```python\ndef notify(user_name, key_id, age, topic_arn):\n    sns.publish(TopicArn=topic_arn,\n        Subject=f'IAM Key Rotation: {user_name}',\n        Message=f'Key {key_id} is {age} days old. Rotation starting.')\n```\n\n### Step 7: Break-glass exception list\n\n```python\ndef is_break_glass(user_name):\n    try:\n        exc = json.loads(ssm.get_parameter(Name='\u002Fiam-key-rotation\u002Fexceptions')['Parameter']['Value'])\n        return user_name in exc\n    except Exception:\n        return False\n```\n\n**Exception list (SSM Parameter Store):**\n\n```json\n{\n  \"break-glass-admin\": {\"reason\": \"Emergency access\", \"owner\": \"security-team\"},\n  \"audit-service\": {\"reason\": \"Read-only audit\", \"owner\": \"compliance\", \"review_date\": \"2026-12-01\"}\n}\n```\n\nEvery exception MUST have a `review_date`. The scan flags past-due\nexceptions for re-evaluation.\n\n### Step 8: Cross-account key sync\n\nWhen an app in Account B uses a key from Account A, rotation runs in\nAccount A but must update Account B:\n\n```python\ndef sync_cross_account(user_name, new_key_id, target_role_arn):\n    assumed = sts.assume_role(RoleArn=target_role_arn, RoleSessionName='key-rotation-sync')\n    target_sm = boto3.client('secretsmanager',\n        aws_access_key_id=assumed['Credentials']['AccessKeyId'],\n        aws_secret_access_key=assumed['Credentials']['SecretAccessKey'],\n        aws_session_token=assumed['Credentials']['SessionToken'])\n    target_sm.put_secret_value(SecretId=f'iam-access-key\u002F{user_name}',\n        SecretString=json.dumps({'access_key_id': new_key_id}))\n```\n\nThe target KMS key must allow the rotation role to decrypt. Better:\nreplace cross-account keys with cross-account role assumption (STS).\n\n### Step 9: Access advisor integration\n\n```bash\naws iam generate-service-last-accessed-details --user-name deployment-user\naws iam get-service-last-accessed-details --job-id \u003Cid> \\\n  --query 'ServicesLastAccessed[].{Service:ServiceName,LastAccessed:LastAuthenticated}'\n```\n\n| Last used | Action |\n|---|---|\n| \u003C 1 hour ago | Defer — actively in use |\n| \u003C 24 hours ago | Defer — wait for 24h inactivity |\n| 1-7 days ago | Proceed with caution — notify owner |\n| > 7 days ago | Safe to deactivate |\n| Never | Safe to deactivate + delete |\n\n### Step 10: Credential report automation\n\n```bash\n# Generate + download weekly\naws events put-rule --name iam-credential-report-weekly \\\n  --schedule-expression \"rate(7 days)\" --state ENABLED\n\naws iam generate-credential-report\naws iam get-credential-report --query 'Content' --output text | base64 -d > report.csv\n```\n\nThe Lambda parses the CSV and identifies: keys > 90 days old, keys\nnever used, users with 2 active keys, inactive keys not deleted.\n\n### Step 11: STS temporary credentials migration\n\nThe permanent fix: eliminate permanent keys via role assumption.\n\n1. Create an IAM role with the same permissions as the user.\n2. Update the app to use `sts:AssumeRole` instead of static keys.\n3. The app receives temporary credentials (15min-12hr TTL, auto-refresh).\n4. Once verified, deactivate and delete the IAM user's access keys.\n\n**By workload type:**\n\n| Workload | Migration path |\n|---|---|\n| EC2\u002FECS\u002FEKS\u002FLambda | Instance\u002Ftask\u002Fpod\u002Fexecution role (no key needed) |\n| On-premises | STS assume role with long-lived user scoped to `sts:AssumeRole` only |\n| Third-party SaaS | IAM role with external trust policy (Web Identity) |\n\n> **Moved verbatim** → [references\u002Fsts-migration-patterns.md](references\u002Fsts-migration-patterns.md) § \"Step 11 — STS migration code\".\n> Load when: converting static-key boto3 clients to STS assume-role with auto-refreshing sessions.\n\n### Step 12: CloudTrail audit\n\n```bash\n# IAM key API calls in last 24h\naws cloudtrail lookup-events \\\n  --lookup-attributes AttributeKey=EventSource,AttributeValue=iam.amazonaws.com \\\n  --start-time $(date -v-1d +%Y-%m-%dT%H:%M:%S) \\\n  --query 'Events[?EventName==`CreateAccessKey`||EventName==`DeleteAccessKey`||EventName==`UpdateAccessKey`].{Time:EventTime,Name:EventName,User:Username}'\n\n# Anomaly: key creation outside rotation pipeline\naws logs put-metric-filter \\\n  --log-group-name CloudTrail\u002FDefaultLogGroup --filter-name iam-key-anomaly \\\n  --filter-pattern '{$.eventSource=\"iam.amazonaws.com\" && $.eventName=\"CreateAccessKey\" && $.userIdentity.sessionContext.sessionIssuer.arn!=\"arn:aws:iam::111111111111:role\u002Fiam-key-rotation-lambda-role\"}' \\\n  --metric-value 1 --metric-namespace SecurityAudit --metric-name KeyCreationAnomaly\n```\n\n## Output format\n\n```text\nROTATION: \u003Creference>\nUSER: \u003Ciam-user-name>\nKEY: \u003Caccess-key-id>\nCLASSIFICATION:\n  - Age: \u003Cdays>\n  - Last used: \u003Cdate or \"never\">\n  - Status: Active | Inactive\n  - Exception: Yes | No\nDETECTION:\n  - Credential report: \u003Cdate>\n  - Access advisor: \u003Clast-used>\n  - EventBridge scan: rate(1 day)\nROTATION_FLOW:\n  - Create: \u003Clambda>\n  - Verify: \u003Csts check>\n  - Deactivate: \u003Coverlap N days>\n  - Delete: \u003Cafter N days>\nOVERLAP:\n  - Window: \u003CN days>\nNOTIFICATION:\n  - SNS: \u003Carn>\n  - Slack: \u003Curl or N\u002FA>\nEXCEPTIONS:\n  - Break-glass list: \u003Cssm parameter>\n  - User excepted: Yes | No\nAUDIT:\n  - CloudTrail: iam.amazonaws.com tracking\n  - Credential report: weekly\nVERDICT: AUTOMATION_DEPLOYED | REVIEW_REQUIRED\nGAP: \u003Cif REVIEW_REQUIRED>\nTEMPLATE: \u003CCLI or YAML>\n```\n\n### Worked example — AUTOMATION_DEPLOYED\n\n```text\nROTATION: prod-key-rotation\nUSER: deployment-user\nKEY: AKIAXYZ123\nCLASSIFICATION:\n  - Age: 91 days\n  - Last used: 2 hours ago (S3, CloudFormation)\n  - Status: Active\n  - Exception: No\nDETECTION:\n  - Credential report: generated today\n  - Access advisor: last used 2 hours ago\n  - EventBridge scan: rate(1 day)\nROTATION_FLOW:\n  - Create: Lambda creates AKIANEW456, stores in Secrets Manager\n  - Verify: Lambda verifies via STS get-caller-identity\n  - Deactivate: Old key after 7-day overlap + 24h inactivity\n  - Delete: Old key 3 days after deactivation\nOVERLAP:\n  - Window: 7 days active + 3 days inactive monitoring\nNOTIFICATION:\n  - SNS topic: arn:aws:sns:us-east-1:111111111111:key-rotation-alerts\n  - Slack webhook: configured\nEXCEPTIONS:\n  - Break-glass list: \u002Fiam-key-rotation\u002Fexceptions\n  - User excepted: No\nAUDIT:\n  - CloudTrail: iam.amazonaws.com tracking\n  - Credential report: weekly generation\nVERDICT: AUTOMATION_DEPLOYED\nGAP: None\nTEMPLATE:\n  aws events put-rule --name iam-key-rotation-daily --schedule-expression \"rate(1 day)\" --state ENABLED\n```\n\n### Worked example — REVIEW_REQUIRED\n\n> **Moved verbatim** → [references\u002Fworked-examples.md](references\u002Fworked-examples.md) § \"Worked example — REVIEW_REQUIRED\".\n> Load when: emitting a REVIEW_REQUIRED verdict for a break-glass exception key.\n\n## Anti-Patterns — NEVER do these\n\n- NEVER deactivate or delete a key without an overlap window. Create →\n  verify → wait → deactivate → verify → wait → delete. Any shortcut\n  risks an outage.\n\n- NEVER rotate without checking `get-access-key-last-used`. A key used\n  in the last 24 hours may still be active. Always defer deactivation\n  until 24 hours of confirmed inactivity.\n\n- NEVER auto-rotate break-glass accounts. Emergency keys must NEVER be\n  touched by automation. Maintain and check the exception list.\n\n- NEVER create a new key when both slots are occupied. IAM allows 2\n  per user. If both Active, defer and analyze manually.\n\n- NEVER store the secret in plaintext or log it. Store immediately in\n  Secrets Manager with KMS encryption. `create-access-key` returns it\n  ONCE.\n\n- NEVER rotate all keys in a batch. Rotate one user at a time, verify,\n  then proceed. A batch failure leaves multiple apps broken.\n\n- NEVER delete immediately after deactivation. Wait 24-72 hours. Apps\n  with cached credentials may still use the deactivated key.\n\n- NEVER omit pre-rotation notifications. Owners must be warned 7 days\n  and 1 day before rotation.\n\n- NEVER use permanent keys for EC2\u002FECS\u002FEKS\u002FLambda. These support IAM\n  roles natively. A permanent key on EC2 is a risk rotation doesn't\n  fix — migrate to instance role.\n\n- NEVER forget to update cross-account consumers. A key in Account A\n  rotated without syncing Account B causes an outage in B.\n\n- NEVER assume the credential report is real-time. It can lag 4 hours.\n  Use `list-access-keys` + `get-access-key-last-used` for live data.\n\n- NEVER omit CloudTrail auditing. `CreateAccessKey`,\n  `UpdateAccessKey`, `DeleteAccessKey` outside the pipeline indicate\n  unauthorized manipulation.\n\n- NEVER set the overlap below 24 hours for production keys. 7 days is\n  the recommended default.\n\n- NEVER leave inactive keys undeleted. Keys > 90 days inactive are a\n  Security Hub finding and a security risk.\n\n## Pre-flight safety checks\n\n- **CONFIRMATION GATE:** `CONFIRM: About to \u003Caction> for key \u003Ckey-id>\n  of user \u003Cuser>. Proceed? (yes\u002Fno)`\n- **Check exception list:** verify user is NOT on the list.\n- **Check key slots:** verify a free slot exists.\n- **Check access advisor:** verify key not used in last 24h.\n- **Back up app config:** save current secret for rollback.\n\n## Appendix A — Key rotation lifecycle matrix\n\n| Key state | Age | Last used | Action | Verdict |\n|---|---|---|---|---|\n| Active | \u003C 90 days | Recent | No action | OK |\n| Active | >= 90 days | Recent (\u003C 24h) | Rotate with overlap | AUTOMATION_DEPLOYED |\n| Active | >= 90 days | > 24h ago | Rotate (faster overlap) | AUTOMATION_DEPLOYED |\n| Active | >= 90 days | Never | Deactivate + investigate | REVIEW_REQUIRED |\n| Active | Any | N\u002FA | Exception list | REVIEW_REQUIRED |\n| Inactive | Any | N\u002FA | Delete after 72h | AUTOMATION_DEPLOYED |\n| Both slots full | Any | Recent | Defer | REVIEW_REQUIRED |\n\nSee **references\u002Fiam-key-rotation-flows.md** for detailed CLI references.\n\n## Appendix B — Decision tree\n\n```\nOn break-glass exception list?\n├─ Yes → REVIEW_REQUIRED (manual review)\n└─ No → Key >= 90 days old?\n        ├─ No → OK\n        └─ Yes → Both slots occupied?\n                ├─ Yes → REVIEW_REQUIRED (free a slot first)\n                └─ No → Used in last 24 hours?\n                        ├─ Yes → Defer 24h, then rotate\n                        └─ No → AUTOMATION_DEPLOYED\n```\n\n## Appendix C — CloudFormation skeleton\n\n> **Moved verbatim** → [references\u002Fworked-examples.md](references\u002Fworked-examples.md) § \"Appendix C — CloudFormation skeleton\".\n> Load when: deploying the rotation pipeline as CloudFormation (SNS, role, Lambda, EventBridge rule, DLQ).\n\n## Recent AWS features (2024-2026)\n\n> **Moved verbatim** → [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) § \"Recent AWS features\".\n> Load when: using Access Analyzer key findings, Security Hub IAM.7 enrichment, session tagging, or the new credential-report columns.\n\n## Expert heuristic: the overlap-window principle\n\n> **Moved verbatim** → [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) § \"Expert heuristic: the overlap-window principle\".\n> Load when: sizing the overlap window or deciding when deactivation\u002Fdeletion is safe; includes why apps break without overlap.\n\n## References (load on demand)\n\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — REVIEW_REQUIRED worked example (break-glass key) and the Appendix C CloudFormation skeleton\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 non-obvious key behaviors, overlap-window principle, recent AWS features\n- [references\u002Fiam-key-rotation-flows.md](references\u002Fiam-key-rotation-flows.md) — full rotation flow patterns; now also holds the Step 2 age-detection code and Step 4 four-phase Lambda code moved from SKILL.md\n- [references\u002Fsts-migration-patterns.md](references\u002Fsts-migration-patterns.md) — migration patterns by workload; now also holds the Step 11 before\u002Fafter STS code moved from SKILL.md\n\n## Domain\n\nAWS CloudOps \u002F Security Automation — IAM credential lifecycle.\n\n## AWS documentation\n\n- **IAM Access Keys** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_access-keys.html\n- **IAM Credential Reports** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_getting-report.html\n- **IAM Access Advisor** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Faccess_policies_access-advisor.html\n- **STS Temporary Credentials** — https:\u002F\u002Fdocs.aws.amazon.com\u002FSTS\u002Flatest\u002FAPIReference\u002Fwelcome.html\n- **Security Hub IAM Checks** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsecurityhub\u002Flatest\u002Fuserguide\u002Fsecurityhub-standards-fsbp-controls.html\n","# IAM Key Rotation Automator\n\n## Mindset\n\n**One-line takeaway:** every key rotation pipeline is a five-stage\nchain — **detect** (key age via credential report + last-used) →\n**notify** (Slack\u002FSNS pre-rotation warning) → **rotate** (create new,\nverify, update app) → **deactivate** (overlap window, access advisor\nconfirms last-used) → **delete** (old key removed after final\nverification). A gap in ANY stage produces an app outage (key removed\nwhile still in use) or a security exposure (old key never deleted).\n\n- **The rotation flow MUST include an overlap window.** The\n  non-negotiable sequence: create → verify new key → deactivate old →\n  verify app works → delete old. Skipping ANY verification step risks\n  an outage.\n- **Access advisor confirms last-used before deactivation.** Never\n  deactivate a key used in the last 24 hours.\n- **The long-term goal is key elimination.** Migrate permanent keys\n  to STS temporary credentials (assume role). Rotation is a stopgap.\n\n## Quick navigation\n\n| You want to... | Go to |\n|---|---|\n| Detect aged keys | Step 2 |\n| Wire EventBridge schedule | Step 3 |\n| Build Lambda rotation flow | Step 4 |\n| Design overlap window | Step 5 |\n| Send pre-rotation notifications | Step 6 |\n| Handle break-glass exceptions | Step 7 |\n| Sync keys cross-account | Step 8 |\n| Integrate access advisor | Step 9 |\n| Automate credential reports | Step 10 |\n| Migrate to STS | Step 11 |\n| Audit key API calls | Step 12 |\n\n## Critical rules at a glance\n\n1. **The overlap window is non-negotiable.** Create → verify → wait →\n   deactivate → verify → wait → delete. NEVER skip a step or combine\n   create+delete in one operation.\n2. **IAM users can have at most 2 access keys.** The rotation uses\n   the second slot. If both are Active, defer rotation until one frees.\n3. **Access advisor must confirm last-used before deactivation.**\n   `get-access-key-last-used` — if used in the last 24 hours, defer.\n4. **Break-glass accounts must be on the exception list.** Never\n   auto-rotate emergency access — it can lock out incident responders.\n5. **STS temporary credentials are the destination.** The rotation\n   pipeline is a stopgap; the end state is assume-role (no keys).\n\n## Pre-flight: data requirements\n\n| Input | Source | Why |\n|---|---|---|\n| Users + key metadata | `iam list-access-keys` | Rotation targets |\n| Key creation date | `AccessKeyMetadata.CreateDate` | Age |\n| Key last-used | `iam get-access-key-last-used` | Activity check |\n| Credential report | `iam get-credential-report` | Fleet-wide status |\n| Exception list | SSM Parameter \u002F DynamoDB | Break-glass accounts |\n| App config store | Secrets Manager \u002F SSM | Where keys are consumed |\n| CloudTrail trail | `cloudtrail describe-trails` | Audit |\n\n## Process — Rotation pipeline design\n\n### Step 0: Expert knowledge — non-obvious IAM key behaviors\n\n> **Moved verbatim** → [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) § \"Step 0: Expert knowledge\".\n> Load when: designing the pipeline — 2-slot limit, last-used eventual consistency, session survival after deactivation, irreversible delete, 4h-stale reports.\n\n### Step 1: Classify the access key\n\n| Key class | Age | Last used | Action |\n|---|---|---|---|\n| Active, in use | \u003C 90 days | Recent | Schedule at 90 days |\n| Active, in use | >= 90 days | Recent (\u003C 24h) | **Rotate now** (overdue) |\n| Active, unused | >= 90 days | Never \u002F > 90 days ago | **Deactivate** |\n| Inactive, aged | Any | N\u002FA | **Delete** (cleanup) |\n| Break-glass | Any | N\u002FA | **Exception** |\n| Both slots full | Any | Recent | **Defer** |\n\n### Step 2: Key age detection (credential report + last-used)\n\n```bash\n# Generate fresh credential report\naws iam generate-credential-report\naws iam get-credential-report --query 'Content' --output text | base64 -d | column -t -s,\n\n# Per-key detail\naws iam list-access-keys --user-name deployment-user\naws iam get-access-key-last-used --access-key-id AKIAXYZ123\n```\n\n> **Moved verbatim** → [references\u002Fiam-key-rotation-flows.md](references\u002Fiam-key-rotation-flows.md) § \"Step 2 — key age detection (Python)\".\n> Load when: computing per-key age and days-since-used in Python instead of the CLI.\n\n**Risk classification:**\n\n| Risk | Criteria | Action |\n|---|---|---|\n| CRITICAL | Age > 180 days AND active | Immediate rotation |\n| HIGH | Age > 90 days AND active | Rotate within 24 hours |\n| MEDIUM | Age > 90 days AND inactive | Deactivate + investigate |\n| LOW | Age > 90 days AND never used | Delete (stale) |\n| OK | Age \u003C 90 days AND active | No action |\n\n### Step 3: EventBridge scheduled rule for 90-day rotation\n\n```bash\naws events put-rule --name iam-key-rotation-daily \\\n  --schedule-expression \"rate(1 day)\" --state ENABLED\n\naws events put-targets --rule iam-key-rotation-daily \\\n  --targets '[{\"Id\":\"key-rotation-lambda\",\"Arn\":\"arn:aws:lambda:us-east-1:111111111111:function:iam-key-rotation\",\"DeadLetterConfig\":{\"Arn\":\"arn:aws:sqs:us-east-1:111111111111:key-rotation-dlq\"}}]'\n```\n\nThe Lambda scans all users daily, skips exceptions, and queues keys\npast 90 days for rotation with SNS notification.\n\n### Step 4: Lambda rotation flow (create → verify → deactivate → delete)\n\n> **Moved verbatim** → [references\u002Fiam-key-rotation-flows.md](references\u002Fiam-key-rotation-flows.md) § \"Step 4 — Lambda rotation flow code\".\n> Load when: implementing the four-phase rotation Lambda (create, verify, deactivate, delete).\n\n### Step 5: Overlap window design (graceful rotation)\n\nThe period where BOTH keys are active, allowing the app to transition\nwithout downtime.\n\n| Phase | Duration | Action |\n|---|---|---|\n| Create + verify | Day 0 | New key created, stored, verified via STS |\n| App config update | Day 0-1 | App picks up new key from Secrets Manager\u002FSSM |\n| Monitor | Day 1-7 | Both keys active; monitor old key usage |\n| Deactivate | Day 7 | Old key deactivated (if not used in 24h) |\n| Monitor | Day 7-10 | App on new key only; old key Inactive |\n| Delete | Day 10 | Old key deleted |\n\n**Key considerations:** Apps reading keys from env vars need redeploy.\nApps using Secrets Manager can hot-reload. Shorten to 24h for non-prod,\nextend to 14 days for critical production apps.\n\n### Step 6: Pre-rotation notification (Slack\u002FSNS)\n\n| When | Recipient | Message |\n|---|---|---|\n| 7 days before | Owner + Slack | \"Key X for user Y rotates in 7 days\" |\n| 1 day before | Owner + Slack | \"Key X rotates tomorrow\" |\n| Create day | Owner + Slack | \"New key created. App config updated.\" |\n| Deactivate day | Owner + Slack | \"Old key deactivated. Verify app health.\" |\n| Delete day | Owner + Slack | \"Old key deleted. Rotation complete.\" |\n\n```python\ndef notify(user_name, key_id, age, topic_arn):\n    sns.publish(TopicArn=topic_arn,\n        Subject=f'IAM Key Rotation: {user_name}',\n        Message=f'Key {key_id} is {age} days old. Rotation starting.')\n```\n\n### Step 7: Break-glass exception list\n\n```python\ndef is_break_glass(user_name):\n    try:\n        exc = json.loads(ssm.get_parameter(Name='\u002Fiam-key-rotation\u002Fexceptions')['Parameter']['Value'])\n        return user_name in exc\n    except Exception:\n        return False\n```\n\n**Exception list (SSM Parameter Store):**\n\n```json\n{\n  \"break-glass-admin\": {\"reason\": \"Emergency access\", \"owner\": \"security-team\"},\n  \"audit-service\": {\"reason\": \"Read-only audit\", \"owner\": \"compliance\", \"review_date\": \"2026-12-01\"}\n}\n```\n\nEvery exception MUST have a `review_date`. The scan flags past-due\nexceptions for re-evaluation.\n\n### Step 8: Cross-account key sync\n\nWhen an app in Account B uses a key from Account A, rotation runs in\nAccount A but must update Account B:\n\n```python\ndef sync_cross_account(user_name, new_key_id, target_role_arn):\n    assumed = sts.assume_role(RoleArn=target_role_arn, RoleSessionName='key-rotation-sync')\n    target_sm = boto3.client('secretsmanager',\n        aws_access_key_id=assumed['Credentials']['AccessKeyId'],\n        aws_secret_access_key=assumed['Credentials']['SecretAccessKey'],\n        aws_session_token=assumed['Credentials']['SessionToken'])\n    target_sm.put_secret_value(SecretId=f'iam-access-key\u002F{user_name}',\n        SecretString=json.dumps({'access_key_id': new_key_id}))\n```\n\nThe target KMS key must allow the rotation role to decrypt. Better:\nreplace cross-account keys with cross-account role assumption (STS).\n\n### Step 9: Access advisor integration\n\n```bash\naws iam generate-service-last-accessed-details --user-name deployment-user\naws iam get-service-last-accessed-details --job-id \u003Cid> \\\n  --query 'ServicesLastAccessed[].{Service:ServiceName,LastAccessed:LastAuthenticated}'\n```\n\n| Last used | Action |\n|---|---|\n| \u003C 1 hour ago | Defer — actively in use |\n| \u003C 24 hours ago | Defer — wait for 24h inactivity |\n| 1-7 days ago | Proceed with caution — notify owner |\n| > 7 days ago | Safe to deactivate |\n| Never | Safe to deactivate + delete |\n\n### Step 10: Credential report automation\n\n```bash\n# Generate + download weekly\naws events put-rule --name iam-credential-report-weekly \\\n  --schedule-expression \"rate(7 days)\" --state ENABLED\n\naws iam generate-credential-report\naws iam get-credential-report --query 'Content' --output text | base64 -d > report.csv\n```\n\nThe Lambda parses the CSV and identifies: keys > 90 days old, keys\nnever used, users with 2 active keys, inactive keys not deleted.\n\n### Step 11: STS temporary credentials migration\n\nThe permanent fix: eliminate permanent keys via role assumption.\n\n1. Create an IAM role with the same permissions as the user.\n2. Update the app to use `sts:AssumeRole` instead of static keys.\n3. The app receives temporary credentials (15min-12hr TTL, auto-refresh).\n4. Once verified, deactivate and delete the IAM user's access keys.\n\n**By workload type:**\n\n| Workload | Migration path |\n|---|---|\n| EC2\u002FECS\u002FEKS\u002FLambda | Instance\u002Ftask\u002Fpod\u002Fexecution role (no key needed) |\n| On-premises | STS assume role with long-lived user scoped to `sts:AssumeRole` only |\n| Third-party SaaS | IAM role with external trust policy (Web Identity) |\n\n> **Moved verbatim** → [references\u002Fsts-migration-patterns.md](references\u002Fsts-migration-patterns.md) § \"Step 11 — STS migration code\".\n> Load when: converting static-key boto3 clients to STS assume-role with auto-refreshing sessions.\n\n### Step 12: CloudTrail audit\n\n```bash\n# IAM key API calls in last 24h\naws cloudtrail lookup-events \\\n  --lookup-attributes AttributeKey=EventSource,AttributeValue=iam.amazonaws.com \\\n  --start-time $(date -v-1d +%Y-%m-%dT%H:%M:%S) \\\n  --query 'Events[?EventName==`CreateAccessKey`||EventName==`DeleteAccessKey`||EventName==`UpdateAccessKey`].{Time:EventTime,Name:EventName,User:Username}'\n\n# Anomaly: key creation outside rotation pipeline\naws logs put-metric-filter \\\n  --log-group-name CloudTrail\u002FDefaultLogGroup --filter-name iam-key-anomaly \\\n  --filter-pattern '{$.eventSource=\"iam.amazonaws.com\" && $.eventName=\"CreateAccessKey\" && $.userIdentity.sessionContext.sessionIssuer.arn!=\"arn:aws:iam::111111111111:role\u002Fiam-key-rotation-lambda-role\"}' \\\n  --metric-value 1 --metric-namespace SecurityAudit --metric-name KeyCreationAnomaly\n```\n\n## Output format\n\n```text\nROTATION: \u003Creference>\nUSER: \u003Ciam-user-name>\nKEY: \u003Caccess-key-id>\nCLASSIFICATION:\n  - Age: \u003Cdays>\n  - Last used: \u003Cdate or \"never\">\n  - Status: Active | Inactive\n  - Exception: Yes | No\nDETECTION:\n  - Credential report: \u003Cdate>\n  - Access advisor: \u003Clast-used>\n  - EventBridge scan: rate(1 day)\nROTATION_FLOW:\n  - Create: \u003Clambda>\n  - Verify: \u003Csts check>\n  - Deactivate: \u003Coverlap N days>\n  - Delete: \u003Cafter N days>\nOVERLAP:\n  - Window: \u003CN days>\nNOTIFICATION:\n  - SNS: \u003Carn>\n  - Slack: \u003Curl or N\u002FA>\nEXCEPTIONS:\n  - Break-glass list: \u003Cssm parameter>\n  - User excepted: Yes | No\nAUDIT:\n  - CloudTrail: iam.amazonaws.com tracking\n  - Credential report: weekly\nVERDICT: AUTOMATION_DEPLOYED | REVIEW_REQUIRED\nGAP: \u003Cif REVIEW_REQUIRED>\nTEMPLATE: \u003CCLI or YAML>\n```\n\n### Worked example — AUTOMATION_DEPLOYED\n\n```text\nROTATION: prod-key-rotation\nUSER: deployment-user\nKEY: AKIAXYZ123\nCLASSIFICATION:\n  - Age: 91 days\n  - Last used: 2 hours ago (S3, CloudFormation)\n  - Status: Active\n  - Exception: No\nDETECTION:\n  - Credential report: generated today\n  - Access advisor: last used 2 hours ago\n  - EventBridge scan: rate(1 day)\nROTATION_FLOW:\n  - Create: Lambda creates AKIANEW456, stores in Secrets Manager\n  - Verify: Lambda verifies via STS get-caller-identity\n  - Deactivate: Old key after 7-day overlap + 24h inactivity\n  - Delete: Old key 3 days after deactivation\nOVERLAP:\n  - Window: 7 days active + 3 days inactive monitoring\nNOTIFICATION:\n  - SNS topic: arn:aws:sns:us-east-1:111111111111:key-rotation-alerts\n  - Slack webhook: configured\nEXCEPTIONS:\n  - Break-glass list: \u002Fiam-key-rotation\u002Fexceptions\n  - User excepted: No\nAUDIT:\n  - CloudTrail: iam.amazonaws.com tracking\n  - Credential report: weekly generation\nVERDICT: AUTOMATION_DEPLOYED\nGAP: None\nTEMPLATE:\n  aws events put-rule --name iam-key-rotation-daily --schedule-expression \"rate(1 day)\" --state ENABLED\n```\n\n### Worked example — REVIEW_REQUIRED\n\n> **Moved verbatim** → [references\u002Fworked-examples.md](references\u002Fworked-examples.md) § \"Worked example — REVIEW_REQUIRED\".\n> Load when: emitting a REVIEW_REQUIRED verdict for a break-glass exception key.\n\n## Anti-Patterns — NEVER do these\n\n- NEVER deactivate or delete a key without an overlap window. Create →\n  verify → wait → deactivate → verify → wait → delete. Any shortcut\n  risks an outage.\n\n- NEVER rotate without checking `get-access-key-last-used`. A key used\n  in the last 24 hours may still be active. Always defer deactivation\n  until 24 hours of confirmed inactivity.\n\n- NEVER auto-rotate break-glass accounts. Emergency keys must NEVER be\n  touched by automation. Maintain and check the exception list.\n\n- NEVER create a new key when both slots are occupied. IAM allows 2\n  per user. If both Active, defer and analyze manually.\n\n- NEVER store the secret in plaintext or log it. Store immediately in\n  Secrets Manager with KMS encryption. `create-access-key` returns it\n  ONCE.\n\n- NEVER rotate all keys in a batch. Rotate one user at a time, verify,\n  then proceed. A batch failure leaves multiple apps broken.\n\n- NEVER delete immediately after deactivation. Wait 24-72 hours. Apps\n  with cached credentials may still use the deactivated key.\n\n- NEVER omit pre-rotation notifications. Owners must be warned 7 days\n  and 1 day before rotation.\n\n- NEVER use permanent keys for EC2\u002FECS\u002FEKS\u002FLambda. These support IAM\n  roles natively. A permanent key on EC2 is a risk rotation doesn't\n  fix — migrate to instance role.\n\n- NEVER forget to update cross-account consumers. A key in Account A\n  rotated without syncing Account B causes an outage in B.\n\n- NEVER assume the credential report is real-time. It can lag 4 hours.\n  Use `list-access-keys` + `get-access-key-last-used` for live data.\n\n- NEVER omit CloudTrail auditing. `CreateAccessKey`,\n  `UpdateAccessKey`, `DeleteAccessKey` outside the pipeline indicate\n  unauthorized manipulation.\n\n- NEVER set the overlap below 24 hours for production keys. 7 days is\n  the recommended default.\n\n- NEVER leave inactive keys undeleted. Keys > 90 days inactive are a\n  Security Hub finding and a security risk.\n\n## Pre-flight safety checks\n\n- **CONFIRMATION GATE:** `CONFIRM: About to \u003Caction> for key \u003Ckey-id>\n  of user \u003Cuser>. Proceed? (yes\u002Fno)`\n- **Check exception list:** verify user is NOT on the list.\n- **Check key slots:** verify a free slot exists.\n- **Check access advisor:** verify key not used in last 24h.\n- **Back up app config:** save current secret for rollback.\n\n## Appendix A — Key rotation lifecycle matrix\n\n| Key state | Age | Last used | Action | Verdict |\n|---|---|---|---|---|\n| Active | \u003C 90 days | Recent | No action | OK |\n| Active | >= 90 days | Recent (\u003C 24h) | Rotate with overlap | AUTOMATION_DEPLOYED |\n| Active | >= 90 days | > 24h ago | Rotate (faster overlap) | AUTOMATION_DEPLOYED |\n| Active | >= 90 days | Never | Deactivate + investigate | REVIEW_REQUIRED |\n| Active | Any | N\u002FA | Exception list | REVIEW_REQUIRED |\n| Inactive | Any | N\u002FA | Delete after 72h | AUTOMATION_DEPLOYED |\n| Both slots full | Any | Recent | Defer | REVIEW_REQUIRED |\n\nSee **references\u002Fiam-key-rotation-flows.md** for detailed CLI references.\n\n## Appendix B — Decision tree\n\n```\nOn break-glass exception list?\n├─ Yes → REVIEW_REQUIRED (manual review)\n└─ No → Key >= 90 days old?\n        ├─ No → OK\n        └─ Yes → Both slots occupied?\n                ├─ Yes → REVIEW_REQUIRED (free a slot first)\n                └─ No → Used in last 24 hours?\n                        ├─ Yes → Defer 24h, then rotate\n                        └─ No → AUTOMATION_DEPLOYED\n```\n\n## Appendix C — CloudFormation skeleton\n\n> **Moved verbatim** → [references\u002Fworked-examples.md](references\u002Fworked-examples.md) § \"Appendix C — CloudFormation skeleton\".\n> Load when: deploying the rotation pipeline as CloudFormation (SNS, role, Lambda, EventBridge rule, DLQ).\n\n## Recent AWS features (2024-2026)\n\n> **Moved verbatim** → [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) § \"Recent AWS features\".\n> Load when: using Access Analyzer key findings, Security Hub IAM.7 enrichment, session tagging, or the new credential-report columns.\n\n## Expert heuristic: the overlap-window principle\n\n> **Moved verbatim** → [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) § \"Expert heuristic: the overlap-window principle\".\n> Load when: sizing the overlap window or deciding when deactivation\u002Fdeletion is safe; includes why apps break without overlap.\n\n## References (load on demand)\n\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — REVIEW_REQUIRED worked example (break-glass key) and the Appendix C CloudFormation skeleton\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 non-obvious key behaviors, overlap-window principle, recent AWS features\n- [references\u002Fiam-key-rotation-flows.md](references\u002Fiam-key-rotation-flows.md) — full rotation flow patterns; now also holds the Step 2 age-detection code and Step 4 four-phase Lambda code moved from SKILL.md\n- [references\u002Fsts-migration-patterns.md](references\u002Fsts-migration-patterns.md) — migration patterns by workload; now also holds the Step 11 before\u002Fafter STS code moved from SKILL.md\n\n## Domain\n\nAWS CloudOps \u002F Security Automation — IAM credential lifecycle.\n\n## AWS documentation\n\n- **IAM Access Keys** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_access-keys.html\n- **IAM Credential Reports** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fid_credentials_getting-report.html\n- **IAM Access Advisor** — https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Faccess_policies_access-advisor.html\n- **STS Temporary Credentials** — https:\u002F\u002Fdocs.aws.amazon.com\u002FSTS\u002Flatest\u002FAPIReference\u002Fwelcome.html\n- **Security Hub IAM Checks** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsecurityhub\u002Flatest\u002Fuserguide\u002Fsecurityhub-standards-fsbp-controls.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":41},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"skill_class":34,"when_to_use":35,"requires_llm":36,"verdict_shape":37,"lifecycle_status":38,"invocation_schema":39,"supports_pipeline":36,"activation_triggers":40},"aws-iam, key-rotation, security, access-keys, eventbridge, lambda, automate","4","Jacky Chan — AWS Community Builder","aws-cloudops","Security","0.1.0","IAM access key, key rotation, credential report, get-access-key-last-used, EventBridge scheduled rule, Lambda rotation, access advisor, break-glass exception, overlap window, STS temporary credentials, assume role, cross-account key sync","automate","high","capability","Building IAM access key rotation automation, wiring EventBridge schedules for key rotation, deploying Lambda rotation flows with overlap windows, managing break-glass exceptions, integrating access advisor, automating credential reports, or migrating permanent keys to STS temporary credentials.","true","AUTOMATION_DEPLOYED | REVIEW_REQUIRED","active","Input: either (a) a list of IAM users with access key metadata (key ID, creation date, last-used date, status), OR (b) a key rotation automation requirement. Output: deterministic ROTATION block per key — DETECTION\u002FROTATION_FLOW\u002FOVERLAP\u002FNOTIFICATION\u002F EXCEPTIONS\u002FAUDIT\u002FVERDICT.","automate IAM key rotation, access key age detection, credential report automation, 90-day key rotation, Lambda rotation flow, overlap window rotation, break-glass exception list, access advisor integration, STS temporary credentials migration, cross-account key sync","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline workflow design. Live deployment uses aws iam list-access-keys, create-access-key, update-access-key, delete-access-key, get-access-key-last-used, generate-credential-report, aws events put-rule\u002Fput-targets, aws lambda create-function, aws sns publish, aws sts get-caller-identity.","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fiam-key-rotation-automator",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill iam-key-rotation-automator",{"tool":56,"command":57},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill iam-key-rotation-automator",{"tool":59,"command":60},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill iam-key-rotation-automator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002FSKILL.md",true,[64,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",6342,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Feval\u002Ftest-cases.yaml",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"evals\u002Fbaselines\u002Fbreak-glass-exception.md",526,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fbaselines\u002Fbreak-glass-exception.md",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"evals\u002Fbaselines\u002Fcross-account-key-sync.md",608,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fbaselines\u002Fcross-account-key-sync.md",{"path":79,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":80,"sourceHtmlUrl":81},"evals\u002Fbaselines\u002Foverlap-window-rotation.md",611,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fbaselines\u002Foverlap-window-rotation.md",{"path":83,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":84,"sourceHtmlUrl":85},"evals\u002Fbaselines\u002Fstandard-90-day-rotation.md",744,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fbaselines\u002Fstandard-90-day-rotation.md",{"path":87,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":88,"sourceHtmlUrl":89},"evals\u002Fbaselines\u002Fsts-migration-required.md",512,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fbaselines\u002Fsts-migration-required.md",{"path":91,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":92,"sourceHtmlUrl":93},"evals\u002Feval_config.yaml",1725,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Feval_config.yaml",{"path":95,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":96,"sourceHtmlUrl":97},"evals\u002Fevals.json",4214,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fevals.json",{"path":99,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":100,"sourceHtmlUrl":101},"evals\u002Fprompts\u002Fbreak-glass-exception.md",707,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fprompts\u002Fbreak-glass-exception.md",{"path":103,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":104,"sourceHtmlUrl":105},"evals\u002Fprompts\u002Fcross-account-key-sync.md",805,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fprompts\u002Fcross-account-key-sync.md",{"path":107,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":108,"sourceHtmlUrl":109},"evals\u002Fprompts\u002Foverlap-window-rotation.md",728,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fprompts\u002Foverlap-window-rotation.md",{"path":111,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":112,"sourceHtmlUrl":113},"evals\u002Fprompts\u002Fstandard-90-day-rotation.md",633,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fprompts\u002Fstandard-90-day-rotation.md",{"path":115,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":116,"sourceHtmlUrl":117},"evals\u002Fprompts\u002Fsts-migration-required.md",789,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fevals\u002Fprompts\u002Fsts-migration-required.md",{"path":119,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":120,"sourceHtmlUrl":121},"examples\u002Fend-to-end.md",7717,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fexamples\u002Fend-to-end.md",{"path":123,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":124,"sourceHtmlUrl":125},"references\u002Fadvanced-patterns.md",3294,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Freferences\u002Fadvanced-patterns.md",{"path":127,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":128,"sourceHtmlUrl":129},"references\u002Fiam-key-rotation-flows.md",9841,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Freferences\u002Fiam-key-rotation-flows.md",{"path":131,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":132,"sourceHtmlUrl":133},"references\u002Fsts-migration-patterns.md",9211,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Freferences\u002Fsts-migration-patterns.md",{"path":135,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":136,"sourceHtmlUrl":137},"references\u002Fworked-examples.md",4233,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Freferences\u002Fworked-examples.md",{"path":139,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":140,"sourceHtmlUrl":141},"skill.usf.yaml",4414,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fiam-key-rotation-automator\u002Fskill.usf.yaml",[143,150,157,164,171,178],{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]