[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A9PY618CJ5P320XJG4KGJD":3,"skill-same:01M7A9PY618CJ5P320XJG4KGJD":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M7A9PY618CJ5P320XJG4KGJD","performing-cloud-forensics-investigation",null,"Collect and analyze cloud forensic evidence using AWS CLI, Azure CLI, or gcloud to snapshot volumes, capture instance metadata and security group configurations, and preserve cloud-native logs (CloudTrail, Activity Log, Audit Log). Use when investigating a suspected breach in AWS, Azure, or GCP, tracing unauthorized access through API logs, or analyzing a compromised VM, container, or serverless function.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-cloud-forensics-investigation\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-cloud-forensics-investigation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-cloud-forensics-investigation\ndescription: Collect and analyze cloud forensic evidence using AWS CLI, Azure CLI, or gcloud\n  to snapshot volumes, capture instance metadata and security group configurations, and preserve\n  cloud-native logs (CloudTrail, Activity Log, Audit Log). Use when investigating a suspected\n  breach in AWS, Azure, or GCP, tracing unauthorized access through API logs, or analyzing a\n  compromised VM, container, or serverless function.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags:\n- forensics\n- cloud-forensics\n- aws\n- azure\n- gcp\n- incident-response\n- log-analysis\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- RS.AN-03\n- DE.AE-02\n- RS.MA-01\nmitre_attack:\n- T1005\n- T1074\n- T1119\n- T1070\n- T1078.004\n---\n\n# Performing Cloud Forensics Investigation\n\n## When to Use\n- When investigating a security breach in AWS, Azure, or GCP cloud environments\n- For collecting volatile and non-volatile evidence from cloud infrastructure\n- When tracing unauthorized access through cloud service API logs\n- During incident response requiring preservation of cloud-based evidence\n- For analyzing compromised virtual machines, containers, or serverless functions\n\n## Prerequisites\n- Administrative access to the cloud account under investigation\n- AWS CLI, Azure CLI, or gcloud CLI configured with appropriate permissions\n- Understanding of cloud-native logging (CloudTrail, Activity Log, Audit Log)\n- Forensic workstation with cloud SDKs installed\n- Knowledge of IAM, networking, and compute services in target cloud\n- Evidence preservation procedures for cloud environments\n\n## Workflow\n\n### Step 1: Preserve Cloud Evidence and Establish Scope\n\n```bash\n# === AWS Evidence Preservation ===\n# Snapshot compromised EC2 instance volumes\nINSTANCE_ID=\"i-0abc123def456789\"\nVOLUME_IDS=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID \\\n   --query 'Reservations[].Instances[].BlockDeviceMappings[].Ebs.VolumeId' --output text)\n\nfor vol in $VOLUME_IDS; do\n   aws ec2 create-snapshot --volume-id $vol \\\n      --description \"Forensic snapshot - Case 2024-001 - $(date -u)\" \\\n      --tag-specifications \"ResourceType=snapshot,Tags=[{Key=Case,Value=2024-001},{Key=Evidence,Value=true}]\"\ndone\n\n# Capture instance metadata\naws ec2 describe-instances --instance-ids $INSTANCE_ID \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Finstance_metadata.json\n\n# Capture security group rules\naws ec2 describe-security-groups --group-ids $(aws ec2 describe-instances \\\n   --instance-ids $INSTANCE_ID --query 'Reservations[].Instances[].SecurityGroups[].GroupId' --output text) \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fsecurity_groups.json\n\n# Capture network interfaces\naws ec2 describe-network-interfaces --filters \"Name=attachment.instance-id,Values=$INSTANCE_ID\" \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fnetwork_interfaces.json\n\n# Isolate the instance (replace security group with forensic isolation SG)\naws ec2 modify-instance-attribute --instance-id $INSTANCE_ID \\\n   --groups sg-forensic-isolation\n\n# === Azure Evidence Preservation ===\n# Snapshot a compromised VM disk\naz snapshot create --resource-group forensics-rg \\\n   --name \"case-2024-001-osdisk-snapshot\" \\\n   --source \"\u002Fsubscriptions\u002FSUB_ID\u002FresourceGroups\u002FRG\u002Fproviders\u002FMicrosoft.Compute\u002Fdisks\u002Fvm-osdisk\"\n\n# === GCP Evidence Preservation ===\ngcloud compute disks snapshot compromised-disk \\\n   --snapshot-names=\"case-2024-001-forensic\" \\\n   --zone=us-central1-a\n```\n\n### Step 2: Collect Cloud API and Access Logs\n\n```bash\n# === AWS CloudTrail Logs ===\n# Download CloudTrail events for the investigation period\naws cloudtrail lookup-events \\\n   --start-time \"2024-01-15T00:00:00Z\" \\\n   --end-time \"2024-01-20T23:59:59Z\" \\\n   --max-results 1000 \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloudtrail_events.json\n\n# Filter for specific user activity\naws cloudtrail lookup-events \\\n   --lookup-attributes AttributeKey=Username,AttributeValue=compromised-user \\\n   --start-time \"2024-01-15T00:00:00Z\" \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fuser_activity.json\n\n# Download S3 access logs\naws s3 sync s3:\u002F\u002Fmy-cloudtrail-bucket\u002FAWSLogs\u002F \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloudtrail_s3\u002F\n\n# Query CloudTrail with Athena for large-scale analysis\naws athena start-query-execution \\\n   --query-string \"SELECT eventTime, eventName, userIdentity.arn, sourceIPAddress, errorCode\n                   FROM cloudtrail_logs\n                   WHERE eventTime BETWEEN '2024-01-15' AND '2024-01-20'\n                   AND sourceIPAddress NOT IN ('10.0.0.0\u002F8')\n                   ORDER BY eventTime\" \\\n   --result-configuration OutputLocation=s3:\u002F\u002Fforensics-bucket\u002Fathena-results\u002F\n\n# === AWS VPC Flow Logs ===\naws logs filter-log-events \\\n   --log-group-name \"vpc-flow-logs\" \\\n   --start-time $(date -d \"2024-01-15\" +%s000) \\\n   --end-time $(date -d \"2024-01-20\" +%s000) \\\n   --filter-pattern \"ACCEPT\" \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fvpc_flow_logs.json\n\n# === Azure Activity Log ===\naz monitor activity-log list \\\n   --start-time \"2024-01-15T00:00:00Z\" \\\n   --end-time \"2024-01-20T23:59:59Z\" \\\n   --output json > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fazure_activity.json\n\n# === GCP Audit Logs ===\ngcloud logging read 'logName=\"projects\u002FPROJECT_ID\u002Flogs\u002Fcloudaudit.googleapis.com%2Factivity\"\n   AND timestamp>=\"2024-01-15T00:00:00Z\"\n   AND timestamp\u003C=\"2024-01-20T23:59:59Z\"' \\\n   --format=json > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fgcp_audit.json\n```\n\n### Step 3: Analyze IAM and Access Patterns\n\n```bash\n# Analyze compromised credentials usage\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom collections import defaultdict\n\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloudtrail_events.json') as f:\n    data = json.load(f)\n\n# Analyze by source IP\nip_events = defaultdict(list)\nerror_events = []\ncritical_actions = []\n\nfor event in data.get('Events', []):\n    ct = json.loads(event.get('CloudTrailEvent', '{}'))\n    source_ip = ct.get('sourceIPAddress', 'Unknown')\n    event_name = ct.get('eventName', 'Unknown')\n    user_arn = ct.get('userIdentity', {}).get('arn', 'Unknown')\n    error = ct.get('errorCode')\n    timestamp = ct.get('eventTime', '')\n\n    ip_events[source_ip].append(event_name)\n\n    if error:\n        error_events.append({'time': timestamp, 'action': event_name, 'error': error, 'ip': source_ip})\n\n    # Flag critical actions\n    critical = ['CreateUser', 'CreateAccessKey', 'AttachUserPolicy', 'CreateRole',\n                'PutBucketPolicy', 'StopLogging', 'DeleteTrail', 'CreateKeyPair',\n                'RunInstances', 'AuthorizeSecurityGroupIngress']\n    if event_name in critical:\n        critical_actions.append({'time': timestamp, 'action': event_name, 'user': user_arn, 'ip': source_ip})\n\nprint(\"=== SOURCE IP ANALYSIS ===\")\nfor ip, events in sorted(ip_events.items(), key=lambda x: len(x[1]), reverse=True):\n    print(f\"  {ip}: {len(events)} events ({len(set(events))} unique actions)\")\n\nprint(f\"\\n=== ACCESS ERRORS ({len(error_events)} total) ===\")\nfor e in error_events[:10]:\n    print(f\"  [{e['time']}] {e['action']} -> {e['error']} from {e['ip']}\")\n\nprint(f\"\\n=== CRITICAL ACTIONS ({len(critical_actions)} total) ===\")\nfor a in critical_actions:\n    print(f\"  [{a['time']}] {a['action']} by {a['user']} from {a['ip']}\")\nPYEOF\n```\n\n### Step 4: Acquire and Analyze VM Disk Image\n\n```bash\n# Create a forensic analysis instance from the snapshot\nSNAPSHOT_ID=\"snap-0abc123def456789\"\n\n# Create volume from snapshot in isolated forensic VPC\nFORENSIC_VOL=$(aws ec2 create-volume --snapshot-id $SNAPSHOT_ID \\\n   --availability-zone us-east-1a \\\n   --tag-specifications \"ResourceType=volume,Tags=[{Key=Case,Value=2024-001}]\" \\\n   --query 'VolumeId' --output text)\n\n# Attach to forensic analysis instance (read-only mount)\naws ec2 attach-volume --volume-id $FORENSIC_VOL \\\n   --instance-id i-forensic-workstation \\\n   --device \u002Fdev\u002Fxvdf\n\n# On the forensic instance, mount read-only\nsudo mount -o ro \u002Fdev\u002Fxvdf1 \u002Fmnt\u002Fevidence\n\n# Perform standard disk forensics on the mounted volume\n# Extract logs, analyze file system, check for persistence\nls \u002Fmnt\u002Fevidence\u002Fvar\u002Flog\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fvar\u002Flog\u002F \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fvm_logs\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fetc\u002Fcrontab \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fpersistence\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fhome\u002F*\u002F.ssh\u002F \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fssh_keys\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fhome\u002F*\u002F.bash_history \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fbash_history\u002F\n```\n\n### Step 5: Generate Cloud Forensics Report\n\n```bash\n# Compile findings into structured report\npython3 \u003C\u003C 'PYEOF'\nreport = \"\"\"\nCLOUD FORENSICS INVESTIGATION REPORT\n======================================\nCase: 2024-001\nCloud Provider: AWS (Account: 123456789012)\nRegion: us-east-1\nInvestigation Period: 2024-01-15 to 2024-01-20\n\nEVIDENCE PRESERVED:\n- EC2 Instance Snapshot: snap-0abc123def456789 (i-0abc123def456789)\n- CloudTrail Logs: 2024-01-15 to 2024-01-20\n- VPC Flow Logs: 2024-01-15 to 2024-01-20\n- Instance Metadata: captured and hashed\n- Security Group Configuration: captured at time of isolation\n\nFINDINGS:\n1. Initial Access:\n   - Compromised IAM access key AKIA... used from IP 203.0.113.45\n   - First unauthorized API call: 2024-01-15 14:32:00 UTC\n   - IP geolocation: Foreign jurisdiction (not company IP range)\n\n2. Persistence:\n   - New IAM user 'backup-admin' created with AdministratorAccess\n   - New access key pair generated for backup-admin\n   - SSH key added to EC2 instance authorized_keys\n\n3. Lateral Movement:\n   - S3 bucket policies modified to allow public access\n   - Security group rules modified to allow SSH from 0.0.0.0\u002F0\n   - 3 additional EC2 instances launched for crypto-mining\n\n4. Data Exfiltration:\n   - S3 bucket 'company-confidential' accessed 234 times\n   - 12 GB of data downloaded via GetObject API calls\n   - Data transferred to external IP 185.x.x.x\n\n5. Anti-Forensics:\n   - CloudTrail logging disabled at 2024-01-18 03:00 UTC\n   - CloudWatch log groups deleted\n\nRECOMMENDATIONS:\n- Rotate all IAM credentials immediately\n- Enable MFA on all accounts\n- Restore CloudTrail logging\n- Review and restrict S3 bucket policies\n- Implement GuardDuty for continuous monitoring\n\"\"\"\n\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloud_forensics_report.txt', 'w') as f:\n    f.write(report)\nprint(report)\nPYEOF\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Cloud API logging | Service logs recording all API calls (CloudTrail, Activity Log, Audit Log) |\n| Volume snapshots | Point-in-time copies of cloud disk volumes for forensic preservation |\n| VPC Flow Logs | Network traffic metadata logs showing source, destination, and action |\n| IAM credential compromise | Unauthorized use of access keys, tokens, or assumed roles |\n| Instance metadata | EC2\u002FVM configuration data including network, storage, and security settings |\n| Shared responsibility | Cloud provider secures infrastructure; customer secures data and access |\n| Evidence volatility | Cloud resources can be terminated; evidence must be preserved quickly |\n| Multi-region artifacts | Attacks may span regions requiring cross-region log collection |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| AWS CLI | Command-line interface for AWS service interaction and log collection |\n| CloudTrail | AWS API call logging service for investigation and auditing |\n| Azure Monitor | Azure logging and diagnostics platform |\n| GCP Cloud Logging | Google Cloud audit and access logging service |\n| Athena | AWS serverless SQL query service for analyzing CloudTrail logs at scale |\n| Prowler | Open-source AWS security assessment and forensic collection tool |\n| ScoutSuite | Multi-cloud security auditing tool |\n| CADO Response | Cloud-native digital forensics and incident response platform |\n\n## Common Scenarios\n\n**Scenario 1: Compromised IAM Access Keys**\nIdentify the compromised key in CloudTrail, trace all API calls made with the key, determine the source IPs and actions taken, check for persistence mechanisms (new users, roles, keys), revoke the compromised credentials, assess data access scope.\n\n**Scenario 2: Cryptojacking on EC2 Instances**\nDetect unauthorized instance launches in CloudTrail, snapshot the mining instances for analysis, examine security group changes that allowed C2 communication, identify the initial access vector (stolen keys, SSRF), calculate resource costs incurred.\n\n**Scenario 3: S3 Data Breach**\nAnalyze S3 access logs and CloudTrail for GetObject\u002FPutBucketPolicy events, identify who modified bucket policies to allow public access, determine the scope of data exposure, check for data downloads from unauthorized IPs, assess regulatory reporting requirements.\n\n**Scenario 4: Container Escape in EKS\u002FAKS\u002FGKE**\nCollect Kubernetes audit logs and cloud provider logs, analyze pod creation events for privilege escalation attempts, examine node-level logs for container escape evidence, check for unauthorized access to cloud metadata service (169.254.169.254), trace lateral movement to cloud APIs.\n\n## Output Format\n\n```\nCloud Forensics Summary:\n  Cloud: AWS (us-east-1) Account: 123456789012\n  Investigation: 2024-01-15 to 2024-01-20\n  Incident Type: IAM Credential Compromise + Data Exfiltration\n\n  Evidence Collected:\n    EBS Snapshots:    3 volumes preserved\n    CloudTrail Events: 12,456 (1,234 from attacker IP)\n    VPC Flow Logs:    45,678 records\n    S3 Access Logs:   2,345 entries\n\n  Attack Timeline:\n    2024-01-15 14:32 - Compromised access key first used from 203.0.113.45\n    2024-01-15 14:45 - New IAM user created with admin privileges\n    2024-01-16 02:00 - S3 bucket policy modified (public access enabled)\n    2024-01-16 03:00 - 12 GB downloaded from company-confidential bucket\n    2024-01-18 03:00 - CloudTrail logging disabled\n\n  Impact Assessment:\n    Data Exposed: 12 GB from 3 S3 buckets\n    Resources Created: 3 EC2 instances (crypto mining)\n    Estimated Cost: $4,500 in unauthorized compute\n```\n","# Performing Cloud Forensics Investigation\n\n## When to Use\n- When investigating a security breach in AWS, Azure, or GCP cloud environments\n- For collecting volatile and non-volatile evidence from cloud infrastructure\n- When tracing unauthorized access through cloud service API logs\n- During incident response requiring preservation of cloud-based evidence\n- For analyzing compromised virtual machines, containers, or serverless functions\n\n## Prerequisites\n- Administrative access to the cloud account under investigation\n- AWS CLI, Azure CLI, or gcloud CLI configured with appropriate permissions\n- Understanding of cloud-native logging (CloudTrail, Activity Log, Audit Log)\n- Forensic workstation with cloud SDKs installed\n- Knowledge of IAM, networking, and compute services in target cloud\n- Evidence preservation procedures for cloud environments\n\n## Workflow\n\n### Step 1: Preserve Cloud Evidence and Establish Scope\n\n```bash\n# === AWS Evidence Preservation ===\n# Snapshot compromised EC2 instance volumes\nINSTANCE_ID=\"i-0abc123def456789\"\nVOLUME_IDS=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID \\\n   --query 'Reservations[].Instances[].BlockDeviceMappings[].Ebs.VolumeId' --output text)\n\nfor vol in $VOLUME_IDS; do\n   aws ec2 create-snapshot --volume-id $vol \\\n      --description \"Forensic snapshot - Case 2024-001 - $(date -u)\" \\\n      --tag-specifications \"ResourceType=snapshot,Tags=[{Key=Case,Value=2024-001},{Key=Evidence,Value=true}]\"\ndone\n\n# Capture instance metadata\naws ec2 describe-instances --instance-ids $INSTANCE_ID \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Finstance_metadata.json\n\n# Capture security group rules\naws ec2 describe-security-groups --group-ids $(aws ec2 describe-instances \\\n   --instance-ids $INSTANCE_ID --query 'Reservations[].Instances[].SecurityGroups[].GroupId' --output text) \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fsecurity_groups.json\n\n# Capture network interfaces\naws ec2 describe-network-interfaces --filters \"Name=attachment.instance-id,Values=$INSTANCE_ID\" \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fnetwork_interfaces.json\n\n# Isolate the instance (replace security group with forensic isolation SG)\naws ec2 modify-instance-attribute --instance-id $INSTANCE_ID \\\n   --groups sg-forensic-isolation\n\n# === Azure Evidence Preservation ===\n# Snapshot a compromised VM disk\naz snapshot create --resource-group forensics-rg \\\n   --name \"case-2024-001-osdisk-snapshot\" \\\n   --source \"\u002Fsubscriptions\u002FSUB_ID\u002FresourceGroups\u002FRG\u002Fproviders\u002FMicrosoft.Compute\u002Fdisks\u002Fvm-osdisk\"\n\n# === GCP Evidence Preservation ===\ngcloud compute disks snapshot compromised-disk \\\n   --snapshot-names=\"case-2024-001-forensic\" \\\n   --zone=us-central1-a\n```\n\n### Step 2: Collect Cloud API and Access Logs\n\n```bash\n# === AWS CloudTrail Logs ===\n# Download CloudTrail events for the investigation period\naws cloudtrail lookup-events \\\n   --start-time \"2024-01-15T00:00:00Z\" \\\n   --end-time \"2024-01-20T23:59:59Z\" \\\n   --max-results 1000 \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloudtrail_events.json\n\n# Filter for specific user activity\naws cloudtrail lookup-events \\\n   --lookup-attributes AttributeKey=Username,AttributeValue=compromised-user \\\n   --start-time \"2024-01-15T00:00:00Z\" \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fuser_activity.json\n\n# Download S3 access logs\naws s3 sync s3:\u002F\u002Fmy-cloudtrail-bucket\u002FAWSLogs\u002F \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloudtrail_s3\u002F\n\n# Query CloudTrail with Athena for large-scale analysis\naws athena start-query-execution \\\n   --query-string \"SELECT eventTime, eventName, userIdentity.arn, sourceIPAddress, errorCode\n                   FROM cloudtrail_logs\n                   WHERE eventTime BETWEEN '2024-01-15' AND '2024-01-20'\n                   AND sourceIPAddress NOT IN ('10.0.0.0\u002F8')\n                   ORDER BY eventTime\" \\\n   --result-configuration OutputLocation=s3:\u002F\u002Fforensics-bucket\u002Fathena-results\u002F\n\n# === AWS VPC Flow Logs ===\naws logs filter-log-events \\\n   --log-group-name \"vpc-flow-logs\" \\\n   --start-time $(date -d \"2024-01-15\" +%s000) \\\n   --end-time $(date -d \"2024-01-20\" +%s000) \\\n   --filter-pattern \"ACCEPT\" \\\n   > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fvpc_flow_logs.json\n\n# === Azure Activity Log ===\naz monitor activity-log list \\\n   --start-time \"2024-01-15T00:00:00Z\" \\\n   --end-time \"2024-01-20T23:59:59Z\" \\\n   --output json > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fazure_activity.json\n\n# === GCP Audit Logs ===\ngcloud logging read 'logName=\"projects\u002FPROJECT_ID\u002Flogs\u002Fcloudaudit.googleapis.com%2Factivity\"\n   AND timestamp>=\"2024-01-15T00:00:00Z\"\n   AND timestamp\u003C=\"2024-01-20T23:59:59Z\"' \\\n   --format=json > \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fgcp_audit.json\n```\n\n### Step 3: Analyze IAM and Access Patterns\n\n```bash\n# Analyze compromised credentials usage\npython3 \u003C\u003C 'PYEOF'\nimport json\nfrom collections import defaultdict\n\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloudtrail_events.json') as f:\n    data = json.load(f)\n\n# Analyze by source IP\nip_events = defaultdict(list)\nerror_events = []\ncritical_actions = []\n\nfor event in data.get('Events', []):\n    ct = json.loads(event.get('CloudTrailEvent', '{}'))\n    source_ip = ct.get('sourceIPAddress', 'Unknown')\n    event_name = ct.get('eventName', 'Unknown')\n    user_arn = ct.get('userIdentity', {}).get('arn', 'Unknown')\n    error = ct.get('errorCode')\n    timestamp = ct.get('eventTime', '')\n\n    ip_events[source_ip].append(event_name)\n\n    if error:\n        error_events.append({'time': timestamp, 'action': event_name, 'error': error, 'ip': source_ip})\n\n    # Flag critical actions\n    critical = ['CreateUser', 'CreateAccessKey', 'AttachUserPolicy', 'CreateRole',\n                'PutBucketPolicy', 'StopLogging', 'DeleteTrail', 'CreateKeyPair',\n                'RunInstances', 'AuthorizeSecurityGroupIngress']\n    if event_name in critical:\n        critical_actions.append({'time': timestamp, 'action': event_name, 'user': user_arn, 'ip': source_ip})\n\nprint(\"=== SOURCE IP ANALYSIS ===\")\nfor ip, events in sorted(ip_events.items(), key=lambda x: len(x[1]), reverse=True):\n    print(f\"  {ip}: {len(events)} events ({len(set(events))} unique actions)\")\n\nprint(f\"\\n=== ACCESS ERRORS ({len(error_events)} total) ===\")\nfor e in error_events[:10]:\n    print(f\"  [{e['time']}] {e['action']} -> {e['error']} from {e['ip']}\")\n\nprint(f\"\\n=== CRITICAL ACTIONS ({len(critical_actions)} total) ===\")\nfor a in critical_actions:\n    print(f\"  [{a['time']}] {a['action']} by {a['user']} from {a['ip']}\")\nPYEOF\n```\n\n### Step 4: Acquire and Analyze VM Disk Image\n\n```bash\n# Create a forensic analysis instance from the snapshot\nSNAPSHOT_ID=\"snap-0abc123def456789\"\n\n# Create volume from snapshot in isolated forensic VPC\nFORENSIC_VOL=$(aws ec2 create-volume --snapshot-id $SNAPSHOT_ID \\\n   --availability-zone us-east-1a \\\n   --tag-specifications \"ResourceType=volume,Tags=[{Key=Case,Value=2024-001}]\" \\\n   --query 'VolumeId' --output text)\n\n# Attach to forensic analysis instance (read-only mount)\naws ec2 attach-volume --volume-id $FORENSIC_VOL \\\n   --instance-id i-forensic-workstation \\\n   --device \u002Fdev\u002Fxvdf\n\n# On the forensic instance, mount read-only\nsudo mount -o ro \u002Fdev\u002Fxvdf1 \u002Fmnt\u002Fevidence\n\n# Perform standard disk forensics on the mounted volume\n# Extract logs, analyze file system, check for persistence\nls \u002Fmnt\u002Fevidence\u002Fvar\u002Flog\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fvar\u002Flog\u002F \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fvm_logs\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fetc\u002Fcrontab \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fpersistence\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fhome\u002F*\u002F.ssh\u002F \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fssh_keys\u002F\ncp -r \u002Fmnt\u002Fevidence\u002Fhome\u002F*\u002F.bash_history \u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fbash_history\u002F\n```\n\n### Step 5: Generate Cloud Forensics Report\n\n```bash\n# Compile findings into structured report\npython3 \u003C\u003C 'PYEOF'\nreport = \"\"\"\nCLOUD FORENSICS INVESTIGATION REPORT\n======================================\nCase: 2024-001\nCloud Provider: AWS (Account: 123456789012)\nRegion: us-east-1\nInvestigation Period: 2024-01-15 to 2024-01-20\n\nEVIDENCE PRESERVED:\n- EC2 Instance Snapshot: snap-0abc123def456789 (i-0abc123def456789)\n- CloudTrail Logs: 2024-01-15 to 2024-01-20\n- VPC Flow Logs: 2024-01-15 to 2024-01-20\n- Instance Metadata: captured and hashed\n- Security Group Configuration: captured at time of isolation\n\nFINDINGS:\n1. Initial Access:\n   - Compromised IAM access key AKIA... used from IP 203.0.113.45\n   - First unauthorized API call: 2024-01-15 14:32:00 UTC\n   - IP geolocation: Foreign jurisdiction (not company IP range)\n\n2. Persistence:\n   - New IAM user 'backup-admin' created with AdministratorAccess\n   - New access key pair generated for backup-admin\n   - SSH key added to EC2 instance authorized_keys\n\n3. Lateral Movement:\n   - S3 bucket policies modified to allow public access\n   - Security group rules modified to allow SSH from 0.0.0.0\u002F0\n   - 3 additional EC2 instances launched for crypto-mining\n\n4. Data Exfiltration:\n   - S3 bucket 'company-confidential' accessed 234 times\n   - 12 GB of data downloaded via GetObject API calls\n   - Data transferred to external IP 185.x.x.x\n\n5. Anti-Forensics:\n   - CloudTrail logging disabled at 2024-01-18 03:00 UTC\n   - CloudWatch log groups deleted\n\nRECOMMENDATIONS:\n- Rotate all IAM credentials immediately\n- Enable MFA on all accounts\n- Restore CloudTrail logging\n- Review and restrict S3 bucket policies\n- Implement GuardDuty for continuous monitoring\n\"\"\"\n\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fcloud\u002Fcloud_forensics_report.txt', 'w') as f:\n    f.write(report)\nprint(report)\nPYEOF\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Cloud API logging | Service logs recording all API calls (CloudTrail, Activity Log, Audit Log) |\n| Volume snapshots | Point-in-time copies of cloud disk volumes for forensic preservation |\n| VPC Flow Logs | Network traffic metadata logs showing source, destination, and action |\n| IAM credential compromise | Unauthorized use of access keys, tokens, or assumed roles |\n| Instance metadata | EC2\u002FVM configuration data including network, storage, and security settings |\n| Shared responsibility | Cloud provider secures infrastructure; customer secures data and access |\n| Evidence volatility | Cloud resources can be terminated; evidence must be preserved quickly |\n| Multi-region artifacts | Attacks may span regions requiring cross-region log collection |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| AWS CLI | Command-line interface for AWS service interaction and log collection |\n| CloudTrail | AWS API call logging service for investigation and auditing |\n| Azure Monitor | Azure logging and diagnostics platform |\n| GCP Cloud Logging | Google Cloud audit and access logging service |\n| Athena | AWS serverless SQL query service for analyzing CloudTrail logs at scale |\n| Prowler | Open-source AWS security assessment and forensic collection tool |\n| ScoutSuite | Multi-cloud security auditing tool |\n| CADO Response | Cloud-native digital forensics and incident response platform |\n\n## Common Scenarios\n\n**Scenario 1: Compromised IAM Access Keys**\nIdentify the compromised key in CloudTrail, trace all API calls made with the key, determine the source IPs and actions taken, check for persistence mechanisms (new users, roles, keys), revoke the compromised credentials, assess data access scope.\n\n**Scenario 2: Cryptojacking on EC2 Instances**\nDetect unauthorized instance launches in CloudTrail, snapshot the mining instances for analysis, examine security group changes that allowed C2 communication, identify the initial access vector (stolen keys, SSRF), calculate resource costs incurred.\n\n**Scenario 3: S3 Data Breach**\nAnalyze S3 access logs and CloudTrail for GetObject\u002FPutBucketPolicy events, identify who modified bucket policies to allow public access, determine the scope of data exposure, check for data downloads from unauthorized IPs, assess regulatory reporting requirements.\n\n**Scenario 4: Container Escape in EKS\u002FAKS\u002FGKE**\nCollect Kubernetes audit logs and cloud provider logs, analyze pod creation events for privilege escalation attempts, examine node-level logs for container escape evidence, check for unauthorized access to cloud metadata service (169.254.169.254), trace lateral movement to cloud APIs.\n\n## Output Format\n\n```\nCloud Forensics Summary:\n  Cloud: AWS (us-east-1) Account: 123456789012\n  Investigation: 2024-01-15 to 2024-01-20\n  Incident Type: IAM Credential Compromise + Data Exfiltration\n\n  Evidence Collected:\n    EBS Snapshots:    3 volumes preserved\n    CloudTrail Events: 12,456 (1,234 from attacker IP)\n    VPC Flow Logs:    45,678 records\n    S3 Access Logs:   2,345 entries\n\n  Attack Timeline:\n    2024-01-15 14:32 - Compromised access key first used from 203.0.113.45\n    2024-01-15 14:45 - New IAM user created with admin privileges\n    2024-01-16 02:00 - S3 bucket policy modified (public access enabled)\n    2024-01-16 03:00 - 12 GB downloaded from company-confidential bucket\n    2024-01-18 03:00 - CloudTrail logging disabled\n\n  Impact Assessment:\n    Data Exposed: 12 GB from 3 S3 buckets\n    Resources Created: 3 EC2 instances (crypto mining)\n    Estimated Cost: $4,500 in unauthorized compute\n```\n",{"name":5,"tags":25,"author":33,"domain":34,"license":15,"version":35,"nist_csf":36,"subdomain":40,"description":7,"mitre_attack":41},[26,27,28,29,30,31,32],"forensics","cloud-forensics","aws","azure","gcp","incident-response","log-analysis","mahipal","cybersecurity","1.0",[37,38,39],"RS.AN-03","DE.AE-02","RS.MA-01","digital-forensics",[42,43,44,45,46],"T1005","T1074","T1119","T1070","T1078.004","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-cloud-forensics-investigation","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-cloud-forensics-investigation",{"tool":60,"command":61},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-cloud-forensics-investigation",{"tool":63,"command":64},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-cloud-forensics-investigation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-cloud-forensics-investigation\u002FSKILL.md",true,[68,72,78],{"path":69,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fapi-reference.md","REFERENCE","参考文档",2483,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-cloud-forensics-investigation\u002Freferences\u002Fapi-reference.md",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Fagent.py","SCRIPT","脚本",8645,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-cloud-forensics-investigation\u002Fscripts\u002Fagent.py",[85,92,99,106,113,120],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]