| name | cloud-detection-response |
| description | Guide complet de détection et réponse aux incidents cloud — GuardDuty, Security Hub, Security Command Center, Defender for Cloud, Sentinel, CloudTrail, Audit Logs, SIEM integration, forensic cloud, playbooks IR |
| category | cybersecurite |
Cloud Detection & Incident Response
1. AWS — Detection & Monitoring
AWS GuardDuty
aws guardduty create-detector --enable --finding-publishing-frequency FIFTEEN_MINUTES
aws guardduty list-findings --detector-id <id>
aws guardduty get-findings --detector-id <id> --finding-ids <ids> --output json
aws guardduty update-filter --detector-id <id> --filter-name auto-mute --finding-criteria '{"Criterion":{"severity":{"Gte":1,"Lte":4}}}'
AWS Security Hub
aws securityhub enable-security-hub --enable-standards "arn:aws:securityhub:us-east-1::standards/aws-foundational-security-best-practices/v/1.0.0"
aws securityhub get-findings --filters '{"SeverityLabel":[{"Value":"CRITICAL","Comparison":"EQUALS"}],"ComplianceStatus":[{"Value":"FAILED","Comparison":"EQUALS"}]}'
aws securityhub create-action-target --name "Create Jira Ticket" --description "Create Jira" --id "create-jira"
AWS CloudTrail
aws cloudtrail create-trail --name org-trail --s3-bucket-name <bucket> --is-organization-trail --enable-log-file-validation
aws cloudtrail start-logging --name org-trail
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateUser --start-time "2026-07-20T00:00:00Z"
AWS Config
aws configservice put-config-rule --config-rule file://s3-public-read-prohibited.json
aws configservice put-config-rule --config-rule file://restricted-ssh.json
aws configservice put-configuration-aggregator --configuration-aggregator-name org-aggregator --organization-aggregation-source '{"RoleArn":"...","AwsRegions":["us-east-1","eu-west-1"],"AllAwsRegions":true}'
Incident Response Playbook AWS
Playbook: Compromission IAM
aws cloudtrail lookup-events --lookup-attributes AttributeKey=UserArn,AttributeValue=<arn>
aws accessanalyzer list-findings --analyzer-arn <arn>
aws iam update-access-key --access-key-id <key> --status Inactive --user-name <user>
aws iam create-login-profile --user-name <user> --password "ResetTemporary!" --password-reset-required
aws iam delete-service-specific-credential --service-specific-credential-id <id> --user-name <user>
aws s3 ls
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"
aws ec2 create-snapshot --volume-id <vol> --description "Forensic snapshot $(date)"
Playbook: Crypto Mining
aws guardduty get-findings --detector-id <id> --finding-ids <id>
aws ec2 stop-instances --instance-ids <id>
aws autoscaling detach-instances --instance-ids <id> --auto-scaling-group-name <asg> --should-decrement-desired-capacity
2. GCP — Detection & Monitoring
Security Command Center
gcloud scc findings list --organization <org> --filter "state=\"ACTIVE\""
gcloud scc findings list --organization <org> --filter "category=\"cryptomining\"" --format json
gcloud scc mute-configs create auto-mute --organization <org> --description "Auto-mute low"
gcloud scc notifications create <notification> --organization <org> --pubsub-topic <topic> --filter "state=\"ACTIVE\" AND severity=\"CRITICAL\""
Cloud Audit Logs
gcloud projects get-iam-policy <project> --format json | jq '.auditConfigs'
gcloud logging read "resource.type=project AND protoPayload.methodName=CreateServiceAccount" --limit 10
gcloud logging sinks create audit-sink bigquery.googleapis.com/projects/<project>/datasets/audit --log-filter="severity>=WARNING"
gcloud logging metrics create root-activity --description "Root activity" --log-filter "protoPayload.authenticationInfo.principalEmail =~ \"root.*@\""
gcloud alpha monitoring policies create --policy=root-activity-alert.yaml
Cloud Monitoring + Alerting
gcloud monitoring uptime-check-configs create --display-name=api-prod --http-check-path=/health --period=60s
cat > cpu-alert.yaml << 'EOF'
combiner: OR
conditions:
- conditionThreshold:
filter: resource.type="gce_instance" AND metric.type="compute.googleapis.com/instance/cpu/utilization"
thresholdValue: 0.9
duration: 300s
displayName: High CPU
displayName: CPU Alert
notificationChannels:
- projects/<project>/notificationChannels/<channel>
EOF
gcloud alpha monitoring policies create --policy-from-file=cpu-alert.yaml
Incident Response Playbook GCP
Playbook: Service Account Key Compromise
gcloud logging read "protoPayload.methodName=google.iam.admin.v1.CreateServiceAccountKey" --limit 20
gcloud iam service-accounts keys disable <key-id> --iam-account <sa>@<project>.iam.gserviceaccount.com
gcloud iam service-accounts keys create new-key.json --iam-account <sa>@<project>.iam.gserviceaccount.com
gcloud logging read "protoPayload.authenticationInfo.principalEmail:<sa>@<project>.iam.gserviceaccount.com"
Playbook: Data Exfiltration via GCS
gcloud logging read "protoPayload.methodName=storage.objects.get" --limit 50
gcloud access-context-manager perimeters create exfil-perimeter \
--perimeter-type regular \
--resources projects/<project> \
--restricted-services storage.googleapis.com
gsutil iam get gs://<bucket>
gcloud projects get-iam-policy <project> --format json | jq '.auditConfigs += [{"service":"storage.googleapis.com","auditLogConfigs":[{"logType":"DATA_READ"},{"logType":"DATA_WRITE"}]}]'
3. Azure — Detection & Monitoring
Microsoft Defender for Cloud
az security pricing list --output table
az security pricing create --name VirtualMachines --tier Standard
az security secure-score list --output table
az security secure-score-controls list
az security alert list --output table
az security alert show --name <alert-name>
az security alert update --name <alert-name> --status Dismiss
az security workflow-automation create --name jira-ticket --resource-group <RG> --triggers '[{"property":"All","operator":"Contains","value":"Critical"}]' --actions '[{"actionType":"LogicApp","logicAppResourceId":"<logic-app-id>"}]'
Azure Sentinel (Microsoft Sentinel)
az sentinel setting set --workspace-name <ws> --resource-group <RG> --entity-analytics enabled
SigninLogs
| where ResultType == 50057
| summarize Count = count() by UserPrincipalName, IPAddress
| where Count > 10
AuditLogs
| where OperationName == "Add member to role"
| where TargetResources[0].displayName has_any("Global Admin", "Owner")
Azure Monitor
az monitor metrics alert create --name "High CPU" --resource-group <RG> --scopes <vm-id> --condition "avg Percentage CPU > 90" --window-size 5m --evaluation-frequency 1m
az monitor action-group create --name critical-team --resource-group <RG> --action email admin@domain.com
Incident Response Playbook Azure
Playbook: Azure AD Compromise
az rest --method get --url "https://graph.microsoft.com/v1.0/identityProtection/riskyUsers"
az rest --method get --url "https://graph.microsoft.com/v1.0/identityProtection/riskySignIns"
az ad user update --id <user> --account-enabled false
az rest --method post --url "https://graph.microsoft.com/v1.0/users/<user>/revokeSignInSessions"
az rest --method patch --url "https://graph.microsoft.com/v1.0/users/<user>/authentication/methods/<method-id>" --body "{}"
az rest --method get --url "https://graph.microsoft.com/v1.0/users/<user>/appRoleAssignments"
az rest --method get --url "https://graph.microsoft.com/v1.0/users/<user>/ownedDevices"
Playbook: VM Cryptojacking
az security alert list --filter "alertDisplayName eq 'VM with high CPU crypto mining'"
az vm deallocate --name <vm> --resource-group <RG>
az snapshot create --name forensic-snap --resource-group <RG> --source <vm-os-disk>
az vm run-command invoke --command-id RunShellScript --name <vm> --resource-group <RG> --scripts "ps aux | grep miner"
4. SIEM Integration Multi-Cloud
SIEM Architectures
Log Sources by Provider
Centralized Detection Rules (Multi-Cloud)
Rule: Root/Admin Account Activity
Rule: Unauthorized API Call
Rule: Resource Hijacking
5. Cloud Forensics
AWS Forensic
aws ec2 create-snapshot --volume-id <vol> --description "Forensic $(date +%Y%m%d)"
aws ec2 create-volume --snapshot-id <snap> --availability-zone us-east-1a
aws ec2 attach-volume --volume-id <new-vol> --instance-id <forensic-vm> --device /dev/xvdf
insmod lime.ko "path=/tmp/mem.dump format=lime"
SELECT eventTime, eventName, userIdentity.arn, sourceIPAddress, requestParameters
FROM cloudtrail_logs
WHERE eventName IN ('CreateInstance', 'CreateUser')
AND eventTime > '2026-07-20T00:00:00Z'
ORDER BY eventTime
GCP Forensic
gcloud compute disks snapshot <disk> --snapshot-names forensic-$(date +%Y%m%d) --zone us-central1-a
gcloud compute disks create forensic-disk --source-snapshot forensic-20260720 --zone us-central1-a
gcloud compute instances attach-disk <forensic-vm> --disk forensic-disk
Azure Forensic
az snapshot create --name forensic-snap --resource-group <RG> --source <vm-os-disk>
az disk create --name forensic-disk --resource-group <RG> --source <snapshot-id>
az vm disk attach --vm-name <forensic-vm> --resource-group <RG> --disk forensic-disk
6. Outils & Ressources
| Outil | Cloud | Usage |
|---|
| Prowler | Multi | Posture assessment |
| ScoutSuite | Multi | Config audit |
| CloudSploit | Multi | Security scanning |
| Cartography | Multi | Relationship mapping |
| CloudMapper | AWS | Network visualization |
| Forseti Security | GCP | Policy enforcement |
| AzureHound | Azure | Attack path mapping |
| TheHive | Multi | Incident management |
| Cortex XSOAR | Multi | SOAR playbooks |
| Splunk ES | Multi | SIEM |
Ressources