Skip to content
Skillpedia
Agents35k · #5634

detecting-aws-cloudtrail-anomalies

Helps your agent identify suspicious activities in AWS CloudTrail logs, such as unauthorized access or credential theft.

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.

Example of what to ask your AI

“Look for suspicious activity in AWS logs from the past 24 hours.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-aws-cloudtrail-anomalies/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-aws-cloudtrail-anomalies/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
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.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill detecting-aws-cloudtrail-anomalies

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/detecting-aws-cloudtrail-anomalies/SKILL.md -o SKILL.md
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 boto3 library
  • 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.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5634
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills