detecting-aws-cloudtrail-anomalies
What it does
This tool helps find strange activities in your AWS account's call logs. It looks for unusual patterns that might indicate your credentials have been compromised or someone is accessing resources without permission.
When to use it
- ✓When you suspect your AWS credentials have been stolen.
- ✓To investigate unauthorized access to AWS resources.
- ✓When building alert systems for AWS security activities.
Skill link
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-aws-cloudtrail-anomalies/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Look for suspicious activity in AWS logs from the past 24 hours.”
5 new skills a week. 1 minute to read.
How it works
The tool first collects all recent AWS API calls. Then, it learns what normal behavior looks like by observing who does what, from where, and how often. Finally, it compares current activities against normal behavior to find and report anything out of the ordinary.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Detecting AWS CloudTrail Anomalies
Overview
AWS CloudTrail records API calls across AWS services. This skill covers querying CloudTrail events with boto3's lookup_events API, building statistical baselines of normal API activity, detecting anomalies such as unusual event sources, geographic anomalies, high-frequency API calls, and first-time API usage patterns that indicate compromised credentials or insider threats.
When to Use
- When investigating security incidents that require detecting aws cloudtrail anomalies
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Python 3.9+ with
boto3library - AWS credentials with CloudTrail read permissions (cloudtrail:LookupEvents)
- Understanding of AWS IAM and common API patterns
- CloudTrail enabled in target AWS account (management events at minimum)
Steps
Step 1: Query CloudTrail Events
Use boto3 CloudTrail client's lookup_events to retrieve recent API activity with pagination.
Step 2: Build Activity Baseline
Aggregate events by user, source IP, event source, and event name to establish normal behavior patterns.
Step 3: Detect Anomalies
Flag unusual patterns: new event sources per user, first-time API calls, geographic IP changes, high error rates, and sensitive API usage (IAM, KMS, S3 policy changes).
Step 4: Generate Detection Report
Produce a JSON report with anomaly scores, top suspicious users, and recommended investigation actions.
Expected Output
JSON report with event statistics, baseline deviations, anomalous users/IPs, sensitive API calls, and error rate analysis.
FAQ
What are 'API calls' in AWS?
These are the commands you or other services send to interact with AWS services, like creating a server or storing a file.
What does 'baseline' mean?
A baseline is a record of normal behavior. It's like creating a profile of what's typical so we can spot what's atypical.
What kinds of problems can this tool detect?
It can detect the use of stolen credentials, attempts to gain more permissions than usual (privilege escalation), and unauthorized resource access.
Details
Original description by the author
Detect unusual API call patterns in AWS CloudTrail logs using boto3, statistical baselining, and behavioral analysis to identify credential compromise, privilege escalation, and unauthorized resource access.
Popularity
- GitHub stars
- 35k
- Ranking position
- #7797
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
35kGives your AI agent ready-made instructions for a specific task, so it does it better and faster.
abusing-shadow-credentials-for-privesc
35kTeaches your AI agent to write clear, well-structured text.
achieving-cmmc-level-2-compliance
35kHelps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
acquiring-disk-image-with-dd-and-dcfldd
35kHelps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.