[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A509ACZXKNNX3TDNMP8JHJ":3,"skill-same:01M7A509ACZXKNNX3TDNMP8JHJ":147},{"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":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M7A509ACZXKNNX3TDNMP8JHJ","cloudtrail-alert-automator",null,"Designs and deploys CloudTrail alerting automation across an AWS estate. Builds EventBridge rules for security-critical API calls (root console login, IAM policy changes, security group modifications, CloudTrail disabling), wires SNS topic routing by severity, deploys Lambda enrichment functions that use lookup-events to attach actor context, source IP correlation, and recent activity. Integrates with Security Hub via BatchImportFindings, delivers to Slack\u002FTeams via webhook, implements deduplication by event identity, and suppresses known CI\u002FCD service-role alerts. Supports multi-account via Organizations trail and CloudTrail Insights anomaly alerting. Emits AUTOMATION_DEPLOYED with deployable IaC 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\u002Fcloudtrail-alert-automator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloudtrail-alert-automator\ndescription: Designs and deploys CloudTrail alerting automation across an AWS estate. Builds EventBridge rules for security-critical API calls (root console login, IAM policy changes, security group modifications, CloudTrail disabling), wires SNS topic routing by severity, deploys Lambda enrichment functions that use lookup-events to attach actor context, source IP correlation, and recent activity. Integrates with Security Hub via BatchImportFindings, delivers to Slack\u002FTeams via webhook, implements deduplication by event identity, and suppresses known CI\u002FCD service-role alerts. Supports multi-account via Organizations trail and CloudTrail Insights anomaly alerting. Emits AUTOMATION_DEPLOYED with deployable IaC 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 alert-design. Live deployment uses aws events put-rule, put-targets, aws sns create-topic, subscribe, aws lambda create-function, aws securityhub batch-import-findings, and aws cloudtrail lookup-events, create-event-data-store, start-query — AWS CLI v2, SSO or key-based credentials.\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '4'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Governance\n  task_type: automate\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: AUTOMATION_DEPLOYED | REVIEW_REQUIRED\n  when_to_use: Designing CloudTrail alerting automation, wiring EventBridge rules for security-critical API calls, building Lambda enrichment with lookup-events context, integrating CloudTrail alerts with Security Hub custom findings, routing alerts to Slack or Teams, suppressing known CI\u002FCD automation noise, or deploying multi-account CloudTrail alerting via an Organizations trail.\n  activation_triggers: automate CloudTrail alerts, EventBridge rule for root login, IAM change alert, security group change notification, CloudTrail SNS alert, Security Hub custom finding from CloudTrail, CloudTrail Lake query, Slack webhook CloudTrail, alert deduplication, suppress CI\u002FCD service role alerts, CloudTrail Insights anomaly, Organizations trail alerting\n  invocation_schema: 'Input: either (a) a set of CloudTrail event names or categories to alert on plus the desired notification targets (SNS, Security Hub, Slack, Teams), OR (b) an existing alerting setup to audit. Output: deterministic ALERT block per rule — RULE\u002FENRICHMENT\u002FROUTING\u002FDEDUP\u002F SUPPRESSION\u002FVERDICT — where VERDICT is AUTOMATION_DEPLOYED or REVIEW_REQUIRED.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: AWS CloudTrail, EventBridge, SNS alerting, Security Hub, lookup-events, CloudTrail Lake, CloudTrail Insights, root login alert, IAM change alert, security group change, Slack webhook, alert deduplication, alert suppression, Organizations trail, governance automation\n  tags: aws-cloudtrail, eventbridge, sns, security-hub, lambda, governance, automate\n---\n\n# CloudTrail Alert Automator\n\n## Mindset\n\n**One-line takeaway:** every CloudTrail alert is a four-stage pipeline —\n**detect** (EventBridge rule matching a CloudTrail API event) →\n**enrich** (Lambda lookup-events for actor context, source IP, prior\ncorrelation) → **route** (SNS topic by severity, Security Hub finding,\nSlack\u002FTeams webhook) → **deduplicate + suppress** (window-based dedup,\nservice-role suppression list). A gap in ANY stage produces alert\nfatigue or missed critical events.\n\n- **Detection** without **enrichment** is a raw event dump: \"ConsoleLogin\n  by root\" tells you nothing about whether it was a legitimate break-glass\n  or a compromise. Enrichment with `lookup-events` for the surrounding 15\n  minutes adds the actor's recent API activity and the source IP context.\n- **Routing** without **severity tiering** means every alert pages the\n  on-call equally. Root login is CRITICAL; an IAM user self-rotating their\n  access key is LOW. Severity is derived from event name, actor type, and\n  resource impact.\n- **Deduplication + suppression** is the difference between a useful alert\n  and a noisy one. A CI\u002FCD pipeline calling `UpdateStack` 200 times in a\n  deploy window produces 200 identical alerts without dedup.\n\n## Quick navigation\n\n| You want to... | Go to |\n|---|---|\n| Pick the right EventBridge event pattern | Step 1 + Appendix A |\n| Decide severity tier | Step 2 (severity matrix) |\n| Build Lambda enrichment with lookup-events | Step 3 |\n| Wire SNS routing by severity | Step 4 |\n| Send to Slack or Teams webhook | Step 5 |\n| Integrate with Security Hub custom findings | Step 6 |\n| Implement deduplication logic | Step 7 |\n| Suppress known CI\u002FCD automation | Step 8 |\n| Deploy multi-account via Organizations trail | Step 9 |\n| Use CloudTrail Lake for historical queries | Step 10 |\n| Enable CloudTrail Insights anomaly alerting | Step 11 |\n| Avoid common alerting pitfalls | Anti-Patterns |\n| Recent features (Insights, Lake) | Recent AWS features |\n\n## Critical rules at a glance (do NOT bury these)\n\n1. **EventBridge `detail.eventName` matching is case-sensitive and\n   exact.** List every variant explicitly. A common miss: alerting on\n   `DeleteSecurityGroup` but not `RevokeSecurityGroupIngress` — the\n   revoke is the more dangerous operation and goes undetected.\n2. **`lookup-events` has a 15-minute lookback ceiling per call.** For\n   enrichment beyond 15 minutes, use CloudTrail Lake queries. A single\n   `lookup-events` with no `StartTime` returns only the last 15 minutes.\n3. **SNS message size cap is 256 KB.** Enriched events can exceed this.\n   Always truncate. A `MessageAttributes` overflow produces a silent SNS\n   publish failure logged only in Lambda's CloudWatch Logs.\n4. **Security Hub `BatchImportFindings` deduplicates by `Id`.** Use a\n   deterministic `Id` (`\u003CaccountId>-\u003CeventName>-\u003CeventTime>-\u003CresourceId>`)\n   to avoid orphaned findings. Re-importing with the same `Id` updates.\n5. **CloudTrail event delivery latency is 3–15 minutes.** Deduplication\n   windows must account for arrival-time delta, not event-time delta.\n   Two events 2 minutes apart by `eventTime` may arrive 8 minutes apart\n   in EventBridge.\n\n## Pre-flight: data requirements\n\n| Input | Source | Why |\n|---|---|---|\n| CloudTrail status | `cloudtrail describe-trails` | Events must exist for alerting |\n| Event data store (if Lake in scope) | `cloudtrail list-event-data-stores` | Historical query capability |\n| Existing EventBridge rules | `events list-rules` | Avoid duplicate rules |\n| SNS topics | `sns list-topics` | Reuse or create new |\n| Security Hub enabled status | `securityhub describe-hub` | Whether findings can be imported |\n| Slack\u002FTeams webhook URLs | Secrets Manager \u002F Parameter Store | Notification delivery |\n| Known service roles for suppression | IAM role inventory | CI\u002FCD, auto-scaling, automation roles |\n| CloudTrail Insights status | `cloudtrail get-insight-selectors` | Anomaly alerting availability |\n\n**If the input is malformed** (no CloudTrail enabled, no event list), emit:\n\n```text\nALERT: \u003Creference>\nEVENT: \u003Cevent-name>\nVERDICT: ERROR\nREASON: Cannot design alerting — CloudTrail status and target event list required.\nGAP: Enable CloudTrail and supply the event names to alert on.\n```\n\n## Process — Alert pipeline design (apply in order)\n\n### Step 0: Expert knowledge — non-obvious behaviors\n\nFull catalog: [Advanced patterns](references\u002Fadvanced-patterns.md) — data events, root identity, ConsoleLogin failures, org-trail routing, throttling, rate limits.\n\n### Step 1: Build the EventBridge event pattern\n\n**Root console login (CRITICAL):**\n\n```json\n{\n  \"source\": [\"aws.signin\"],\n  \"detail-type\": [\"AWS API Call via CloudTrail\"],\n  \"detail\": {\n    \"userIdentity\": {\"type\": [\"Root\"]},\n    \"eventName\": [\"ConsoleLogin\"],\n    \"responseElements\": {\"ConsoleLogin\": [\"Success\"]}\n  }\n}\n```\n\n**Security-critical IAM changes (HIGH):**\n\n```json\n{\n  \"source\": [\"aws.iam\"],\n  \"detail\": {\"eventName\": [\n    \"AttachRolePolicy\", \"DetachRolePolicy\", \"PutRolePolicy\",\n    \"DeleteRolePolicy\", \"CreatePolicyVersion\", \"DeletePolicy\",\n    \"UpdateAssumeRolePolicy\", \"CreateAccessKey\", \"DeleteAccessKey\",\n    \"UpdateAccountPasswordPolicy\"\n  ]}\n}\n```\n\n**CloudTrail tampering (CRITICAL — never suppress):**\n\n```json\n{\n  \"source\": [\"aws.cloudtrail\"],\n  \"detail\": {\"eventName\": [\n    \"DeleteTrail\", \"StopLogging\", \"UpdateTrail\",\n    \"DeleteEventDataStore\", \"PutEventSelectors\"\n  ]}\n}\n```\n\nCommon EventBridge pattern errors (never fires, wrong events, missed regions): [Error handling](references\u002Ferror-handling.md).\n\n### Step 2: Severity classification matrix\n\n| Event category | Severity | Rationale |\n|---|---|---|\n| CloudTrail tampering (DeleteTrail, StopLogging) | **CRITICAL** | Blinds all alerting; never suppress |\n| Root login | **CRITICAL** | Root should never be used |\n| IAM policy manipulation (AttachRolePolicy, CreatePolicyVersion) | **HIGH** | Privilege escalation vector |\n| Access key creation | **HIGH** | Credential exfiltration vector |\n| SG open ingress 0.0.0.0\u002F0 | **HIGH** | Lateral movement vector |\n| KMS key deletion | **HIGH** | Data loss vector |\n| S3 bucket public access | **HIGH** | Data exposure |\n| Console login failure (single) | **LOW** | Brute-force indicator (burst → HIGH) |\n| Tag changes | **LOW** | Operational noise |\n| Stack updates (CI\u002FCD) | **SUPPRESSED** | Known automation, suppress by default |\n\n**Decision rule:** default to **HIGH** unless ALL: (a) reversible within\n5 minutes, (b) does not touch IAM policies\u002Fcredentials, (c) does not\nchange network exposure, (d) actor is a known service role.\n\n### Step 3: Lambda enrichment function\n\n```python\nimport json, hashlib, boto3\nfrom datetime import datetime, timedelta, timezone\n\ncloudtrail = boto3.client('cloudtrail')\nsns = boto3.client('sns')\nddb = boto3.resource('dynamodb').Table('CloudTrailAlertDedup')\n\nSUPPRESSED_ROLES = [\n    'arn:aws:sts::111111111111:assumed-role\u002Fcicd-deploy-role',\n    'arn:aws:iam::111111111111:role\u002Faws-service-role\u002Fautoscaling.amazonaws.com\u002FAWSServiceRoleForAutoScaling',\n]\nSEVERITY_TOPIC = {\n    'CRITICAL': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-critical',\n    'HIGH': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-high',\n    'MEDIUM': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-medium',\n    'LOW': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-low',\n}\n\ndef lambda_handler(event, context):\n    detail = event['detail']\n    event_name = detail['eventName']\n    actor_arn = detail.get('userIdentity', {}).get('arn', 'unknown')\n\n    if actor_arn in SUPPRESSED_ROLES:\n        return {'status': 'suppressed', 'reason': f'Known automation: {actor_arn}'}\n\n    dedup_key = hashlib.md5(f'{event_name}|{actor_arn}'.encode()).hexdigest()\n    ttl = int((datetime.now(timezone.utc) + timedelta(minutes=5)).timestamp())\n    try:\n        ddb.put_item(Item={'dedupKey': dedup_key, 'ttl': ttl},\n                     ConditionExpression='attribute_not_exists(dedupKey)')\n    except Exception:\n        return {'status': 'deduplicated'}\n\n    lookback = (datetime.now(timezone.utc) - timedelta(minutes=15)).isoformat()\n    enrichment = {'recent_events': []}\n    try:\n        resp = cloudtrail.lookup_events(\n            LookupAttributes=[{'AttributeKey': 'Username',\n                'AttributeValue': detail['userIdentity'].get('userName', '')}],\n            StartTime=lookback, MaxResults=20)\n        enrichment['recent_events'] = [\n            {'eventName': e['EventName'], 'eventTime': e['EventTime'].isoformat()}\n            for e in resp.get('Events', [])]\n    except Exception as e:\n        enrichment['lookup_error'] = str(e)\n\n    severity = classify_severity(event_name, detail)\n    enrichment.update(severity=severity,\n        source_ip=detail.get('sourceIPAddress', 'unknown'),\n        region=detail.get('awsRegion', 'unknown'),\n        account_id=detail.get('recipientAccountId', detail.get('accountId')))\n\n    topic = SEVERITY_TOPIC[severity]\n    msg = json.dumps({'event_name': event_name, 'severity': severity,\n        'actor': actor_arn, 'enrichment': enrichment, 'raw_event': detail},\n        default=str)[:250000]\n    sns.publish(TopicArn=topic, Message=msg, Subject=f'[{severity}] {event_name}')\n    return {'status': 'alerted', 'severity': severity}\n\ndef classify_severity(event_name, detail):\n    never_suppress = {'DeleteTrail', 'StopLogging', 'UpdateTrail', 'DeleteEventDataStore'}\n    if event_name in never_suppress or detail.get('userIdentity', {}).get('type') == 'Root':\n        return 'CRITICAL'\n    high = {'AttachRolePolicy', 'DetachRolePolicy', 'CreatePolicyVersion', 'CreateAccessKey',\n            'DeleteAccessKey', 'ScheduleKeyDeletion', 'PutBucketAcl', 'UpdateAccountPasswordPolicy'}\n    if event_name in high:\n        return 'HIGH'\n    medium = {'AuthorizeSecurityGroupIngress', 'RevokeSecurityGroupIngress',\n              'CreateSecurityGroup', 'DeleteSecurityGroup'}\n    if event_name in medium:\n        return 'MEDIUM'\n    return 'LOW'\n```\n\n### Step 4: SNS routing by severity\n\n```bash\nfor sev in critical high medium low; do\n  aws sns create-topic --name cloudtrail-${sev}\n  aws sns set-topic-attributes \\\n    --topic-arn arn:aws:sns:us-east-1:111111111111:cloudtrail-${sev} \\\n    --attribute-name DisplayName --attribute-value \"CloudTrail-${sev}\"\ndone\n```\n\n| Topic | Typical subscribers | Response SLA |\n|---|---|---|\n| cloudtrail-critical | PagerDuty, SMS, Slack #sec-incidents | Immediate |\n| cloudtrail-high | Email security team, Slack #security | 1 hour |\n| cloudtrail-medium | Slack #security, Security Hub dashboard | 1 business day |\n| cloudtrail-low | Daily digest, S3 archive | Trend analysis |\n\n### Step 5: Slack and Teams webhook delivery\n\nSlack\u002FTeams delivery Lambda: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 6: Security Hub custom findings\n\nSecurity Hub BatchImportFindings implementation: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 7: Deduplication logic\n\nDedup table setup, key formula, window matrix: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 8: Alert suppression for known automation\n\nSuppression list parameter and hygiene rules: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 9: Multi-account via Organizations trail\n\nOrg-trail rule and cross-account fan-out: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 10: CloudTrail Lake for historical queries\n\nEvent data store and actor-activity query CLI: [Diagnostic commands](references\u002Fdiagnostic-commands.md).\n\n### Step 11: CloudTrail Insights anomaly alerting\n\nInsight selectors and Insights rule CLI: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n## Output format (STRICT output contract)\n\n### Literal output labels\n\nEvery alert design MUST emit exactly one block per rule using the labels\n`ALERT_NAME:`, `EVENT:`, `VERDICT:`, `CHECKLIST:`, `GAP:`, and `TEMPLATE:`.\nDo NOT preface with prose.\n\n```text\nALERT_NAME: \u003Calert reference name>\nEVENT: \u003CCloudTrail eventName(s)>\nVERDICT: AUTOMATION_DEPLOYED | REVIEW_REQUIRED\nCHECKLIST:\n  [✓|✗] EventBridge rule: \u003Crule name + pattern summary>\n  [✓|✗] Lambda enrichment: \u003Cfunction ARN, lookup-events lookback>\n  [✓|✗] SNS topic: \u003Ctopic ARN by severity>\n  [✓|✗] Security Hub finding: \u003Cconfigured | not configured>\n  [✓|✗] Slack\u002FTeams webhook: \u003Cconfigured | not configured>\n  [✓|✗] Deduplication: \u003Cwindow minutes, key formula>\n  [✓|✗] Suppression list: \u003Crole ARNs | N\u002FA>\n  [✓|✗] Non-suppressible events enforced: DeleteTrail, StopLogging, root\nGAP: \u003Cspecific missing piece or None>\nTEMPLATE: \u003CCLI snippet or IaC>\n```\n\n### FORBIDDEN — NEVER do these\n\n1. NEVER create an EventBridge rule for `ConsoleLogin` without filtering\n   on `responseElements.ConsoleLogin: Success`. Without the filter a\n   brute-force scenario generates thousands of alerts per minute,\n   exhausting Lambda concurrency and throttling real security events.\n\n2. NEVER suppress `DeleteTrail`, `StopLogging`, `UpdateTrail`, or\n   `DeleteEventDataStore` events. Even when the actor is a known\n   automation role, these events blind the entire detection system.\n   A compromised service role calling `StopLogging` is an active attack.\n\n3. NEVER use the same SNS topic for all severity levels. Routing\n   CRITICAL (root login) and LOW (tag changes) to the same topic trains\n   operators to ignore alerts. Always create at least 4 severity-tiered\n   topics.\n\n4. NEVER omit the deduplication layer. Without dedup a CI\u002FCD pipeline\n   deploying 50 stacks produces 50 identical alerts. Operators mute the\n   channel, and the next real security event is invisible.\n\n5. NEVER hardcode Slack\u002FTeams webhook URLs in Lambda source code. Store\n   in Secrets Manager or Parameter Store. A webhook committed to source\n   control is a credential leak.\n\n6. NEVER set the enrichment Lambda timeout below 10 seconds. The\n   `lookup-events` API call can take 3-5 seconds under load. A 3-second\n   timeout silently degrades to un-enriched alerts.\n\n7. NEVER wire Slack webhook delivery directly from SNS without a queue.\n   Slack enforces 1 message\u002Fsecond per URL. A burst of 10 alerts\n   produces `429 Too Many Requests` for 9. Use SNS → SQS → Lambda.\n\n### Worked example — root-login alert with full enrichment\n\nScenario: root console login in production account. EventBridge detects\nthe `ConsoleLogin` event by `userIdentity.type: Root`. Lambda enrichment\nadds 15-minute actor context via `lookup-events`, classifies as CRITICAL,\npublishes to the critical SNS topic, creates a Security Hub finding, and\nsends a formatted Slack alert.\n\n```text\nALERT_NAME: root-login-prod\nEVENT: ConsoleLogin (by root)\nVERDICT: AUTOMATION_DEPLOYED\nCHECKLIST:\n  [✓] EventBridge rule: cloudtrail-alert-root-login\n      pattern: {\"source\":[\"aws.signin\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"userIdentity\":{\"type\":[\"Root\"]},\"eventName\":[\"ConsoleLogin\"],\"responseElements\":{\"ConsoleLogin\":[\"Success\"]}}}\n  [✓] Lambda enrichment: arn:aws:lambda:us-east-1:111111111111:function:cloudtrail-enrichment\n      lookup-events: 15-min lookback for root actor recent API calls\n      severity classification: CRITICAL (userIdentity.type == Root → always CRITICAL)\n  [✓] SNS topic: arn:aws:sns:us-east-1:111111111111:cloudtrail-critical\n  [✓] Security Hub finding: configured (BatchImportFindings, Severity CRITICAL\u002F90.0, deterministic Id via uuid5)\n  [✓] Slack webhook: configured (#sec-incidents, via SQS → Lambda consumer for rate-limit safety)\n  [✓] Deduplication: window 0 min (never dedup root login), key N\u002FA\n  [✓] Suppression list: N\u002FA — root events NEVER suppressed\n  [✓] Non-suppressible events enforced: DeleteTrail, StopLogging, root\nGAP: None\nTEMPLATE:\n  aws events put-rule --name cloudtrail-alert-root-login \\\\\n    --event-pattern '{\"source\":[\"aws.signin\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"userIdentity\":{\"type\":[\"Root\"]},\"eventName\":[\"ConsoleLogin\"],\"responseElements\":{\"ConsoleLogin\":[\"Success\"]}}}'\n  aws events put-targets --rule cloudtrail-alert-root-login \\\\\n    --targets '[{\"Id\":\"enrichment\",\"Arn\":\"arn:aws:lambda:us-east-1:111111111111:function:cloudtrail-enrichment\",\"InputTransformer\":{\"InputPathsMap\":{\"detail\":\"$.detail\"},\"InputTemplate\":\"{\\\"detail\\\": \u003Cdetail>}\"}}]'\n```\n\nThis example's artifacts (Slack payload JSON, deployed enrichment Lambda): [Worked examples](references\u002Fworked-examples.md).\n\n### Decision tree\n\n```text\nIs the CloudTrail event a management event?\n├─ Yes → Security-critical (root login, trail tampering, org leave)?\n│        ├─ Yes → CRITICAL, never suppress, 0-min dedup\n│        │        Route: SNS critical topic + Security Hub finding + Slack #sec-incidents\n│        └─ No → Infrastructure change (SG, VPC, KMS)?\n│                 ├─ Yes → HIGH\u002FMEDIUM, suppressible by known roles, 1-5 min dedup\n│                 │        Route: SNS high\u002Fmedium topic + Slack #security\n│                 └─ No → LOW (tags, login failure, read-only)\n│                          Route: SNS low topic + daily digest\n└─ No → Data event (S3, Lambda)? → Not covered by lookup-events\n         Use CloudTrail Lake query for enrichment\n```\n\n## Anti-Patterns — NEVER do these things\n\n- NEVER create an EventBridge rule for `ConsoleLogin` without filtering\n  on `responseElements.ConsoleLogin: Success`. Without the filter, a\n  brute-force scenario generates thousands of alerts per minute,\n  exhausting Lambda concurrency and throttling ALL alerts including real\n  security events.\n\n- NEVER suppress `DeleteTrail`, `StopLogging`, `UpdateTrail`, or\n  `DeleteEventDataStore` events. Even when the actor is a known\n  automation role, these events blind the entire detection system. A\n  compromised service role calling `StopLogging` is an active attack.\n\n- NEVER use the same SNS topic for all severity levels. Routing CRITICAL\n  (root login) and LOW (tag changes) to the same topic trains operators\n  to ignore the topic. Always create at least 4 severity-tiered topics.\n\n- NEVER omit the deduplication layer. Without dedup, a CI\u002FCD pipeline\n  deploying 50 stacks produces 50 identical alerts. Operators mute the\n  channel, and the next real security event is invisible.\n\n- NEVER hardcode Slack\u002FTeams webhook URLs in Lambda source code. Store\n  in Secrets Manager or Parameter Store. A webhook in source control is\n  a credential leak.\n\n- NEVER set the enrichment Lambda timeout below 10 seconds. The\n  `lookup-events` API call can take 3-5 seconds under load. A 3-second\n  timeout silently degrades to un-enriched alerts.\n\n- NEVER deploy CloudTrail alerts in a single region only. Regional\n  services emit regional CloudTrail events. An attacker calling\n  `AttachRolePolicy` in `eu-west-1` goes undetected if the rule exists\n  only in `us-east-1`. Deploy rules in all active regions or use an\n  Organizations trail.\n\n- NEVER use `lookup-events` for data-event enrichment. Data events are\n  NOT returned by `lookup-events`. Use CloudTrail Lake with a data-event\n  event data store. A silent assumption that `lookup-events` covers data\n  events produces empty enrichment.\n\n- NEVER create Security Hub findings without a deterministic `Id`.\n  Random UUIDs per invocation produce orphaned findings that accumulate\n  forever. Use `uuid5` with event identity for idempotent upserts.\n\n- NEVER wire Slack webhook delivery directly from SNS without a queue.\n  Slack enforces 1 message\u002Fsecond. A burst of 10 CRITICAL alerts\n  produces `429` for 9. Use SNS → SQS → Lambda.\n\n## Pre-flight safety checks\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation,\n  emit: `CONFIRM: About to \u003Caction> for event \u003Cevent> in account\n  \u003Caccount>. Proceed? (yes\u002Fno)`\n\n- **Verify CloudTrail is enabled.** `aws cloudtrail describe-trails\n  --query 'trailList[?IsLogging==`true`]'`. A disabled trail means all\n  alerting is dead configuration.\n\n- **Test each EventBridge rule.** Use `aws events test-event-pattern`\n  with a known CloudTrail event JSON before deploying to production.\n\n- **For Security Hub integration, verify it is enabled.**\n  `securityhub describe-hub`. `BatchImportFindings` fails silently when\n  Security Hub is not enabled.\n\n## Appendix A — Common CloudTrail alert patterns\n\n| Category | source | eventName(s) | Severity | Suppressible |\n|---|---|---|---|---|\n| Root login | `aws.signin` | `ConsoleLogin` (root) | CRITICAL | No |\n| IAM policy change | `aws.iam` | `AttachRolePolicy`, `DetachRolePolicy` | HIGH | Yes |\n| Access key creation | `aws.iam` | `CreateAccessKey` | HIGH | Yes |\n| SG change | `aws.ec2` | `AuthorizeSecurityGroupIngress` etc. | MEDIUM | Yes |\n| Trail tampering | `aws.cloudtrail` | `DeleteTrail`, `StopLogging` | CRITICAL | NEVER |\n| Login failure | `aws.signin` | `ConsoleLogin` (Failure) | LOW | Yes |\n| KMS deletion | `aws.kms` | `ScheduleKeyDeletion` | HIGH | No |\n| S3 ACL change | `aws.s3` | `PutBucketAcl` | HIGH | Yes |\n| MFA deletion | `aws.iam` | `DeactivateMFADevice` | HIGH | No |\n| Org leave | `aws.organizations` | `LeaveOrganization` | CRITICAL | NEVER |\n\n## References (load on demand)\n\n- [Worked examples](references\u002Fworked-examples.md) — root-login worked-example artifacts (Slack payload, deployed enrichment Lambda)\n- [Error handling](references\u002Ferror-handling.md) — EventBridge pattern error table and webhook rate-limit mitigation\n- [Diagnostic commands](references\u002Fdiagnostic-commands.md) — CloudTrail Lake event-data-store and query CLI\n- [Advanced patterns](references\u002Fadvanced-patterns.md) — dependency graph, non-obvious behaviors, delivery and integration steps, decision-tree appendix, recent features\n- [EventBridge event patterns](references\u002Feventbridge-event-patterns.md) — event pattern library reference\n\n## Domain\n\nAWS CloudOps \u002F Governance Automation — CloudTrail-driven security alerting.\n\n## AWS documentation\n\n- **AWS CloudTrail** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-user-guide.html\n- **Amazon EventBridge** — https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-what-is.html\n- **CloudTrail Lake** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-lake.html\n- **CloudTrail Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fview-insights-events.html\n- **AWS Security Hub** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsecurityhub\u002Flatest\u002Fuserguide\u002Fwhat-is-securityhub.html\n","# CloudTrail Alert Automator\n\n## Mindset\n\n**One-line takeaway:** every CloudTrail alert is a four-stage pipeline —\n**detect** (EventBridge rule matching a CloudTrail API event) →\n**enrich** (Lambda lookup-events for actor context, source IP, prior\ncorrelation) → **route** (SNS topic by severity, Security Hub finding,\nSlack\u002FTeams webhook) → **deduplicate + suppress** (window-based dedup,\nservice-role suppression list). A gap in ANY stage produces alert\nfatigue or missed critical events.\n\n- **Detection** without **enrichment** is a raw event dump: \"ConsoleLogin\n  by root\" tells you nothing about whether it was a legitimate break-glass\n  or a compromise. Enrichment with `lookup-events` for the surrounding 15\n  minutes adds the actor's recent API activity and the source IP context.\n- **Routing** without **severity tiering** means every alert pages the\n  on-call equally. Root login is CRITICAL; an IAM user self-rotating their\n  access key is LOW. Severity is derived from event name, actor type, and\n  resource impact.\n- **Deduplication + suppression** is the difference between a useful alert\n  and a noisy one. A CI\u002FCD pipeline calling `UpdateStack` 200 times in a\n  deploy window produces 200 identical alerts without dedup.\n\n## Quick navigation\n\n| You want to... | Go to |\n|---|---|\n| Pick the right EventBridge event pattern | Step 1 + Appendix A |\n| Decide severity tier | Step 2 (severity matrix) |\n| Build Lambda enrichment with lookup-events | Step 3 |\n| Wire SNS routing by severity | Step 4 |\n| Send to Slack or Teams webhook | Step 5 |\n| Integrate with Security Hub custom findings | Step 6 |\n| Implement deduplication logic | Step 7 |\n| Suppress known CI\u002FCD automation | Step 8 |\n| Deploy multi-account via Organizations trail | Step 9 |\n| Use CloudTrail Lake for historical queries | Step 10 |\n| Enable CloudTrail Insights anomaly alerting | Step 11 |\n| Avoid common alerting pitfalls | Anti-Patterns |\n| Recent features (Insights, Lake) | Recent AWS features |\n\n## Critical rules at a glance (do NOT bury these)\n\n1. **EventBridge `detail.eventName` matching is case-sensitive and\n   exact.** List every variant explicitly. A common miss: alerting on\n   `DeleteSecurityGroup` but not `RevokeSecurityGroupIngress` — the\n   revoke is the more dangerous operation and goes undetected.\n2. **`lookup-events` has a 15-minute lookback ceiling per call.** For\n   enrichment beyond 15 minutes, use CloudTrail Lake queries. A single\n   `lookup-events` with no `StartTime` returns only the last 15 minutes.\n3. **SNS message size cap is 256 KB.** Enriched events can exceed this.\n   Always truncate. A `MessageAttributes` overflow produces a silent SNS\n   publish failure logged only in Lambda's CloudWatch Logs.\n4. **Security Hub `BatchImportFindings` deduplicates by `Id`.** Use a\n   deterministic `Id` (`\u003CaccountId>-\u003CeventName>-\u003CeventTime>-\u003CresourceId>`)\n   to avoid orphaned findings. Re-importing with the same `Id` updates.\n5. **CloudTrail event delivery latency is 3–15 minutes.** Deduplication\n   windows must account for arrival-time delta, not event-time delta.\n   Two events 2 minutes apart by `eventTime` may arrive 8 minutes apart\n   in EventBridge.\n\n## Pre-flight: data requirements\n\n| Input | Source | Why |\n|---|---|---|\n| CloudTrail status | `cloudtrail describe-trails` | Events must exist for alerting |\n| Event data store (if Lake in scope) | `cloudtrail list-event-data-stores` | Historical query capability |\n| Existing EventBridge rules | `events list-rules` | Avoid duplicate rules |\n| SNS topics | `sns list-topics` | Reuse or create new |\n| Security Hub enabled status | `securityhub describe-hub` | Whether findings can be imported |\n| Slack\u002FTeams webhook URLs | Secrets Manager \u002F Parameter Store | Notification delivery |\n| Known service roles for suppression | IAM role inventory | CI\u002FCD, auto-scaling, automation roles |\n| CloudTrail Insights status | `cloudtrail get-insight-selectors` | Anomaly alerting availability |\n\n**If the input is malformed** (no CloudTrail enabled, no event list), emit:\n\n```text\nALERT: \u003Creference>\nEVENT: \u003Cevent-name>\nVERDICT: ERROR\nREASON: Cannot design alerting — CloudTrail status and target event list required.\nGAP: Enable CloudTrail and supply the event names to alert on.\n```\n\n## Process — Alert pipeline design (apply in order)\n\n### Step 0: Expert knowledge — non-obvious behaviors\n\nFull catalog: [Advanced patterns](references\u002Fadvanced-patterns.md) — data events, root identity, ConsoleLogin failures, org-trail routing, throttling, rate limits.\n\n### Step 1: Build the EventBridge event pattern\n\n**Root console login (CRITICAL):**\n\n```json\n{\n  \"source\": [\"aws.signin\"],\n  \"detail-type\": [\"AWS API Call via CloudTrail\"],\n  \"detail\": {\n    \"userIdentity\": {\"type\": [\"Root\"]},\n    \"eventName\": [\"ConsoleLogin\"],\n    \"responseElements\": {\"ConsoleLogin\": [\"Success\"]}\n  }\n}\n```\n\n**Security-critical IAM changes (HIGH):**\n\n```json\n{\n  \"source\": [\"aws.iam\"],\n  \"detail\": {\"eventName\": [\n    \"AttachRolePolicy\", \"DetachRolePolicy\", \"PutRolePolicy\",\n    \"DeleteRolePolicy\", \"CreatePolicyVersion\", \"DeletePolicy\",\n    \"UpdateAssumeRolePolicy\", \"CreateAccessKey\", \"DeleteAccessKey\",\n    \"UpdateAccountPasswordPolicy\"\n  ]}\n}\n```\n\n**CloudTrail tampering (CRITICAL — never suppress):**\n\n```json\n{\n  \"source\": [\"aws.cloudtrail\"],\n  \"detail\": {\"eventName\": [\n    \"DeleteTrail\", \"StopLogging\", \"UpdateTrail\",\n    \"DeleteEventDataStore\", \"PutEventSelectors\"\n  ]}\n}\n```\n\nCommon EventBridge pattern errors (never fires, wrong events, missed regions): [Error handling](references\u002Ferror-handling.md).\n\n### Step 2: Severity classification matrix\n\n| Event category | Severity | Rationale |\n|---|---|---|\n| CloudTrail tampering (DeleteTrail, StopLogging) | **CRITICAL** | Blinds all alerting; never suppress |\n| Root login | **CRITICAL** | Root should never be used |\n| IAM policy manipulation (AttachRolePolicy, CreatePolicyVersion) | **HIGH** | Privilege escalation vector |\n| Access key creation | **HIGH** | Credential exfiltration vector |\n| SG open ingress 0.0.0.0\u002F0 | **HIGH** | Lateral movement vector |\n| KMS key deletion | **HIGH** | Data loss vector |\n| S3 bucket public access | **HIGH** | Data exposure |\n| Console login failure (single) | **LOW** | Brute-force indicator (burst → HIGH) |\n| Tag changes | **LOW** | Operational noise |\n| Stack updates (CI\u002FCD) | **SUPPRESSED** | Known automation, suppress by default |\n\n**Decision rule:** default to **HIGH** unless ALL: (a) reversible within\n5 minutes, (b) does not touch IAM policies\u002Fcredentials, (c) does not\nchange network exposure, (d) actor is a known service role.\n\n### Step 3: Lambda enrichment function\n\n```python\nimport json, hashlib, boto3\nfrom datetime import datetime, timedelta, timezone\n\ncloudtrail = boto3.client('cloudtrail')\nsns = boto3.client('sns')\nddb = boto3.resource('dynamodb').Table('CloudTrailAlertDedup')\n\nSUPPRESSED_ROLES = [\n    'arn:aws:sts::111111111111:assumed-role\u002Fcicd-deploy-role',\n    'arn:aws:iam::111111111111:role\u002Faws-service-role\u002Fautoscaling.amazonaws.com\u002FAWSServiceRoleForAutoScaling',\n]\nSEVERITY_TOPIC = {\n    'CRITICAL': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-critical',\n    'HIGH': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-high',\n    'MEDIUM': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-medium',\n    'LOW': 'arn:aws:sns:us-east-1:111111111111:cloudtrail-low',\n}\n\ndef lambda_handler(event, context):\n    detail = event['detail']\n    event_name = detail['eventName']\n    actor_arn = detail.get('userIdentity', {}).get('arn', 'unknown')\n\n    if actor_arn in SUPPRESSED_ROLES:\n        return {'status': 'suppressed', 'reason': f'Known automation: {actor_arn}'}\n\n    dedup_key = hashlib.md5(f'{event_name}|{actor_arn}'.encode()).hexdigest()\n    ttl = int((datetime.now(timezone.utc) + timedelta(minutes=5)).timestamp())\n    try:\n        ddb.put_item(Item={'dedupKey': dedup_key, 'ttl': ttl},\n                     ConditionExpression='attribute_not_exists(dedupKey)')\n    except Exception:\n        return {'status': 'deduplicated'}\n\n    lookback = (datetime.now(timezone.utc) - timedelta(minutes=15)).isoformat()\n    enrichment = {'recent_events': []}\n    try:\n        resp = cloudtrail.lookup_events(\n            LookupAttributes=[{'AttributeKey': 'Username',\n                'AttributeValue': detail['userIdentity'].get('userName', '')}],\n            StartTime=lookback, MaxResults=20)\n        enrichment['recent_events'] = [\n            {'eventName': e['EventName'], 'eventTime': e['EventTime'].isoformat()}\n            for e in resp.get('Events', [])]\n    except Exception as e:\n        enrichment['lookup_error'] = str(e)\n\n    severity = classify_severity(event_name, detail)\n    enrichment.update(severity=severity,\n        source_ip=detail.get('sourceIPAddress', 'unknown'),\n        region=detail.get('awsRegion', 'unknown'),\n        account_id=detail.get('recipientAccountId', detail.get('accountId')))\n\n    topic = SEVERITY_TOPIC[severity]\n    msg = json.dumps({'event_name': event_name, 'severity': severity,\n        'actor': actor_arn, 'enrichment': enrichment, 'raw_event': detail},\n        default=str)[:250000]\n    sns.publish(TopicArn=topic, Message=msg, Subject=f'[{severity}] {event_name}')\n    return {'status': 'alerted', 'severity': severity}\n\ndef classify_severity(event_name, detail):\n    never_suppress = {'DeleteTrail', 'StopLogging', 'UpdateTrail', 'DeleteEventDataStore'}\n    if event_name in never_suppress or detail.get('userIdentity', {}).get('type') == 'Root':\n        return 'CRITICAL'\n    high = {'AttachRolePolicy', 'DetachRolePolicy', 'CreatePolicyVersion', 'CreateAccessKey',\n            'DeleteAccessKey', 'ScheduleKeyDeletion', 'PutBucketAcl', 'UpdateAccountPasswordPolicy'}\n    if event_name in high:\n        return 'HIGH'\n    medium = {'AuthorizeSecurityGroupIngress', 'RevokeSecurityGroupIngress',\n              'CreateSecurityGroup', 'DeleteSecurityGroup'}\n    if event_name in medium:\n        return 'MEDIUM'\n    return 'LOW'\n```\n\n### Step 4: SNS routing by severity\n\n```bash\nfor sev in critical high medium low; do\n  aws sns create-topic --name cloudtrail-${sev}\n  aws sns set-topic-attributes \\\n    --topic-arn arn:aws:sns:us-east-1:111111111111:cloudtrail-${sev} \\\n    --attribute-name DisplayName --attribute-value \"CloudTrail-${sev}\"\ndone\n```\n\n| Topic | Typical subscribers | Response SLA |\n|---|---|---|\n| cloudtrail-critical | PagerDuty, SMS, Slack #sec-incidents | Immediate |\n| cloudtrail-high | Email security team, Slack #security | 1 hour |\n| cloudtrail-medium | Slack #security, Security Hub dashboard | 1 business day |\n| cloudtrail-low | Daily digest, S3 archive | Trend analysis |\n\n### Step 5: Slack and Teams webhook delivery\n\nSlack\u002FTeams delivery Lambda: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 6: Security Hub custom findings\n\nSecurity Hub BatchImportFindings implementation: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 7: Deduplication logic\n\nDedup table setup, key formula, window matrix: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 8: Alert suppression for known automation\n\nSuppression list parameter and hygiene rules: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 9: Multi-account via Organizations trail\n\nOrg-trail rule and cross-account fan-out: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 10: CloudTrail Lake for historical queries\n\nEvent data store and actor-activity query CLI: [Diagnostic commands](references\u002Fdiagnostic-commands.md).\n\n### Step 11: CloudTrail Insights anomaly alerting\n\nInsight selectors and Insights rule CLI: [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n## Output format (STRICT output contract)\n\n### Literal output labels\n\nEvery alert design MUST emit exactly one block per rule using the labels\n`ALERT_NAME:`, `EVENT:`, `VERDICT:`, `CHECKLIST:`, `GAP:`, and `TEMPLATE:`.\nDo NOT preface with prose.\n\n```text\nALERT_NAME: \u003Calert reference name>\nEVENT: \u003CCloudTrail eventName(s)>\nVERDICT: AUTOMATION_DEPLOYED | REVIEW_REQUIRED\nCHECKLIST:\n  [✓|✗] EventBridge rule: \u003Crule name + pattern summary>\n  [✓|✗] Lambda enrichment: \u003Cfunction ARN, lookup-events lookback>\n  [✓|✗] SNS topic: \u003Ctopic ARN by severity>\n  [✓|✗] Security Hub finding: \u003Cconfigured | not configured>\n  [✓|✗] Slack\u002FTeams webhook: \u003Cconfigured | not configured>\n  [✓|✗] Deduplication: \u003Cwindow minutes, key formula>\n  [✓|✗] Suppression list: \u003Crole ARNs | N\u002FA>\n  [✓|✗] Non-suppressible events enforced: DeleteTrail, StopLogging, root\nGAP: \u003Cspecific missing piece or None>\nTEMPLATE: \u003CCLI snippet or IaC>\n```\n\n### FORBIDDEN — NEVER do these\n\n1. NEVER create an EventBridge rule for `ConsoleLogin` without filtering\n   on `responseElements.ConsoleLogin: Success`. Without the filter a\n   brute-force scenario generates thousands of alerts per minute,\n   exhausting Lambda concurrency and throttling real security events.\n\n2. NEVER suppress `DeleteTrail`, `StopLogging`, `UpdateTrail`, or\n   `DeleteEventDataStore` events. Even when the actor is a known\n   automation role, these events blind the entire detection system.\n   A compromised service role calling `StopLogging` is an active attack.\n\n3. NEVER use the same SNS topic for all severity levels. Routing\n   CRITICAL (root login) and LOW (tag changes) to the same topic trains\n   operators to ignore alerts. Always create at least 4 severity-tiered\n   topics.\n\n4. NEVER omit the deduplication layer. Without dedup a CI\u002FCD pipeline\n   deploying 50 stacks produces 50 identical alerts. Operators mute the\n   channel, and the next real security event is invisible.\n\n5. NEVER hardcode Slack\u002FTeams webhook URLs in Lambda source code. Store\n   in Secrets Manager or Parameter Store. A webhook committed to source\n   control is a credential leak.\n\n6. NEVER set the enrichment Lambda timeout below 10 seconds. The\n   `lookup-events` API call can take 3-5 seconds under load. A 3-second\n   timeout silently degrades to un-enriched alerts.\n\n7. NEVER wire Slack webhook delivery directly from SNS without a queue.\n   Slack enforces 1 message\u002Fsecond per URL. A burst of 10 alerts\n   produces `429 Too Many Requests` for 9. Use SNS → SQS → Lambda.\n\n### Worked example — root-login alert with full enrichment\n\nScenario: root console login in production account. EventBridge detects\nthe `ConsoleLogin` event by `userIdentity.type: Root`. Lambda enrichment\nadds 15-minute actor context via `lookup-events`, classifies as CRITICAL,\npublishes to the critical SNS topic, creates a Security Hub finding, and\nsends a formatted Slack alert.\n\n```text\nALERT_NAME: root-login-prod\nEVENT: ConsoleLogin (by root)\nVERDICT: AUTOMATION_DEPLOYED\nCHECKLIST:\n  [✓] EventBridge rule: cloudtrail-alert-root-login\n      pattern: {\"source\":[\"aws.signin\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"userIdentity\":{\"type\":[\"Root\"]},\"eventName\":[\"ConsoleLogin\"],\"responseElements\":{\"ConsoleLogin\":[\"Success\"]}}}\n  [✓] Lambda enrichment: arn:aws:lambda:us-east-1:111111111111:function:cloudtrail-enrichment\n      lookup-events: 15-min lookback for root actor recent API calls\n      severity classification: CRITICAL (userIdentity.type == Root → always CRITICAL)\n  [✓] SNS topic: arn:aws:sns:us-east-1:111111111111:cloudtrail-critical\n  [✓] Security Hub finding: configured (BatchImportFindings, Severity CRITICAL\u002F90.0, deterministic Id via uuid5)\n  [✓] Slack webhook: configured (#sec-incidents, via SQS → Lambda consumer for rate-limit safety)\n  [✓] Deduplication: window 0 min (never dedup root login), key N\u002FA\n  [✓] Suppression list: N\u002FA — root events NEVER suppressed\n  [✓] Non-suppressible events enforced: DeleteTrail, StopLogging, root\nGAP: None\nTEMPLATE:\n  aws events put-rule --name cloudtrail-alert-root-login \\\\\n    --event-pattern '{\"source\":[\"aws.signin\"],\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"userIdentity\":{\"type\":[\"Root\"]},\"eventName\":[\"ConsoleLogin\"],\"responseElements\":{\"ConsoleLogin\":[\"Success\"]}}}'\n  aws events put-targets --rule cloudtrail-alert-root-login \\\\\n    --targets '[{\"Id\":\"enrichment\",\"Arn\":\"arn:aws:lambda:us-east-1:111111111111:function:cloudtrail-enrichment\",\"InputTransformer\":{\"InputPathsMap\":{\"detail\":\"$.detail\"},\"InputTemplate\":\"{\\\"detail\\\": \u003Cdetail>}\"}}]'\n```\n\nThis example's artifacts (Slack payload JSON, deployed enrichment Lambda): [Worked examples](references\u002Fworked-examples.md).\n\n### Decision tree\n\n```text\nIs the CloudTrail event a management event?\n├─ Yes → Security-critical (root login, trail tampering, org leave)?\n│        ├─ Yes → CRITICAL, never suppress, 0-min dedup\n│        │        Route: SNS critical topic + Security Hub finding + Slack #sec-incidents\n│        └─ No → Infrastructure change (SG, VPC, KMS)?\n│                 ├─ Yes → HIGH\u002FMEDIUM, suppressible by known roles, 1-5 min dedup\n│                 │        Route: SNS high\u002Fmedium topic + Slack #security\n│                 └─ No → LOW (tags, login failure, read-only)\n│                          Route: SNS low topic + daily digest\n└─ No → Data event (S3, Lambda)? → Not covered by lookup-events\n         Use CloudTrail Lake query for enrichment\n```\n\n## Anti-Patterns — NEVER do these things\n\n- NEVER create an EventBridge rule for `ConsoleLogin` without filtering\n  on `responseElements.ConsoleLogin: Success`. Without the filter, a\n  brute-force scenario generates thousands of alerts per minute,\n  exhausting Lambda concurrency and throttling ALL alerts including real\n  security events.\n\n- NEVER suppress `DeleteTrail`, `StopLogging`, `UpdateTrail`, or\n  `DeleteEventDataStore` events. Even when the actor is a known\n  automation role, these events blind the entire detection system. A\n  compromised service role calling `StopLogging` is an active attack.\n\n- NEVER use the same SNS topic for all severity levels. Routing CRITICAL\n  (root login) and LOW (tag changes) to the same topic trains operators\n  to ignore the topic. Always create at least 4 severity-tiered topics.\n\n- NEVER omit the deduplication layer. Without dedup, a CI\u002FCD pipeline\n  deploying 50 stacks produces 50 identical alerts. Operators mute the\n  channel, and the next real security event is invisible.\n\n- NEVER hardcode Slack\u002FTeams webhook URLs in Lambda source code. Store\n  in Secrets Manager or Parameter Store. A webhook in source control is\n  a credential leak.\n\n- NEVER set the enrichment Lambda timeout below 10 seconds. The\n  `lookup-events` API call can take 3-5 seconds under load. A 3-second\n  timeout silently degrades to un-enriched alerts.\n\n- NEVER deploy CloudTrail alerts in a single region only. Regional\n  services emit regional CloudTrail events. An attacker calling\n  `AttachRolePolicy` in `eu-west-1` goes undetected if the rule exists\n  only in `us-east-1`. Deploy rules in all active regions or use an\n  Organizations trail.\n\n- NEVER use `lookup-events` for data-event enrichment. Data events are\n  NOT returned by `lookup-events`. Use CloudTrail Lake with a data-event\n  event data store. A silent assumption that `lookup-events` covers data\n  events produces empty enrichment.\n\n- NEVER create Security Hub findings without a deterministic `Id`.\n  Random UUIDs per invocation produce orphaned findings that accumulate\n  forever. Use `uuid5` with event identity for idempotent upserts.\n\n- NEVER wire Slack webhook delivery directly from SNS without a queue.\n  Slack enforces 1 message\u002Fsecond. A burst of 10 CRITICAL alerts\n  produces `429` for 9. Use SNS → SQS → Lambda.\n\n## Pre-flight safety checks\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation,\n  emit: `CONFIRM: About to \u003Caction> for event \u003Cevent> in account\n  \u003Caccount>. Proceed? (yes\u002Fno)`\n\n- **Verify CloudTrail is enabled.** `aws cloudtrail describe-trails\n  --query 'trailList[?IsLogging==`true`]'`. A disabled trail means all\n  alerting is dead configuration.\n\n- **Test each EventBridge rule.** Use `aws events test-event-pattern`\n  with a known CloudTrail event JSON before deploying to production.\n\n- **For Security Hub integration, verify it is enabled.**\n  `securityhub describe-hub`. `BatchImportFindings` fails silently when\n  Security Hub is not enabled.\n\n## Appendix A — Common CloudTrail alert patterns\n\n| Category | source | eventName(s) | Severity | Suppressible |\n|---|---|---|---|---|\n| Root login | `aws.signin` | `ConsoleLogin` (root) | CRITICAL | No |\n| IAM policy change | `aws.iam` | `AttachRolePolicy`, `DetachRolePolicy` | HIGH | Yes |\n| Access key creation | `aws.iam` | `CreateAccessKey` | HIGH | Yes |\n| SG change | `aws.ec2` | `AuthorizeSecurityGroupIngress` etc. | MEDIUM | Yes |\n| Trail tampering | `aws.cloudtrail` | `DeleteTrail`, `StopLogging` | CRITICAL | NEVER |\n| Login failure | `aws.signin` | `ConsoleLogin` (Failure) | LOW | Yes |\n| KMS deletion | `aws.kms` | `ScheduleKeyDeletion` | HIGH | No |\n| S3 ACL change | `aws.s3` | `PutBucketAcl` | HIGH | Yes |\n| MFA deletion | `aws.iam` | `DeactivateMFADevice` | HIGH | No |\n| Org leave | `aws.organizations` | `LeaveOrganization` | CRITICAL | NEVER |\n\n## References (load on demand)\n\n- [Worked examples](references\u002Fworked-examples.md) — root-login worked-example artifacts (Slack payload, deployed enrichment Lambda)\n- [Error handling](references\u002Ferror-handling.md) — EventBridge pattern error table and webhook rate-limit mitigation\n- [Diagnostic commands](references\u002Fdiagnostic-commands.md) — CloudTrail Lake event-data-store and query CLI\n- [Advanced patterns](references\u002Fadvanced-patterns.md) — dependency graph, non-obvious behaviors, delivery and integration steps, decision-tree appendix, recent features\n- [EventBridge event patterns](references\u002Feventbridge-event-patterns.md) — event pattern library reference\n\n## Domain\n\nAWS CloudOps \u002F Governance Automation — CloudTrail-driven security alerting.\n\n## AWS documentation\n\n- **AWS CloudTrail** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-user-guide.html\n- **Amazon EventBridge** — https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-what-is.html\n- **CloudTrail Lake** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-lake.html\n- **CloudTrail Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fview-insights-events.html\n- **AWS Security Hub** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsecurityhub\u002Flatest\u002Fuserguide\u002Fwhat-is-securityhub.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":42},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"entry_point":34,"skill_class":35,"when_to_use":36,"requires_llm":37,"verdict_shape":38,"lifecycle_status":39,"invocation_schema":40,"supports_pipeline":37,"activation_triggers":41},"aws-cloudtrail, eventbridge, sns, security-hub, lambda, governance, automate","4","Jacky Chan — AWS Community Builder","aws-cloudops","Governance","0.1.0","AWS CloudTrail, EventBridge, SNS alerting, Security Hub, lookup-events, CloudTrail Lake, CloudTrail Insights, root login alert, IAM change alert, security group change, Slack webhook, alert deduplication, alert suppression, Organizations trail, governance automation","automate","high","false","capability","Designing CloudTrail alerting automation, wiring EventBridge rules for security-critical API calls, building Lambda enrichment with lookup-events context, integrating CloudTrail alerts with Security Hub custom findings, routing alerts to Slack or Teams, suppressing known CI\u002FCD automation noise, or deploying multi-account CloudTrail alerting via an Organizations trail.","true","AUTOMATION_DEPLOYED | REVIEW_REQUIRED","active","Input: either (a) a set of CloudTrail event names or categories to alert on plus the desired notification targets (SNS, Security Hub, Slack, Teams), OR (b) an existing alerting setup to audit. Output: deterministic ALERT block per rule — RULE\u002FENRICHMENT\u002FROUTING\u002FDEDUP\u002F SUPPRESSION\u002FVERDICT — where VERDICT is AUTOMATION_DEPLOYED or REVIEW_REQUIRED.","automate CloudTrail alerts, EventBridge rule for root login, IAM change alert, security group change notification, CloudTrail SNS alert, Security Hub custom finding from CloudTrail, CloudTrail Lake query, Slack webhook CloudTrail, alert deduplication, suppress CI\u002FCD service role alerts, CloudTrail Insights anomaly, Organizations trail alerting","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline alert-design. Live deployment uses aws events put-rule, put-targets, aws sns create-topic, subscribe, aws lambda create-function, aws securityhub batch-import-findings, and aws cloudtrail lookup-events, create-event-data-store, start-query — AWS CLI v2, SSO or key-based credentials.","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fcloudtrail-alert-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":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill cloudtrail-alert-automator",{"tool":57,"command":58},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill cloudtrail-alert-automator",{"tool":60,"command":61},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill cloudtrail-alert-automator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002FSKILL.md",true,[65,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",6871,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Feval\u002Ftest-cases.yaml",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fbaselines\u002Fiam-change-enrichment.md",943,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fbaselines\u002Fiam-change-enrichment.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"evals\u002Fbaselines\u002Fmulti-account-org-trail.md",937,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fbaselines\u002Fmulti-account-org-trail.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"evals\u002Fbaselines\u002Froot-login-alert.md",941,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fbaselines\u002Froot-login-alert.md",{"path":84,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":85,"sourceHtmlUrl":86},"evals\u002Fbaselines\u002Fsecurity-hub-missing.md",786,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fbaselines\u002Fsecurity-hub-missing.md",{"path":88,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":89,"sourceHtmlUrl":90},"evals\u002Fbaselines\u002Fsuppression-cicd-service.md",724,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fbaselines\u002Fsuppression-cicd-service.md",{"path":92,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":93,"sourceHtmlUrl":94},"evals\u002Feval_config.yaml",1705,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Feval_config.yaml",{"path":96,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":97,"sourceHtmlUrl":98},"evals\u002Fevals.json",4216,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fevals.json",{"path":100,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":101,"sourceHtmlUrl":102},"evals\u002Fprompts\u002Fiam-change-enrichment.md",668,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fprompts\u002Fiam-change-enrichment.md",{"path":104,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":105,"sourceHtmlUrl":106},"evals\u002Fprompts\u002Fmulti-account-org-trail.md",744,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fprompts\u002Fmulti-account-org-trail.md",{"path":108,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":109,"sourceHtmlUrl":110},"evals\u002Fprompts\u002Froot-login-alert.md",602,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fprompts\u002Froot-login-alert.md",{"path":112,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":113,"sourceHtmlUrl":114},"evals\u002Fprompts\u002Fsecurity-hub-missing.md",661,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fprompts\u002Fsecurity-hub-missing.md",{"path":116,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":117,"sourceHtmlUrl":118},"evals\u002Fprompts\u002Fsuppression-cicd-service.md",855,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fevals\u002Fprompts\u002Fsuppression-cicd-service.md",{"path":120,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":121,"sourceHtmlUrl":122},"examples\u002FREADME.md",5600,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fexamples\u002FREADME.md",{"path":124,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fadvanced-patterns.md",10818,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Freferences\u002Fadvanced-patterns.md",{"path":128,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fdiagnostic-commands.md",809,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Freferences\u002Fdiagnostic-commands.md",{"path":132,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":133,"sourceHtmlUrl":134},"references\u002Ferror-handling.md",777,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Freferences\u002Ferror-handling.md",{"path":136,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":137,"sourceHtmlUrl":138},"references\u002Feventbridge-event-patterns.md",5933,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Freferences\u002Feventbridge-event-patterns.md",{"path":140,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":141,"sourceHtmlUrl":142},"references\u002Fworked-examples.md",2907,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Freferences\u002Fworked-examples.md",{"path":144,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":145,"sourceHtmlUrl":146},"skill.usf.yaml",4607,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-alert-automator\u002Fskill.usf.yaml",[148,155,162,169,176,183],{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"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":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"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":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"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":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"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":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"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":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"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",[],[]]