performing-cloud-forensics-investigation
Conduct forensic investigations in cloud environments by collecting and analyzing logs, snapshots, and metadata from AWS, Azure, and GCP services.
What this skill does
# Performing Cloud Forensics Investigation
## When to Use
- When investigating a security breach in AWS, Azure, or GCP cloud environments
- For collecting volatile and non-volatile evidence from cloud infrastructure
- When tracing unauthorized access through cloud service API logs
- During incident response requiring preservation of cloud-based evidence
- For analyzing compromised virtual machines, containers, or serverless functions
## Prerequisites
- Administrative access to the cloud account under investigation
- AWS CLI, Azure CLI, or gcloud CLI configured with appropriate permissions
- Understanding of cloud-native logging (CloudTrail, Activity Log, Audit Log)
- Forensic workstation with cloud SDKs installed
- Knowledge of IAM, networking, and compute services in target cloud
- Evidence preservation procedures for cloud environments
## Workflow
### Step 1: Preserve Cloud Evidence and Establish Scope
```bash
# === AWS Evidence Preservation ===
# Snapshot compromised EC2 instance volumes
INSTANCE_ID="i-0abc123def456789"
VOLUME_IDS=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID \
--query 'Reservations[].Instances[].BlockDeviceMappings[].Ebs.VolumeId' --output text)
for vol in $VOLUME_IDS; do
aws ec2 create-snapshot --volume-id $vol \
--description "Forensic snapshot - Case 2024-001 - $(date -u)" \
--tag-specifications "ResourceType=snapshot,Tags=[{Key=Case,Value=2024-001},{Key=Evidence,Value=true}]"
done
# Capture instance metadata
aws ec2 describe-instances --instance-ids $INSTANCE_ID \
> /cases/case-2024-001/cloud/instance_metadata.json
# Capture security group rules
aws ec2 describe-security-groups --group-ids $(aws ec2 describe-instances \
--instance-ids $INSTANCE_ID --query 'Reservations[].Instances[].SecurityGroups[].GroupId' --output text) \
> /cases/case-2024-001/cloud/security_groups.json
# Capture network interfaces
aws ec2 describe-network-interfaces --filters "Name=attachment.instance-id,Values=$INSTANCE_ID" \
> /cases/case-2024-001/cloud/network_interfaces.json
# Isolate the instance (replace security group with forensic isolation SG)
aws ec2 modify-instance-attribute --instance-id $INSTANCE_ID \
--groups sg-forensic-isolation
# === Azure Evidence Preservation ===
# Snapshot a compromised VM disk
az snapshot create --resource-group forensics-rg \
--name "case-2024-001-osdisk-snapshot" \
--source "/subscriptions/SUB_ID/resourceGroups/RG/providers/Microsoft.Compute/disks/vm-osdisk"
# === GCP Evidence Preservation ===
gcloud compute disks snapshot compromised-disk \
--snapshot-names="case-2024-001-forensic" \
--zone=us-central1-a
```
### Step 2: Collect Cloud API and Access Logs
```bash
# === AWS CloudTrail Logs ===
# Download CloudTrail events for the investigation period
aws cloudtrail lookup-events \
--start-time "2024-01-15T00:00:00Z" \
--end-time "2024-01-20T23:59:59Z" \
--max-results 1000 \
> /cases/case-2024-001/cloud/cloudtrail_events.json
# Filter for specific user activity
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=Username,AttributeValue=compromised-user \
--start-time "2024-01-15T00:00:00Z" \
> /cases/case-2024-001/cloud/user_activity.json
# Download S3 access logs
aws s3 sync s3://my-cloudtrail-bucket/AWSLogs/ /cases/case-2024-001/cloud/cloudtrail_s3/
# Query CloudTrail with Athena for large-scale analysis
aws athena start-query-execution \
--query-string "SELECT eventTime, eventName, userIdentity.arn, sourceIPAddress, errorCode
FROM cloudtrail_logs
WHERE eventTime BETWEEN '2024-01-15' AND '2024-01-20'
AND sourceIPAddress NOT IN ('10.0.0.0/8')
ORDER BY eventTime" \
--result-configuration OutputLocation=s3://forensics-bucket/athena-results/
# === AWS VPC Flow Logs ===
aws logs filter-log-events \
--log-group-name "vpc-flow-logs" \
--start-time $(date -d "2024-01-15" +%s000) \
--end-time $(date -d "2024-01-20" +%s000) \
--filter-pattern "ACCEPT" \
> /cases/case-2024-001/cloud/vpc_flow_logs.json
# === Azure Activity Log ===
az monitor activity-log list \
--start-time "2024-01-15T00:00:00Z" \
--end-time "2024-01-20T23:59:59Z" \
--output json > /cases/case-2024-001/cloud/azure_activity.json
# === GCP Audit Logs ===
gcloud logging read 'logName="projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivity"
AND timestamp>="2024-01-15T00:00:00Z"
AND timestamp<="2024-01-20T23:59:59Z"' \
--format=json > /cases/case-2024-001/cloud/gcp_audit.json
```
### Step 3: Analyze IAM and Access Patterns
```bash
# Analyze compromised credentials usage
python3 << 'PYEOF'
import json
from collections import defaultdict
with open('/cases/case-2024-001/cloud/cloudtrail_events.json') as f:
data = json.load(f)
# Analyze by source IP
ip_events = defaultdict(list)
error_events = []
critical_actions = []
for event in data.get('Events', []):
ct = json.loads(event.get('CloudTrailEvent', '{}'))
source_ip = ct.get('sourceIPAddress', 'Unknown')
event_name = ct.get('eventName', 'Unknown')
user_arn = ct.get('userIdentity', {}).get('arn', 'Unknown')
error = ct.get('errorCode')
timestamp = ct.get('eventTime', '')
ip_events[source_ip].append(event_name)
if error:
error_events.append({'time': timestamp, 'action': event_name, 'error': error, 'ip': source_ip})
# Flag critical actions
critical = ['CreateUser', 'CreateAccessKey', 'AttachUserPolicy', 'CreateRole',
'PutBucketPolicy', 'StopLogging', 'DeleteTrail', 'CreateKeyPair',
'RunInstances', 'AuthorizeSecurityGroupIngress']
if event_name in critical:
critical_actions.append({'time': timestamp, 'action': event_name, 'user': user_arn, 'ip': source_ip})
print("=== SOURCE IP ANALYSIS ===")
for ip, events in sorted(ip_events.items(), key=lambda x: len(x[1]), reverse=True):
print(f" {ip}: {len(events)} events ({len(set(events))} unique actions)")
print(f"\n=== ACCESS ERRORS ({len(error_events)} total) ===")
for e in error_events[:10]:
print(f" [{e['time']}] {e['action']} -> {e['error']} from {e['ip']}")
print(f"\n=== CRITICAL ACTIONS ({len(critical_actions)} total) ===")
for a in critical_actions:
print(f" [{a['time']}] {a['action']} by {a['user']} from {a['ip']}")
PYEOF
```
### Step 4: Acquire and Analyze VM Disk Image
```bash
# Create a forensic analysis instance from the snapshot
SNAPSHOT_ID="snap-0abc123def456789"
# Create volume from snapshot in isolated forensic VPC
FORENSIC_VOL=$(aws ec2 create-volume --snapshot-id $SNAPSHOT_ID \
--availability-zone us-east-1a \
--tag-specifications "ResourceType=volume,Tags=[{Key=Case,Value=2024-001}]" \
--query 'VolumeId' --output text)
# Attach to forensic analysis instance (read-only mount)
aws ec2 attach-volume --volume-id $FORENSIC_VOL \
--instance-id i-forensic-workstation \
--device /dev/xvdf
# On the forensic instance, mount read-only
sudo mount -o ro /dev/xvdf1 /mnt/evidence
# Perform standard disk forensics on the mounted volume
# Extract logs, analyze file system, check for persistence
ls /mnt/evidence/var/log/
cp -r /mnt/evidence/var/log/ /cases/case-2024-001/cloud/vm_logs/
cp -r /mnt/evidence/etc/crontab /cases/case-2024-001/cloud/persistence/
cp -r /mnt/evidence/home/*/.ssh/ /cases/case-2024-001/cloud/ssh_keys/
cp -r /mnt/evidence/home/*/.bash_history /cases/case-2024-001/cloud/bash_history/
```
### Step 5: Generate Cloud Forensics Report
```bash
# Compile findings into structured report
python3 << 'PYEOF'
report = """
CLOUD FORENSICS INVESTIGATION REPORT
======================================
Case: 2024-001
Cloud Provider: AWS (Account: 123456789012)
Region: us-east-1
Investigation Period: 2024-01-15 to 2024-01-20
EVIDENCE PRESERVED:
- EC2 Instance Snapshot: snap-0abc123def456789 (i-0abc123def456789)
- CloudTrail Logs: 2024-01-15 to 2024-01-20
- VPC Flow Logs: 2024-01-15 to 2024-01-20
- InstanceRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.