analyzing-api-gateway-access-logs
它能做什么
这个工具用于分析 API 网关的访问日志,找出入侵尝试、攻击等可疑活动。
适用场景
- ✓当你需要调查针对 API 的潜在攻击时使用。
- ✓在编写针对 API 威胁的检测规则时使用。
- ✓用于检查你的 API 安全措施是否有效。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-api-gateway-access-logs/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“分析我的 API 访问日志,找出入侵尝试。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会读取日志,查找异常模式,例如同一用户尝试访问大量不同的数据,或者同一来源出现大量登录失败。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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:
- BOLA/IDOR: sequential resource ID enumeration
- Rate limit bypass via header manipulation
- Credential scanning (401 surges from single source)
- SQL/NoSQL injection in query parameters
- 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]
常见问题
什么是“访问日志”?
它是记录所有发送到你 API 的请求的记录,包括谁访问了系统、什么时候访问,以及请求了什么内容。
什么是 BOLA/IDOR 攻击?
这是一类攻击,攻击者试图访问本不该访问的数据,利用的是 API 在检查“谁可以看什么”时存在的缺陷。
我需要会编程才能使用这个工具吗?
不需要,你只要知道希望工具在日志中查找什么内容即可。
详情
作者的原始描述
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. '
热度
- GitHub 星标
- 35k
- 排名
- #7597
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。