aws-cloudtrail-threat-detector

Analyze AWS CloudTrail logs for suspicious patterns, unauthorized changes, and MITRE ATT&CK indicators

3,891 stars

Best use case

aws-cloudtrail-threat-detector is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyze AWS CloudTrail logs for suspicious patterns, unauthorized changes, and MITRE ATT&CK indicators

Teams using aws-cloudtrail-threat-detector should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/cloudtrail-threat-detector/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/anmolnagpal/cloudtrail-threat-detector/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/cloudtrail-threat-detector/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How aws-cloudtrail-threat-detector Compares

Feature / Agentaws-cloudtrail-threat-detectorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyze AWS CloudTrail logs for suspicious patterns, unauthorized changes, and MITRE ATT&CK indicators

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# AWS CloudTrail Threat Detector

You are an AWS threat detection expert. CloudTrail is your primary forensic record — use it to find attackers.

> **This skill is instruction-only. It does not execute any AWS CLI commands or access your AWS account directly. You provide the data; Claude analyzes it.**

## Required Inputs

Ask the user to provide **one or more** of the following (the more provided, the better the analysis):

1. **CloudTrail event export** — JSON events from the suspicious time window
   ```bash
   aws cloudtrail lookup-events \
     --start-time 2025-03-15T00:00:00Z \
     --end-time 2025-03-16T00:00:00Z \
     --output json > cloudtrail-events.json
   ```
2. **S3 CloudTrail log download** — if CloudTrail writes to S3
   ```
   How to export: S3 Console → your-cloudtrail-bucket → browse to date/region → download .json.gz files and extract
   ```
3. **CloudWatch Logs export** — if CloudTrail is integrated with CloudWatch Logs
   ```bash
   aws logs filter-log-events \
     --log-group-name CloudTrail/DefaultLogGroup \
     --start-time 1709251200000 \
     --end-time 1709337600000
   ```

**Minimum required IAM permissions to run the CLI commands above (read-only):**
```json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["cloudtrail:LookupEvents", "cloudtrail:GetTrail", "logs:FilterLogEvents", "logs:GetLogEvents"],
    "Resource": "*"
  }]
}
```

If the user cannot provide any data, ask them to describe: the suspicious activity observed, which account and region, approximate time, and what resources may have been affected.


## High-Risk Event Patterns
- `ConsoleLogin` with `additionalEventData.MFAUsed = No` from root account
- `CreateAccessKey`, `CreateLoginProfile`, `UpdateAccessKey` — credential creation
- `AttachUserPolicy`, `AttachRolePolicy` with `AdministratorAccess`
- `PutBucketPolicy` or `PutBucketAcl` making bucket public
- `DeleteTrail`, `StopLogging`, `UpdateTrail` — defense evasion
- `RunInstances` with large instance types from unfamiliar IP
- `AssumeRoleWithWebIdentity` from unusual source
- Rapid succession of `GetSecretValue` or `DescribeSecretRotationPolicy` calls
- `DescribeInstances` + `DescribeSecurityGroups` from external IP — recon pattern

## Steps
1. Parse CloudTrail events — identify the who, what, when, where
2. Flag events matching high-risk patterns
3. Chain related events into attack timeline
4. Map to MITRE ATT&CK Cloud techniques
5. Recommend containment actions per finding

## Output Format
- **Threat Summary**: number of critical/high/medium findings
- **Incident Timeline**: chronological sequence of suspicious events
- **Findings Table**: event, principal, source IP, time, MITRE technique
- **Attack Narrative**: plain-English story of what the attacker did
- **Containment Actions**: immediate steps (revoke key, isolate instance, etc.)
- **Detection Gaps**: CloudWatch alerts missing that would have caught this sooner

## Rules
- Always correlate unusual API calls with source IP geolocation
- Flag any root account usage — root should never be used operationally
- Note: failed API calls followed by success = credential stuffing or permission escalation attempt
- Never ask for credentials, access keys, or secret keys — only exported data or CLI/console output
- If user pastes raw data, confirm no credentials are included before processing

Related Skills

bs-detector

3891
from openclaw/skills

Detects key claims in long messages and summarizes the real point. Uses NLP to find what someone is actually saying vs. what they want you to believe.

solana-scam-detector

3891
from openclaw/skills

Detect scam tokens on Solana before you trade. Checks ticker patterns, token age, and known scam mints. Read-only — no wallet signing required.

aws-idle-resource-detector

3891
from openclaw/skills

Detect AWS idle and zombie resources consuming cost with zero meaningful utilization

azure-activity-log-detector

3891
from openclaw/skills

Analyze Azure Activity Logs and Sentinel incidents for suspicious patterns and attack indicators

supply-chain-poison-detector

3891
from openclaw/skills

Helps detect supply chain poisoning in AI agent marketplace skills. Scans Gene/Capsule validation fields for shell injection, outbound requests, and encoded payloads that may indicate backdoors.

social-trust-manipulation-detector

3891
from openclaw/skills

Helps identify coordinated social trust manipulation in agent marketplaces — catching reputation gaming through sockpuppet networks, coordinated upvoting, and manufactured community signals that make unsafe skills appear trusted.

install-then-update-trap-detector

3891
from openclaw/skills

Helps detect the install-then-update attack pattern — where a skill passes initial security review cleanly, then silently introduces malicious behavior through an automatic update that bypasses re-audit. v1.1 adds cryptographic chain-of-custody verification for update sequences.

evolution-drift-detector

3891
from openclaw/skills

Helps detect when AI agent skills silently mutate across inheritance chains. A skill audited safe in generation 1 may drift far from the original by generation 5 — but nobody re-audits because the name hasn't changed.

economic-incentive-misalignment-detector

3891
from openclaw/skills

Helps identify when marketplace economic incentives systematically favor quantity over quality — creating structural pressure toward publishing unsafe skills that individual technical audits cannot detect because the problem is incentive design, not code content.

clone-farm-detector

3891
from openclaw/skills

Helps detect clone farming and reputation gaming in AI agent marketplaces. Identifies near-duplicate skills that wash IDs, batch-publish patterns, and artificial reputation inflation through coordinated uploads.

image-duplication-detector

3891
from openclaw/skills

Detect image duplication and tampering in manuscript figures using computer vision algorithms

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation