New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Analyzing API Gateway Access Logs

Free

Detect security threats in API access logs effectively.

Get this skill

Free · Opens the source repo

What Analyzing API Gateway Access Logs does

This skill is designed for security professionals and developers who need to analyze API Gateway access logs from platforms like AWS API Gateway, Kong, and Nginx. It focuses on identifying various attack patterns that can compromise API security, such as Broken Object Level Authorization (BOLA), excessive data exposure, and injection attempts. By leveraging Python and the pandas library, the skill provides a structured approach to parsing logs and detecting anomalies in request patterns.

Users can implement this skill when investigating security incidents or when building detection rules for API-specific threats. The skill includes practical code examples that demonstrate how to parse JSON log files and identify suspicious activities, such as a high number of 401 status codes indicating potential credential scanning. It also highlights key detection patterns, allowing users to focus their analysis on the most critical security concerns.

For optimal use, users should have a foundational understanding of security operations and access to a controlled environment for testing. The skill is particularly valuable for Security Operations Center (SOC) analysts who require structured procedures for log analysis and validation of security monitoring coverage. It serves as a practical tool for enhancing API security and ensuring robust threat detection mechanisms are in place.

Overall, this skill empowers users to proactively address security vulnerabilities in their APIs by providing the necessary tools and methodologies for effective log analysis and threat detection.

When to use it

Use this skill when conducting security investigations or developing detection rules for API threats.

When not to use it

This skill may not be suitable for users unfamiliar with Python or those without access to relevant API logs for analysis.

What you can build with it

Investigating API Abuse

Use this skill to analyze logs when investigating incidents of API abuse, helping to identify the nature and source of the attack.

Building Detection Rules

Implement this skill to create tailored detection rules for API-specific threats, enhancing your security posture.

Validating Security Coverage

Utilize the skill to ensure your security monitoring is comprehensive by analyzing logs for common attack techniques.

How to install Analyzing API Gateway Access Logs

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/analyzing-api-gateway-access-logs --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Analyzing API Gateway Access Logs

When to Use

  • When investigating security incidents that require analyzing api gateway access logs
  • 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

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

Parse API gateway access logs to identify attack patterns including broken object level authorization (BOLA), excessive data exposure, and injection attempts.

import pandas as pd

df = pd.read_json("api_gateway_logs.json", lines=True)
# Detect BOLA: same user accessing many different resource IDs
bola = df.groupby(["user_id", "endpoint"]).agg(
    unique_ids=("resource_id", "nunique")).reset_index()
suspicious = bola[bola["unique_ids"] > 50]

Key detection patterns:

  1. BOLA/IDOR: sequential resource ID enumeration
  2. Rate limit bypass via header manipulation
  3. Credential scanning (401 surges from single source)
  4. SQL/NoSQL injection in query parameters
  5. Unusual HTTP methods (DELETE, PATCH) on read-only endpoints

Examples

# Detect 401 surges indicating credential scanning
auth_failures = df[df["status_code"] == 401]
scanner_ips = auth_failures.groupby("source_ip").size()
scanners = scanner_ips[scanner_ips > 100]

Frequently asked questions about Analyzing API Gateway Access Logs

Similar skills