跳到正文
FunCoding

aws-security-audit

AWS security auditing — IAM users/roles/policies, CloudTrail API events, security posture analysis. Use when auditing IAM permissions, investigating security incidents, checking MFA compliance, or tracing API activity in CloudTrail.

Star
740
分类
安全
许可证
Apache-2.0
最近提交
2026年11月30日

workspace/skills/aws-security-audit/SKILL.md

在 GitHub 上查看

AWS Security Audit

MCP Servers

  • IAM MCP: uvx awslabs.iam-mcp-server@latest --readonly (stdio transport)
  • CloudTrail MCP: uvx awslabs.cloudtrail-mcp-server@latest (stdio transport)
  • Requires: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION (or AWS_PROFILE)

Key Capabilities

IAM (Identity & Access Management)

  • Users: List IAM users, access keys, MFA status, last activity
  • Roles: List roles, trust policies, attached permissions
  • Policies: Inspect policy documents, identify overly permissive policies
  • Groups: List groups and their memberships
  • Read-only mode: --readonly flag prevents any IAM modifications

CloudTrail (API Audit Trail)

  • Event history: Search recent API calls by user, service, or resource
  • Lookup events: Filter by event name, resource type, username
  • Time-based queries: Narrow to specific time windows around incidents
  • Multi-region: Trail events across all enabled regions

Workflow: Network Security Audit

When a user asks "audit our AWS network security":

  1. IAM roles for network services: Check roles used by VPC, TGW, Network Firewall
  2. Overly permissive policies: Find policies with ec2:* or *:* actions
  3. Unused access keys: Identify stale credentials that should be rotated
  4. MFA compliance: Check which users lack MFA
  5. CloudTrail check: Recent AuthorizeSecurityGroupIngress, CreateNetworkAcl, ModifyVpcAttribute events
  6. Report: Security posture summary with remediation recommendations

Workflow: Incident Investigation

When investigating a security event:

  1. CloudTrail lookup: Search events by time window and suspected user/role
  2. Identify actions: What API calls were made? DeleteSecurityGroup, ModifySubnetAttribute?
  3. Source IP: Where did the API calls originate from?
  4. IAM context: What permissions does the user/role have? Should they?
  5. Blast radius: What resources were affected?
  6. Report: Timeline of events with impact assessment

Workflow: Compliance Check

When checking AWS security compliance:

  1. Root account: Check for root access key usage in CloudTrail
  2. MFA enforcement: List users without MFA enabled
  3. Access key rotation: Find keys older than 90 days
  4. Unused credentials: Identify users with no recent activity
  5. Policy review: Check for policies granting * on sensitive services
  6. Report: Compliance scorecard with findings

Common CloudTrail Network Events

Event NameWhat It Means
AuthorizeSecurityGroupIngressSecurity group rule added (inbound)
AuthorizeSecurityGroupEgressSecurity group rule added (outbound)
RevokeSecurityGroupIngressSecurity group rule removed (inbound)
CreateNetworkAclEntryNACL rule added
CreateRouteRoute table entry added
ModifyVpcAttributeVPC setting changed
CreateVpnConnectionNew VPN tunnel created
AttachInternetGatewayIGW attached to VPC
CreateTransitGatewayRouteTGW route added
UpdateFirewallRuleGroupRuleListNetwork Firewall rule changed

IAM Best Practices for Network Teams

CheckWhy It Matters
No ec2:* policiesPrevent accidental network changes
Separate roles per serviceLeast privilege for VPC, TGW, Firewall
MFA on all humansProtect against credential theft
No root access keysRoot should use MFA console only
Key rotation < 90 daysLimit exposure of compromised keys
CloudTrail enabledAudit trail for all API changes

Important Rules

  • IAM MCP runs in read-only mode — cannot create, modify, or delete IAM resources
  • CloudTrail has event history limits — default 90-day lookback for management events
  • Region-specific for CloudTrail — unless using organization trail
  • Record in GAIT — log all security investigations for audit trail

Environment Variables

  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION (or AWS_PROFILE)

Failure Behavior

  • On a tool error (timeout, unreachable host, malformed response), report the failure and its error message directly to the user rather than fabricating or guessing at results.
  • For a confirmed read-only call, check connectivity and retry once if appropriate. For any call that changes state or sends a message, a timeout does not prove the action failed: inspect current state or delivery status before retrying, preserve the required approval/change gates, and do not repeat an action whose outcome is unknown.

相似的 Skill

agent-security-hardening

AFaffaan-m/ECC314k近 7 天新增 3,503 个 star

精选

ponytail-audit

审计整个代码库,找出 bug、安全漏洞和性能瓶颈,获得按重要性排序的通俗报告。

DIDietrichGebert/ponytail202k近 7 天新增 4,226 个 star

gstack

GAgarrytan/gstack143k近 7 天新增 524 个 star

精选

security-and-hardening

按 OWASP Top 10 检查输入处理、登录和依赖,加固代码。

ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star

doubt-driven-development

ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star

ruview-rvagent

RUruvnet/RuView106k近 7 天新增 596 个 star