detecting-aws-cloudtrail-anomalies
使用 boto3、统计基线和行为分析检测 AWS CloudTrail 日志中的异常 API 调用模式,以识别凭据入侵、权限提升和未授权资源访问。
Best use case
detecting-aws-cloudtrail-anomalies is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
使用 boto3、统计基线和行为分析检测 AWS CloudTrail 日志中的异常 API 调用模式,以识别凭据入侵、权限提升和未授权资源访问。
Teams using detecting-aws-cloudtrail-anomalies should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/detecting-aws-cloudtrail-anomalies/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How detecting-aws-cloudtrail-anomalies Compares
| Feature / Agent | detecting-aws-cloudtrail-anomalies | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
使用 boto3、统计基线和行为分析检测 AWS CloudTrail 日志中的异常 API 调用模式,以识别凭据入侵、权限提升和未授权资源访问。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 检测 AWS CloudTrail 异常 ## 概述 AWS CloudTrail 记录跨 AWS 服务的 API 调用。本 skill 涵盖使用 boto3 的 `lookup_events` API 查询 CloudTrail 事件、构建正常 API 活动的统计基线、检测异常(如不寻常的事件来源、地理位置异常、高频 API 调用以及首次 API 使用模式),这些模式可指示凭据入侵或内部威胁。 ## 前置条件 - Python 3.9+ 及 `boto3` 库 - 具有 CloudTrail 读取权限(cloudtrail:LookupEvents)的 AWS 凭据 - 了解 AWS IAM 和常见 API 模式 - 在目标 AWS 账户中启用了 CloudTrail(至少管理事件) ## 工作流程 ### 步骤 1:查询 CloudTrail 事件 使用 boto3 CloudTrail 客户端的 lookup_events 通过分页检索最近的 API 活动。 ### 步骤 2:构建活动基线 按用户、源 IP、事件来源和事件名称聚合事件,以建立正常行为模式。 ### 步骤 3:检测异常 标记异常模式:每个用户的新事件来源、首次 API 调用、地理 IP 变化、高错误率以及敏感 API 使用(IAM、KMS、S3 策略变更)。 ### 步骤 4:生成检测报告 生成包含异常评分、最可疑用户和建议调查操作的 JSON 报告。 ## 输出格式 包含事件统计、基线偏差、异常用户/IP、敏感 API 调用和错误率分析的 JSON 报告。
Related Skills
performing-cloud-forensics-with-aws-cloudtrail
使用 CloudTrail 日志对 AWS 环境执行取证调查,重建攻击者活动、识别受损凭据并分析 API 调用模式。
detecting-wmi-persistence
通过分析 Sysmon 事件 ID 19、20 和 21 中的恶意 EventFilter、EventConsumer 和 FilterToConsumerBinding 创建,检测 WMI 事件订阅持久化。
detecting-t1548-abuse-elevation-control-mechanism
通过监控注册表修改、进程提升标志和异常的父子进程关系,检测提升控制机制滥用,包括 UAC 绕过、sudo 利用和 setuid/setgid 操纵。
detecting-t1055-process-injection-with-sysmon
通过分析 Sysmon 事件中的跨进程内存操作、远程线程创建和异常 DLL 加载模式,检测进程注入技术(T1055),包括经典 DLL 注入、进程镂空和 APC 注入。
detecting-t1003-credential-dumping-with-edr
利用 EDR 遥测数据、Sysmon 进程访问监控和 Windows 安全事件关联,检测针对 LSASS 内存、SAM 数据库、NTDS.dit 和缓存凭据的 OS 凭据转储技术。
detecting-suspicious-powershell-execution
检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。
detecting-suspicious-oauth-application-consent
使用 Microsoft Graph API、审计日志和权限分析,检测 Azure AD / Microsoft Entra ID 中的高风险 OAuth 应用授权同意,识别非法同意授权攻击。
detecting-supply-chain-attacks-in-ci-cd
扫描 GitHub Actions 工作流和 CI/CD 流水线配置,检测供应链攻击(Supply Chain Attack)向量, 包括未固定的 Action 版本、通过表达式的脚本注入、依赖混淆(Dependency Confusion)和密钥泄露。 使用 PyGithub 和 YAML 解析进行自动化审计。适用于加固 CI/CD 流水线或调查被攻击的构建系统。
detecting-stuxnet-style-attacks
本技能涵盖检测遵循Stuxnet攻击模式的复杂网络物理攻击——在修改PLC逻辑的同时欺骗传感器读数以向操作员隐藏操控行为。内容涉及PLC逻辑完整性监控、基于物理的过程异常检测、工程师工作站入侵指标、USB传播攻击向量,以及从IT到OT横向移动直至过程操控的多阶段攻击链检测。
detecting-sql-injection-via-waf-logs
分析 WAF(Web 应用防火墙,ModSecurity/AWS WAF/Cloudflare)日志,检测 SQL 注入(SQL Injection)攻击活动。 解析 ModSecurity 审计日志和 JSON WAF 事件日志,识别 SQLi 模式(UNION SELECT、OR 1=1、SLEEP()、BENCHMARK()), 追踪攻击源,关联多阶段注入尝试,并生成带 OWASP 分类的事件报告。
detecting-spearphishing-with-email-gateway
鱼叉式网络钓鱼(Spearphishing)使用个性化、经过研究的内容针对特定个人,可绕过通用垃圾邮件过滤器。邮件安全网关(SEG)如 Microsoft Defender for Office 365、Proofpoint、Mimecast 和 Barracuda 提供高级检测能力,包括行为分析、URL 引爆、附件沙箱和冒充检测。本技能涵盖配置这些网关以检测和拦截定向钓鱼攻击。
detecting-shadow-it-cloud-usage
通过使用 Python pandas 分析代理日志、DNS 查询日志和网络流数据,进行流量模式分析和域名分类,检测未授权的 SaaS 和云服务使用(影子 IT)。