API Gateway Access Log Analysis

VerifiedSafe

Detect API attacks like BOLA, credential scanning, and injection from gateway access logs using Python analysis.

Sby Skills Guide Bot
SecurityIntermediate
8/29/2026
Claude CodeCursorCodex
#api-security#log-analysis#bola-detection#threat-detection#security-operations

Recommended for

Automated summary

Parses API gateway access logs (AWS API Gateway, Kong, Nginx) with pandas to surface abuse patterns such as BOLA/IDOR, rate limit bypass, and credential scanning.

Strengths

  • Provides directly reusable pandas snippets for BOLA grouping and 401 surge detection
  • Covers several common gateways (AWS API Gateway, Kong, Nginx) under one approach
  • Lists concrete detection patterns: ID enumeration, header manipulation, SQL/NoSQL injection, unusual HTTP methods
  • Maps to MITRE ATT&CK and NIST CSF for integration into SOC programs

Limitations

  • Assumes logs already contain structured fields like user_id, endpoint, and resource_id
  • Provided thresholds (>50 unique IDs, >100 401s) are uncalibrated examples
  • No ingestion pipeline or per-gateway format handling included
When to use it

Use when investigating API abuse or building API-specific detection rules from existing access logs.

When not to use it

Avoid if you lack structured API access logs or need ready-to-deploy WAF rules rather than analysis guidance.

Security analysis

Safe
Quality score78/100

This is a defensive security analytics skill that parses local API gateway access log files using pandas. It contains no shell commands, network exfiltration, destructive operations, obfuscated payloads, or attempts to disable safety controls. The only execution risk is standard local data processing, which is appropriate for the stated security-operations purpose.

No concerns found

How this analysis is made

Examples

Investigate suspected BOLA
Here are our AWS API Gateway access logs in JSON lines format. Write a pandas script to detect users enumerating resource IDs on the same endpoint and flag likely BOLA/IDOR activity.
Detect credential scanning
Analyze these Kong access logs and identify source IPs generating 401 surges that suggest credential scanning or brute force.
Build API detection rules
Based on our Nginx API access logs, suggest detection rules for rate limit bypass via header manipulation and injection attempts in query parameters.

name: analyzing-api-gateway-access-logs description: 'Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect BOLA/IDOR attacks, rate limit bypass, credential scanning, and injection attempts. Uses pandas for statistical analysis of request patterns and anomaly detection. Use when investigating API abuse or building API-specific threat detection rules.

' domain: cybersecurity subdomain: security-operations tags:

  • api-security
  • access-log-analysis
  • aws-api-gateway
  • kong
  • nginx
  • bola-detection
  • rate-limit-bypass
  • security-operations version: '1.0' author: mahipal license: Apache-2.0 nist_csf:
  • DE.CM-01
  • RS.MA-01
  • GV.OV-01
  • DE.AE-02 mitre_attack:
  • T1190
  • T1110.004
  • T1078.004
  • T1119

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]

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/api-gateway-access-log-analysis-mte1lj1l/download' --output '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md.part' && mv '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md.part' '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: 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

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md' && test -s '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/analyzing-api-gateway-access-logs' && cp -R '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l' '.claude/skills/analyzing-api-gateway-access-logs'

Cursor
test -f '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md' && test -s '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/analyzing-api-gateway-access-logs' && cp -R '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l' '.cursor/skills/analyzing-api-gateway-access-logs'

Codex
test -f '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md' && test -s '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/analyzing-api-gateway-access-logs' && cp -R '.skill-downloads/api-gateway-access-log-analysis-mte1lj1l' '.agents/skills/analyzing-api-gateway-access-logs'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/api-gateway-access-log-analysis-mte1lj1l'

openskills read 'api-gateway-access-log-analysis-mte1lj1l'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/api-gateway-access-log-analysis-mte1lj1l/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills