performing-cloud-incident-containment-procedures
在 AWS、Azure 和 GCP 中执行云原生事件遏制,包括隔离受攻陷资源、撤销凭据、保全取证证据,以及应用安全组限制以防止横向移动。
Best use case
performing-cloud-incident-containment-procedures is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
在 AWS、Azure 和 GCP 中执行云原生事件遏制,包括隔离受攻陷资源、撤销凭据、保全取证证据,以及应用安全组限制以防止横向移动。
Teams using performing-cloud-incident-containment-procedures 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/performing-cloud-incident-containment-procedures/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How performing-cloud-incident-containment-procedures Compares
| Feature / Agent | performing-cloud-incident-containment-procedures | 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?
在 AWS、Azure 和 GCP 中执行云原生事件遏制,包括隔离受攻陷资源、撤销凭据、保全取证证据,以及应用安全组限制以防止横向移动。
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
# 执行云事件遏制程序(Performing Cloud Incident Containment Procedures)
## 概述
云事件遏制需要采用与传统本地响应截然不同的云原生方法。遏制程序必须利用平台特定的控制措施,包括安全组、IAM 策略、网络 ACL 和服务级隔离,以限制受攻陷资源同时保全取证证据。2025 年 Unit 42 全球事件响应报告指出,响应云事件需要理解共享责任模型、短暂基础设施和 API 驱动的操作。有效的遏制包括凭据撤销、资源隔离、证据快照创建以及自动化响应 Playbook 执行。
## AWS 遏制程序
### 1. 凭据攻陷遏制
```bash
# 禁用受攻陷 IAM 用户的访问密钥
aws iam update-access-key --user-name compromised-user \
--access-key-id AKIA... --status Inactive
# 列出并禁用用户的所有访问密钥
aws iam list-access-keys --user-name compromised-user
aws iam delete-access-key --user-name compromised-user --access-key-id AKIA...
# 向受攻陷用户附加拒绝所有策略
aws iam put-user-policy --user-name compromised-user \
--policy-name DenyAll \
--policy-document '{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Deny",
"Action": "*",
"Resource": "*"
}]
}'
# 撤销 IAM 角色的所有活跃会话
aws iam put-role-policy --role-name compromised-role \
--policy-name RevokeOldSessions \
--policy-document '{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"DateLessThan": {"aws:TokenIssueTime": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}
}
}]
}'
# 通过更新角色信任策略使临时凭据失效
aws iam update-assume-role-policy --role-name compromised-role \
--policy-document '{"Version":"2012-10-17","Statement":[]}'
```
### 2. EC2 实例隔离
```bash
# 创建隔离安全组(无入站、无出站)
aws ec2 create-security-group --group-name quarantine-sg \
--description "Quarantine - No traffic allowed" --vpc-id vpc-xxxxx
# 删除隔离 SG 的所有规则(默认允许出站)
aws ec2 revoke-security-group-egress --group-id sg-quarantine \
--ip-permissions '[{"IpProtocol":"-1","FromPort":-1,"ToPort":-1,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}]'
# 遏制前先创建取证快照
aws ec2 create-snapshot --volume-id vol-xxxxx \
--description "Forensic snapshot - IR Case 2025-001" \
--tag-specifications 'ResourceType=snapshot,Tags=[{Key=IR-Case,Value=2025-001}]'
# 将隔离安全组应用到受攻陷实例
aws ec2 modify-instance-attribute --instance-id i-xxxxx \
--groups sg-quarantine
# 将实例标记为已攻陷
aws ec2 create-tags --resources i-xxxxx \
--tags Key=IR-Status,Value=Contained Key=IR-Case,Value=2025-001
# 采集内存(如果 SSM Agent 可用)
aws ssm send-command --instance-ids i-xxxxx \
--document-name "AWS-RunShellScript" \
--parameters 'commands=["dd if=/dev/mem of=/tmp/memory.dump bs=1M"]'
```
### 3. S3 存储桶遏制
```bash
# 阻断所有公共访问
aws s3api put-public-access-block --bucket compromised-bucket \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
# 应用拒绝策略到存储桶
aws s3api put-bucket-policy --bucket compromised-bucket \
--policy '{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyAllExceptForensics",
"Effect": "Deny",
"NotPrincipal": {"AWS": "arn:aws:iam::ACCOUNT:role/IR-Forensics"},
"Action": "s3:*",
"Resource": ["arn:aws:s3:::compromised-bucket","arn:aws:s3:::compromised-bucket/*"]
}]
}'
# 启用版本控制以保全证据
aws s3api put-bucket-versioning --bucket compromised-bucket \
--versioning-configuration Status=Enabled
# 为证据保全启用对象锁定
aws s3api put-object-lock-configuration --bucket evidence-bucket \
--object-lock-configuration '{
"ObjectLockEnabled": "Enabled",
"Rule": {"DefaultRetention": {"Mode": "COMPLIANCE", "Days": 365}}
}'
```
### 4. Lambda 函数遏制
```bash
# 将预留并发设置为 0(停止所有调用)
aws lambda put-function-concurrency --function-name compromised-function \
--reserved-concurrent-executions 0
# 删除所有事件源映射
aws lambda list-event-source-mappings --function-name compromised-function
aws lambda delete-event-source-mapping --uuid mapping-uuid
```
## Azure 遏制程序
### 1. 身份遏制
```powershell
# 撤销所有用户会话
Revoke-AzureADUserAllRefreshToken -ObjectId "user-object-id"
# 禁用用户账号
Set-AzureADUser -ObjectId "user-object-id" -AccountEnabled $false
# 重置用户密码
Set-AzureADUserPassword -ObjectId "user-object-id" -Password (
ConvertTo-SecureString "TempP@ss!" -AsPlainText -Force
) -ForceChangePasswordNextLogin $true
# 通过条件访问阻断登录(紧急策略)
# 创建策略阻止用户访问所有云应用
# 撤销 Azure AD 应用授权
Remove-AzureADServiceAppRoleAssignment -ObjectId "sp-object-id" \
-AppRoleAssignmentId "assignment-id"
```
### 2. VM 隔离
```powershell
# 创建带拒绝所有规则的网络安全组
$nsg = New-AzNetworkSecurityGroup -ResourceGroupName "rg" -Location "eastus" `
-Name "quarantine-nsg" `
-SecurityRules @(
New-AzNetworkSecurityRuleConfig -Name "DenyAllInbound" -Protocol * `
-Direction Inbound -Priority 100 -SourceAddressPrefix * `
-SourcePortRange * -DestinationAddressPrefix * `
-DestinationPortRange * -Access Deny,
New-AzNetworkSecurityRuleConfig -Name "DenyAllOutbound" -Protocol * `
-Direction Outbound -Priority 100 -SourceAddressPrefix * `
-SourcePortRange * -DestinationAddressPrefix * `
-DestinationPortRange * -Access Deny
)
# 创建取证磁盘快照
$vm = Get-AzVM -ResourceGroupName "rg" -Name "compromised-vm"
$snapshotConfig = New-AzSnapshotConfig -SourceUri $vm.StorageProfile.OsDisk.ManagedDisk.Id `
-Location "eastus" -CreateOption Copy
New-AzSnapshot -ResourceGroupName "rg" -SnapshotName "forensic-snap" -Snapshot $snapshotConfig
# 将隔离 NSG 应用到 VM NIC
$nic = Get-AzNetworkInterface -ResourceGroupName "rg" -Name "compromised-nic"
$nic.NetworkSecurityGroup = $nsg
Set-AzNetworkInterface -NetworkInterface $nic
```
### 3. 存储账号遏制
```powershell
# 删除网络访问
Update-AzStorageAccountNetworkRuleSet -ResourceGroupName "rg" `
-Name "storageaccount" -DefaultAction Deny
# 重新生成访问密钥
New-AzStorageAccountKey -ResourceGroupName "rg" -Name "storageaccount" -KeyName key1
New-AzStorageAccountKey -ResourceGroupName "rg" -Name "storageaccount" -KeyName key2
# 通过轮换密钥撤销所有 SAS 令牌
# 为证据保全启用不可变性
```
## GCP 遏制程序
### 1. IAM 遏制
```bash
# 删除受攻陷服务账号的所有 IAM 绑定
gcloud projects get-iam-policy PROJECT_ID --format=json > policy.json
# 编辑 policy.json 删除受攻陷账号的绑定
gcloud projects set-iam-policy PROJECT_ID policy.json
# 禁用服务账号
gcloud iam service-accounts disable SA_EMAIL
# 删除服务账号密钥
gcloud iam service-accounts keys list --iam-account SA_EMAIL
gcloud iam service-accounts keys delete KEY_ID --iam-account SA_EMAIL
```
### 2. 计算实例隔离
```bash
# 创建取证快照
gcloud compute disks snapshot compromised-disk \
--snapshot-names forensic-snap-$(date +%Y%m%d) \
--zone us-central1-a
# 应用防火墙规则拒绝所有流量
gcloud compute firewall-rules create quarantine-deny-all \
--network default --action DENY --rules all \
--target-tags quarantine --priority 0
# 标记受攻陷实例
gcloud compute instances add-tags compromised-instance \
--tags quarantine --zone us-central1-a
# 删除外部 IP
gcloud compute instances delete-access-config compromised-instance \
--access-config-name "External NAT" --zone us-central1-a
```
## 证据保全最佳实践
1. **遏制前始终创建快照** - 在网络隔离前创建磁盘/卷快照
2. **保全 CloudTrail/活动日志** - 将日志复制到写保护存储
3. **记录所有操作** - 为每个遏制步骤添加时间戳
4. **使用紧急访问程序** - 为 IR 团队预先建立紧急访问
5. **维护取证证据链** - 对所有证据产物计算哈希
## MITRE ATT&CK 云技术
| 技术 | 遏制措施 |
|------|----------|
| T1078 - 有效账号 | 禁用账号、撤销令牌 |
| T1530 - 云存储数据 | 锁定存储桶/存储策略 |
| T1537 - 转移到云账号 | 阻断跨账号访问 |
| T1578 - 修改云计算 | 隔离实例、快照磁盘 |
| T1552 - 不安全凭据 | 轮换所有访问密钥和 Secret |
## 参考资料
- Sygnia:云事件响应最佳实践
- Unit 42:响应云事件
- Wiz:云事件响应检查清单
- Microsoft 云安全基准 - IRRelated Skills
triaging-security-incident
使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初始分类,确定严重性、范围和所需响应行动。 按类型对事件分类,根据业务影响分配优先级,并路由到相应的响应团队。适用于事件分类、 安全告警分类、严重性评估、事件优先级排序或初始事件分析等请求场景。
triaging-security-incident-with-ir-playbook
使用结构化 IR Playbook 对安全事件进行分类和优先排序,确定严重性、分配响应团队并启动适当的响应程序。
securing-kubernetes-on-cloud
本技能涵盖通过实施 Pod 安全标准(Pod Security Standards)、网络策略、工作负载身份、RBAC 权限控制、镜像准入控制和运行时安全监控,对 EKS、AKS 和 GKE 上的托管 Kubernetes 集群进行加固。涉及云平台特定安全功能,包括 EKS 的 IRSA、GKE 的工作负载身份(Workload Identity)以及 AKS 的托管身份(Managed Identity)。
performing-yara-rule-development-for-detection
通过识别可执行文件中的唯一字节模式、字符串和行为指标,开发精准的 YARA 恶意软件检测规则,同时将误报率降至最低。
performing-wireless-security-assessment-with-kismet
使用 Kismet 通过被动射频监控进行无线网络安全评估,检测流氓接入点(Rogue AP)、隐藏 SSID、弱加密和未授权客户端。
performing-wireless-network-penetration-test
执行无线网络渗透测试,通过捕获握手包、破解 WPA2/WPA3 密钥、检测流氓接入点以及使用 Aircrack-ng 和相关工具测试无线网络分段,评估 WiFi 安全性。
performing-windows-artifact-analysis-with-eric-zimmerman-tools
使用 Eric Zimmerman 的开源 EZ Tools 套件(包括 KAPE、MFTECmd、PECmd、LECmd、JLECmd 和 Timeline Explorer)执行全面的 Windows 取证制品分析,解析注册表 hive、预取文件、事件日志和文件系统元数据。
performing-wifi-password-cracking-with-aircrack
在授权无线安全评估中捕获 WPA/WPA2 握手包,并使用 aircrack-ng、hashcat 和字典攻击进行离线密码破解, 以评估密码短语强度和无线网络安全状况。
performing-web-cache-poisoning-attack
在授权安全测试期间,通过未纳入缓存键的头部和参数毒化缓存响应,利用 Web 缓存机制向其他用户投递恶意内容。
performing-web-cache-deception-attack
通过利用 CDN 缓存层与源服务器之间的路径规范化差异,执行 Web 缓存欺骗攻击,从而缓存并获取敏感的已认证内容。
performing-web-application-vulnerability-triage
使用 OWASP 风险评级方法论对 DAST/SAST 扫描器的 Web 应用程序漏洞发现进行分类,区分真阳性和假阳性,并确定修复优先级。
performing-web-application-scanning-with-nikto
Nikto 是一款开源 Web 服务器和 Web 应用程序扫描器,可针对超过 7,000 个潜在危险文件/程序进行测试,检查超过 1,250 个服务器的过期版本,并识别超过 270 个服务器的版本特定问题。