Skip to main content
NEW · APP STORE Now on iOS · macOS · iPad Android & Windows soon GET IT
Prompts API Gateway Access Log Attack Analyzer

analyst security skill risk: medium

API Gateway Access Log Attack Analyzer

Parses API Gateway access logs to detect BOLA/IDOR attacks, rate limit bypass, credential scanning, and injection attempts, with Python pandas examples for grouping and filtering s…

SKILL 4 files · 2 folders

SKILL.md
---
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,"
---
# 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.

```python
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

```python
# 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]
```

REQUIRED CONTEXT

  • api_gateway_access_logs

EXPECTED OUTPUT

Format
markdown
Constraints
  • include Python code snippets
  • list key detection patterns

EXAMPLES

Includes two Python code snippets demonstrating BOLA detection and credential scanning analysis.

CAVEATS

Dependencies
  • api_gateway_logs.json file
  • Python 3.8+ with pandas
Missing context
  • Exact expected output format or report structure
  • Full list of required log fields/columns
  • Handling instructions for different log sources (AWS vs Kong vs Nginx)
Ambiguities
  • Description field is truncated/incomplete ("rate limit bypass,")
  • Code assumes specific log JSON schema/column names without defining them

QUALITY

OVERALL
0.65
CLARITY
0.75
SPECIFICITY
0.70
REUSABILITY
0.60
COMPLETENESS
0.55

IMPROVEMENT SUGGESTIONS

  • Complete the truncated description sentence
  • Add a required 'Output Format' section specifying the desired analysis report structure
  • Include placeholder variables or a schema definition for input log fields

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR ANALYST