[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AEH9NPSV5Z27WN5GQWAF46":3,"skill-same:01M6AEH9NPSV5Z27WN5GQWAF46":115},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":70,"commitSha":71,"skillDirectory":72,"forksCount":73,"repositoryHtmlUrl":74,"repositoryHomepageUrl":75,"ownerHtmlUrl":76,"ownerBlogUrl":77,"ownerDescription":78,"updatedAt":79,"install":80,"resources":93},"01M6AEH9NPSV5Z27WN5GQWAF46","detecting-s3-data-exfiltration-attempts","AWS S3 数据泄露检测","Detecting data exfiltration attempts from AWS S3 buckets by analyzing CloudTrail S3 data events, VPC Flow Logs, GuardDuty findings, Amazon Macie alerts, and S3 access patterns to identify unauthorized bulk downloads and cross-account data transfers.","通过分析 CloudTrail S3 数据事件、VPC Flow Logs、GuardDuty 发现、Amazon Macie 警报和 S3 访问模式，检测从 AWS S3 存储桶窃取数据的尝试，以识别未经授权的大规模下载和跨账户数据传输。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-s3-data-exfiltration-attempts\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSJ8FPTACYEEYRWQRNFXKY","安全检测工程","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"detecting s3 data exfiltration attempts","s3","data","exfiltration","threat-detection","macie","guardduty","detection","aws","flow","analyzing","data-exfiltration","security","cloudtrail","downloads","cloud-security","cloud","logs","pr","cybersecurity","2026-11-10 10:12:30",false,"---\nname: detecting-s3-data-exfiltration-attempts\ndescription: 'Detecting data exfiltration attempts from AWS S3 buckets by analyzing\n  CloudTrail S3 data events, VPC Flow Logs, GuardDuty findings, Amazon Macie alerts,\n  and S3 access patterns to identify unauthorized bulk downloads and cross-account\n  data transfers.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- cloud-security\n- aws\n- s3\n- data-exfiltration\n- guardduty\n- macie\n- threat-detection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmitre_attack:\n- T1530\n- T1567.002\n- T1537\n- T1119\n---\n\n# Detecting S3 Data Exfiltration Attempts\n\n## When to Use\n\n- When GuardDuty detects anomalous S3 access patterns such as bulk downloads from unusual IPs\n- When investigating suspected data breach involving S3-stored sensitive data\n- When building detection rules for S3 data loss prevention monitoring\n- When responding to Macie alerts about sensitive data being accessed or moved\n- When compliance requires monitoring and logging of all access to classified data stores\n\n**Do not use** for preventing data exfiltration (use S3 bucket policies, VPC endpoints, and SCPs), for data classification (use Amazon Macie discovery jobs), or for network-level exfiltration detection (use VPC Flow Logs with network analysis tools).\n\n## Prerequisites\n\n- CloudTrail configured with S3 data event logging (`GetObject`, `PutObject`, `CopyObject`)\n- GuardDuty enabled with S3 Protection feature activated\n- Amazon Macie enabled for sensitive data discovery in target buckets\n- CloudWatch Logs or Athena for querying CloudTrail logs at scale\n- VPC endpoint policies configured for S3 access monitoring\n\n## Workflow\n\n### Step 1: Enable S3 Data Event Logging in CloudTrail\n\nConfigure CloudTrail to capture all S3 object-level operations for forensic analysis.\n\n```bash\n# Enable S3 data events on an existing trail\naws cloudtrail put-event-selectors \\\n  --trail-name management-trail \\\n  --event-selectors '[{\n    \"ReadWriteType\": \"All\",\n    \"IncludeManagementEvents\": true,\n    \"DataResources\": [{\n      \"Type\": \"AWS::S3::Object\",\n      \"Values\": [\"arn:aws:s3:::sensitive-data-bucket\u002F\", \"arn:aws:s3:::customer-records\u002F\"]\n    }]\n  }]'\n\n# Verify data event configuration\naws cloudtrail get-event-selectors --trail-name management-trail \\\n  --query 'EventSelectors[*].DataResources' --output json\n\n# Enable GuardDuty S3 Protection\naws guardduty update-detector \\\n  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \\\n  --data-sources '{\"S3Logs\":{\"Enable\":true}}'\n```\n\n### Step 2: Query CloudTrail for Anomalous S3 Access Patterns\n\nAnalyze CloudTrail logs for bulk download activity, unusual access times, and unfamiliar source IPs.\n\n```bash\n# Athena query: Top S3 downloaders by volume in last 24 hours\ncat \u003C\u003C 'EOF'\nSELECT\n  useridentity.arn as principal,\n  sourceipaddress,\n  COUNT(*) as request_count,\n  SUM(CAST(json_extract_scalar(requestparameters, '$.bytesTransferredOut') AS bigint)) as bytes_downloaded\nFROM cloudtrail_logs\nWHERE eventname = 'GetObject'\n  AND eventsource = 's3.amazonaws.com'\n  AND eventtime > date_add('hour', -24, now())\nGROUP BY useridentity.arn, sourceipaddress\nORDER BY request_count DESC\nLIMIT 50\nEOF\n\n# CloudWatch Logs Insights: S3 GetObject requests from unusual IPs\naws logs start-query \\\n  --log-group-name cloudtrail-logs \\\n  --start-time $(date -d \"24 hours ago\" +%s) \\\n  --end-time $(date +%s) \\\n  --query-string '\n    fields @timestamp, userIdentity.arn, sourceIPAddress, requestParameters.bucketName, requestParameters.key\n    | filter eventName = \"GetObject\"\n    | stats count() as requestCount by sourceIPAddress, userIdentity.arn\n    | sort requestCount desc\n    | limit 25\n  '\n\n# Detect cross-account copies (potential exfiltration)\naws logs start-query \\\n  --log-group-name cloudtrail-logs \\\n  --start-time $(date -d \"7 days ago\" +%s) \\\n  --end-time $(date +%s) \\\n  --query-string '\n    fields @timestamp, userIdentity.arn, sourceIPAddress, requestParameters.bucketName\n    | filter eventName in [\"CopyObject\", \"ReplicateObject\", \"UploadPart\"]\n    | filter userIdentity.accountId != \"OUR_ACCOUNT_ID\"\n    | sort @timestamp desc\n    | limit 100\n  '\n```\n\n### Step 3: Review GuardDuty S3 Findings\n\nCheck for GuardDuty S3-specific finding types that indicate exfiltration activity.\n\n```bash\n# List active S3 exfiltration-related findings\naws guardduty list-findings \\\n  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \\\n  --finding-criteria '{\n    \"Criterion\": {\n      \"type\": {\n        \"Eq\": [\n          \"Exfiltration:S3\u002FMaliciousIPCaller\",\n          \"Exfiltration:S3\u002FObjectRead.Unusual\",\n          \"Discovery:S3\u002FMaliciousIPCaller.Custom\",\n          \"Discovery:S3\u002FBucketEnumeration.Unusual\",\n          \"UnauthorizedAccess:S3\u002FMaliciousIPCaller.Custom\",\n          \"UnauthorizedAccess:S3\u002FTorIPCaller\",\n          \"Impact:S3\u002FAnomalousBehavior.Delete\"\n        ]\n      }\n    }\n  }' --output json\n\n# Get detailed finding information\naws guardduty get-findings \\\n  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \\\n  --finding-ids FINDING_IDS \\\n  --query 'Findings[*].{Type:Type,Severity:Severity,Resource:Resource.S3BucketDetails[0].Name,Action:Service.Action}' \\\n  --output table\n```\n\n### Step 4: Analyze Macie Findings for Sensitive Data Access\n\nReview Macie findings to correlate data sensitivity with access anomalies.\n\n```bash\n# List Macie findings for sensitive data exposure\naws macie2 list-findings \\\n  --finding-criteria '{\n    \"criterion\": {\n      \"category\": {\"eq\": [\"CLASSIFICATION\"]},\n      \"severity.description\": {\"eq\": [\"High\", \"Critical\"]}\n    }\n  }' \\\n  --sort-criteria '{\"attributeName\": \"updatedAt\", \"orderBy\": \"DESC\"}' \\\n  --max-results 25\n\n# Get detailed finding with data classification\naws macie2 get-findings \\\n  --finding-ids FINDING_IDS \\\n  --query 'findings[*].{Type:type,Severity:severity.description,Bucket:resourcesAffected.s3Bucket.name,SensitiveDataTypes:classificationDetails.result.sensitiveData[*].category}' \\\n  --output table\n\n# Run a sensitive data discovery job on target bucket\naws macie2 create-classification-job \\\n  --job-type ONE_TIME \\\n  --name \"exfiltration-investigation\" \\\n  --s3-job-definition '{\n    \"bucketDefinitions\": [{\n      \"accountId\": \"ACCOUNT_ID\",\n      \"buckets\": [\"sensitive-data-bucket\"]\n    }]\n  }'\n```\n\n### Step 5: Build Automated Detection Rules\n\nCreate CloudWatch alarms and EventBridge rules for real-time exfiltration detection.\n\n```bash\n# CloudWatch metric filter for high-volume S3 downloads\naws logs put-metric-filter \\\n  --log-group-name cloudtrail-logs \\\n  --filter-name s3-bulk-download \\\n  --filter-pattern '{$.eventName = \"GetObject\" && $.eventSource = \"s3.amazonaws.com\"}' \\\n  --metric-transformations '[{\n    \"metricName\": \"S3GetObjectCount\",\n    \"metricNamespace\": \"SecurityMetrics\",\n    \"metricValue\": \"1\",\n    \"defaultValue\": 0\n  }]'\n\n# Alarm for anomalous download volume (>1000 objects\u002Fhour)\naws cloudwatch put-metric-alarm \\\n  --alarm-name s3-exfiltration-alert \\\n  --metric-name S3GetObjectCount \\\n  --namespace SecurityMetrics \\\n  --statistic Sum \\\n  --period 3600 \\\n  --threshold 1000 \\\n  --comparison-operator GreaterThanThreshold \\\n  --evaluation-periods 1 \\\n  --alarm-actions arn:aws:sns:us-east-1:ACCOUNT:security-alerts\n\n# EventBridge rule for GuardDuty S3 findings\naws events put-rule \\\n  --name guardduty-s3-exfiltration \\\n  --event-pattern '{\n    \"source\": [\"aws.guardduty\"],\n    \"detail-type\": [\"GuardDuty Finding\"],\n    \"detail\": {\n      \"type\": [{\"prefix\": \"Exfiltration:S3\u002F\"}]\n    }\n  }'\n```\n\n### Step 6: Implement Preventive Controls\n\nDeploy bucket policies and VPC endpoint policies to restrict data movement paths.\n\n```bash\n# VPC endpoint policy restricting S3 access to specific buckets\naws ec2 modify-vpc-endpoint \\\n  --vpc-endpoint-id vpce-ENDPOINT_ID \\\n  --policy-document '{\n    \"Statement\": [{\n      \"Sid\": \"RestrictToOwnBuckets\",\n      \"Effect\": \"Allow\",\n      \"Principal\": \"*\",\n      \"Action\": [\"s3:GetObject\", \"s3:PutObject\"],\n      \"Resource\": [\"arn:aws:s3:::approved-bucket-1\u002F*\", \"arn:aws:s3:::approved-bucket-2\u002F*\"]\n    }]\n  }'\n\n# Bucket policy denying access from outside the VPC\naws s3api put-bucket-policy --bucket sensitive-data-bucket --policy '{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Sid\": \"DenyNonVpcAccess\",\n    \"Effect\": \"Deny\",\n    \"Principal\": \"*\",\n    \"Action\": \"s3:GetObject\",\n    \"Resource\": \"arn:aws:s3:::sensitive-data-bucket\u002F*\",\n    \"Condition\": {\n      \"StringNotEquals\": {\n        \"aws:sourceVpce\": \"vpce-ENDPOINT_ID\"\n      }\n    }\n  }]\n}'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| S3 Data Events | CloudTrail object-level logging that captures GetObject, PutObject, DeleteObject, and CopyObject API calls with request details |\n| GuardDuty S3 Protection | Threat detection feature analyzing CloudTrail S3 data events to identify anomalous access patterns and exfiltration attempts |\n| Amazon Macie | Data security service that discovers and classifies sensitive data in S3 and generates findings for data exposure risks |\n| VPC Endpoint Policy | Access control policy on an S3 VPC endpoint that restricts which buckets and actions can be accessed through the endpoint |\n| Data Exfiltration | Unauthorized transfer of data from an organization's S3 storage to an external location controlled by an attacker |\n| Anomalous Behavior Detection | Machine learning-based identification of S3 access patterns that deviate from established baselines for a principal |\n\n## Tools & Systems\n\n- **AWS CloudTrail**: Audit logging of S3 object-level operations for forensic analysis and anomaly detection\n- **Amazon GuardDuty**: ML-based threat detection with S3-specific finding types for exfiltration and unauthorized access\n- **Amazon Macie**: Sensitive data discovery and classification for correlating access anomalies with data sensitivity\n- **Amazon Athena**: SQL query engine for analyzing CloudTrail logs at scale to identify bulk download patterns\n- **CloudWatch Logs Insights**: Real-time log analysis for building detection queries against CloudTrail data\n\n## Common Scenarios\n\n### Scenario: Compromised IAM Credentials Used for Bulk S3 Data Download\n\n**Context**: GuardDuty reports an `Exfiltration:S3\u002FObjectRead.Unusual` finding indicating that a developer's access key is downloading thousands of objects from a sensitive data bucket at 3 AM from an IP address in a foreign country.\n\n**Approach**:\n1. Immediately deactivate the compromised access key\n2. Query CloudTrail for all S3 actions by the compromised principal in the last 72 hours\n3. Identify which buckets and objects were accessed using Athena queries\n4. Cross-reference accessed objects with Macie classifications to assess data sensitivity\n5. Check for CopyObject calls to external accounts (cross-account exfiltration)\n6. Review how the credentials were compromised (TruffleHog scan, phishing investigation)\n7. Implement VPC endpoint policies to restrict future S3 access to approved network paths\n\n**Pitfalls**: CloudTrail S3 data events can generate massive log volume. Use Athena with partitioned tables rather than CloudWatch Logs Insights for queries spanning more than 24 hours. GuardDuty baseline learning requires 7-14 days, so new accounts may generate false positives for normal access patterns.\n\n## Output Format\n\n```\nS3 Data Exfiltration Investigation Report\n============================================\nAccount: 123456789012\nDetection Source: GuardDuty Exfiltration:S3\u002FObjectRead.Unusual\nInvestigation Date: 2026-02-23\n\nINCIDENT TIMELINE:\n  2026-02-23 02:47 UTC - First anomalous GetObject from 185.x.x.x\n  2026-02-23 02:47-04:12 UTC - 12,847 GetObject requests\n  2026-02-23 04:15 UTC - GuardDuty finding generated\n  2026-02-23 04:20 UTC - PagerDuty alert received by SOC\n  2026-02-23 04:25 UTC - Access key deactivated\n\nCOMPROMISED PRINCIPAL:\n  ARN: arn:aws:iam::123456789012:user\u002Fdeveloper-jane\n  Access Key: AKIA...WXYZ\n  Source IP: 185.x.x.x (Tor exit node)\n\nDATA IMPACT ASSESSMENT:\n  Buckets accessed: 3\n  Objects downloaded: 12,847\n  Total data volume: 4.7 GB\n  Sensitive data types: PII (SSN, email), Financial (credit card)\n  Macie severity: CRITICAL\n\nCONTAINMENT ACTIONS:\n  [x] Access key deactivated\n  [x] User password reset and MFA re-enrolled\n  [x] VPC endpoint policy applied to sensitive buckets\n  [x] Bucket policy restricting to VPC-only access\n  [x] TruffleHog scan initiated on developer repositories\n```\n","# Detecting S3 Data Exfiltration Attempts\n\n## When to Use\n\n- When GuardDuty detects anomalous S3 access patterns such as bulk downloads from unusual IPs\n- When investigating suspected data breach involving S3-stored sensitive data\n- When building detection rules for S3 data loss prevention monitoring\n- When responding to Macie alerts about sensitive data being accessed or moved\n- When compliance requires monitoring and logging of all access to classified data stores\n\n**Do not use** for preventing data exfiltration (use S3 bucket policies, VPC endpoints, and SCPs), for data classification (use Amazon Macie discovery jobs), or for network-level exfiltration detection (use VPC Flow Logs with network analysis tools).\n\n## Prerequisites\n\n- CloudTrail configured with S3 data event logging (`GetObject`, `PutObject`, `CopyObject`)\n- GuardDuty enabled with S3 Protection feature activated\n- Amazon Macie enabled for sensitive data discovery in target buckets\n- CloudWatch Logs or Athena for querying CloudTrail logs at scale\n- VPC endpoint policies configured for S3 access monitoring\n\n## Workflow\n\n### Step 1: Enable S3 Data Event Logging in CloudTrail\n\nConfigure CloudTrail to capture all S3 object-level operations for forensic analysis.\n\n```bash\n# Enable S3 data events on an existing trail\naws cloudtrail put-event-selectors \\\n  --trail-name management-trail \\\n  --event-selectors '[{\n    \"ReadWriteType\": \"All\",\n    \"IncludeManagementEvents\": true,\n    \"DataResources\": [{\n      \"Type\": \"AWS::S3::Object\",\n      \"Values\": [\"arn:aws:s3:::sensitive-data-bucket\u002F\", \"arn:aws:s3:::customer-records\u002F\"]\n    }]\n  }]'\n\n# Verify data event configuration\naws cloudtrail get-event-selectors --trail-name management-trail \\\n  --query 'EventSelectors[*].DataResources' --output json\n\n# Enable GuardDuty S3 Protection\naws guardduty update-detector \\\n  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \\\n  --data-sources '{\"S3Logs\":{\"Enable\":true}}'\n```\n\n### Step 2: Query CloudTrail for Anomalous S3 Access Patterns\n\nAnalyze CloudTrail logs for bulk download activity, unusual access times, and unfamiliar source IPs.\n\n```bash\n# Athena query: Top S3 downloaders by volume in last 24 hours\ncat \u003C\u003C 'EOF'\nSELECT\n  useridentity.arn as principal,\n  sourceipaddress,\n  COUNT(*) as request_count,\n  SUM(CAST(json_extract_scalar(requestparameters, '$.bytesTransferredOut') AS bigint)) as bytes_downloaded\nFROM cloudtrail_logs\nWHERE eventname = 'GetObject'\n  AND eventsource = 's3.amazonaws.com'\n  AND eventtime > date_add('hour', -24, now())\nGROUP BY useridentity.arn, sourceipaddress\nORDER BY request_count DESC\nLIMIT 50\nEOF\n\n# CloudWatch Logs Insights: S3 GetObject requests from unusual IPs\naws logs start-query \\\n  --log-group-name cloudtrail-logs \\\n  --start-time $(date -d \"24 hours ago\" +%s) \\\n  --end-time $(date +%s) \\\n  --query-string '\n    fields @timestamp, userIdentity.arn, sourceIPAddress, requestParameters.bucketName, requestParameters.key\n    | filter eventName = \"GetObject\"\n    | stats count() as requestCount by sourceIPAddress, userIdentity.arn\n    | sort requestCount desc\n    | limit 25\n  '\n\n# Detect cross-account copies (potential exfiltration)\naws logs start-query \\\n  --log-group-name cloudtrail-logs \\\n  --start-time $(date -d \"7 days ago\" +%s) \\\n  --end-time $(date +%s) \\\n  --query-string '\n    fields @timestamp, userIdentity.arn, sourceIPAddress, requestParameters.bucketName\n    | filter eventName in [\"CopyObject\", \"ReplicateObject\", \"UploadPart\"]\n    | filter userIdentity.accountId != \"OUR_ACCOUNT_ID\"\n    | sort @timestamp desc\n    | limit 100\n  '\n```\n\n### Step 3: Review GuardDuty S3 Findings\n\nCheck for GuardDuty S3-specific finding types that indicate exfiltration activity.\n\n```bash\n# List active S3 exfiltration-related findings\naws guardduty list-findings \\\n  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \\\n  --finding-criteria '{\n    \"Criterion\": {\n      \"type\": {\n        \"Eq\": [\n          \"Exfiltration:S3\u002FMaliciousIPCaller\",\n          \"Exfiltration:S3\u002FObjectRead.Unusual\",\n          \"Discovery:S3\u002FMaliciousIPCaller.Custom\",\n          \"Discovery:S3\u002FBucketEnumeration.Unusual\",\n          \"UnauthorizedAccess:S3\u002FMaliciousIPCaller.Custom\",\n          \"UnauthorizedAccess:S3\u002FTorIPCaller\",\n          \"Impact:S3\u002FAnomalousBehavior.Delete\"\n        ]\n      }\n    }\n  }' --output json\n\n# Get detailed finding information\naws guardduty get-findings \\\n  --detector-id $(aws guardduty list-detectors --query 'DetectorIds[0]' --output text) \\\n  --finding-ids FINDING_IDS \\\n  --query 'Findings[*].{Type:Type,Severity:Severity,Resource:Resource.S3BucketDetails[0].Name,Action:Service.Action}' \\\n  --output table\n```\n\n### Step 4: Analyze Macie Findings for Sensitive Data Access\n\nReview Macie findings to correlate data sensitivity with access anomalies.\n\n```bash\n# List Macie findings for sensitive data exposure\naws macie2 list-findings \\\n  --finding-criteria '{\n    \"criterion\": {\n      \"category\": {\"eq\": [\"CLASSIFICATION\"]},\n      \"severity.description\": {\"eq\": [\"High\", \"Critical\"]}\n    }\n  }' \\\n  --sort-criteria '{\"attributeName\": \"updatedAt\", \"orderBy\": \"DESC\"}' \\\n  --max-results 25\n\n# Get detailed finding with data classification\naws macie2 get-findings \\\n  --finding-ids FINDING_IDS \\\n  --query 'findings[*].{Type:type,Severity:severity.description,Bucket:resourcesAffected.s3Bucket.name,SensitiveDataTypes:classificationDetails.result.sensitiveData[*].category}' \\\n  --output table\n\n# Run a sensitive data discovery job on target bucket\naws macie2 create-classification-job \\\n  --job-type ONE_TIME \\\n  --name \"exfiltration-investigation\" \\\n  --s3-job-definition '{\n    \"bucketDefinitions\": [{\n      \"accountId\": \"ACCOUNT_ID\",\n      \"buckets\": [\"sensitive-data-bucket\"]\n    }]\n  }'\n```\n\n### Step 5: Build Automated Detection Rules\n\nCreate CloudWatch alarms and EventBridge rules for real-time exfiltration detection.\n\n```bash\n# CloudWatch metric filter for high-volume S3 downloads\naws logs put-metric-filter \\\n  --log-group-name cloudtrail-logs \\\n  --filter-name s3-bulk-download \\\n  --filter-pattern '{$.eventName = \"GetObject\" && $.eventSource = \"s3.amazonaws.com\"}' \\\n  --metric-transformations '[{\n    \"metricName\": \"S3GetObjectCount\",\n    \"metricNamespace\": \"SecurityMetrics\",\n    \"metricValue\": \"1\",\n    \"defaultValue\": 0\n  }]'\n\n# Alarm for anomalous download volume (>1000 objects\u002Fhour)\naws cloudwatch put-metric-alarm \\\n  --alarm-name s3-exfiltration-alert \\\n  --metric-name S3GetObjectCount \\\n  --namespace SecurityMetrics \\\n  --statistic Sum \\\n  --period 3600 \\\n  --threshold 1000 \\\n  --comparison-operator GreaterThanThreshold \\\n  --evaluation-periods 1 \\\n  --alarm-actions arn:aws:sns:us-east-1:ACCOUNT:security-alerts\n\n# EventBridge rule for GuardDuty S3 findings\naws events put-rule \\\n  --name guardduty-s3-exfiltration \\\n  --event-pattern '{\n    \"source\": [\"aws.guardduty\"],\n    \"detail-type\": [\"GuardDuty Finding\"],\n    \"detail\": {\n      \"type\": [{\"prefix\": \"Exfiltration:S3\u002F\"}]\n    }\n  }'\n```\n\n### Step 6: Implement Preventive Controls\n\nDeploy bucket policies and VPC endpoint policies to restrict data movement paths.\n\n```bash\n# VPC endpoint policy restricting S3 access to specific buckets\naws ec2 modify-vpc-endpoint \\\n  --vpc-endpoint-id vpce-ENDPOINT_ID \\\n  --policy-document '{\n    \"Statement\": [{\n      \"Sid\": \"RestrictToOwnBuckets\",\n      \"Effect\": \"Allow\",\n      \"Principal\": \"*\",\n      \"Action\": [\"s3:GetObject\", \"s3:PutObject\"],\n      \"Resource\": [\"arn:aws:s3:::approved-bucket-1\u002F*\", \"arn:aws:s3:::approved-bucket-2\u002F*\"]\n    }]\n  }'\n\n# Bucket policy denying access from outside the VPC\naws s3api put-bucket-policy --bucket sensitive-data-bucket --policy '{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Sid\": \"DenyNonVpcAccess\",\n    \"Effect\": \"Deny\",\n    \"Principal\": \"*\",\n    \"Action\": \"s3:GetObject\",\n    \"Resource\": \"arn:aws:s3:::sensitive-data-bucket\u002F*\",\n    \"Condition\": {\n      \"StringNotEquals\": {\n        \"aws:sourceVpce\": \"vpce-ENDPOINT_ID\"\n      }\n    }\n  }]\n}'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| S3 Data Events | CloudTrail object-level logging that captures GetObject, PutObject, DeleteObject, and CopyObject API calls with request details |\n| GuardDuty S3 Protection | Threat detection feature analyzing CloudTrail S3 data events to identify anomalous access patterns and exfiltration attempts |\n| Amazon Macie | Data security service that discovers and classifies sensitive data in S3 and generates findings for data exposure risks |\n| VPC Endpoint Policy | Access control policy on an S3 VPC endpoint that restricts which buckets and actions can be accessed through the endpoint |\n| Data Exfiltration | Unauthorized transfer of data from an organization's S3 storage to an external location controlled by an attacker |\n| Anomalous Behavior Detection | Machine learning-based identification of S3 access patterns that deviate from established baselines for a principal |\n\n## Tools & Systems\n\n- **AWS CloudTrail**: Audit logging of S3 object-level operations for forensic analysis and anomaly detection\n- **Amazon GuardDuty**: ML-based threat detection with S3-specific finding types for exfiltration and unauthorized access\n- **Amazon Macie**: Sensitive data discovery and classification for correlating access anomalies with data sensitivity\n- **Amazon Athena**: SQL query engine for analyzing CloudTrail logs at scale to identify bulk download patterns\n- **CloudWatch Logs Insights**: Real-time log analysis for building detection queries against CloudTrail data\n\n## Common Scenarios\n\n### Scenario: Compromised IAM Credentials Used for Bulk S3 Data Download\n\n**Context**: GuardDuty reports an `Exfiltration:S3\u002FObjectRead.Unusual` finding indicating that a developer's access key is downloading thousands of objects from a sensitive data bucket at 3 AM from an IP address in a foreign country.\n\n**Approach**:\n1. Immediately deactivate the compromised access key\n2. Query CloudTrail for all S3 actions by the compromised principal in the last 72 hours\n3. Identify which buckets and objects were accessed using Athena queries\n4. Cross-reference accessed objects with Macie classifications to assess data sensitivity\n5. Check for CopyObject calls to external accounts (cross-account exfiltration)\n6. Review how the credentials were compromised (TruffleHog scan, phishing investigation)\n7. Implement VPC endpoint policies to restrict future S3 access to approved network paths\n\n**Pitfalls**: CloudTrail S3 data events can generate massive log volume. Use Athena with partitioned tables rather than CloudWatch Logs Insights for queries spanning more than 24 hours. GuardDuty baseline learning requires 7-14 days, so new accounts may generate false positives for normal access patterns.\n\n## Output Format\n\n```\nS3 Data Exfiltration Investigation Report\n============================================\nAccount: 123456789012\nDetection Source: GuardDuty Exfiltration:S3\u002FObjectRead.Unusual\nInvestigation Date: 2026-02-23\n\nINCIDENT TIMELINE:\n  2026-02-23 02:47 UTC - First anomalous GetObject from 185.x.x.x\n  2026-02-23 02:47-04:12 UTC - 12,847 GetObject requests\n  2026-02-23 04:15 UTC - GuardDuty finding generated\n  2026-02-23 04:20 UTC - PagerDuty alert received by SOC\n  2026-02-23 04:25 UTC - Access key deactivated\n\nCOMPROMISED PRINCIPAL:\n  ARN: arn:aws:iam::123456789012:user\u002Fdeveloper-jane\n  Access Key: AKIA...WXYZ\n  Source IP: 185.x.x.x (Tor exit node)\n\nDATA IMPACT ASSESSMENT:\n  Buckets accessed: 3\n  Objects downloaded: 12,847\n  Total data volume: 4.7 GB\n  Sensitive data types: PII (SSN, email), Financial (credit card)\n  Macie severity: CRITICAL\n\nCONTAINMENT ACTIONS:\n  [x] Access key deactivated\n  [x] User password reset and MFA re-enrolled\n  [x] VPC endpoint policy applied to sensitive buckets\n  [x] Bucket policy restricting to VPC-only access\n  [x] TruffleHog scan initiated on developer repositories\n```\n",{"name":5,"tags":56,"author":57,"domain":50,"license":16,"version":58,"nist_csf":59,"subdomain":46,"description":64,"mitre_attack":65},[46,39,32,42,37,36,35],"mahipal","1.0",[60,61,62,63],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","Detecting data exfiltration attempts from AWS S3 buckets by analyzing CloudTrail S3 data events, VPC Flow Logs, GuardDuty findings, Amazon Macie alerts, and S3 access patterns to identify unauthorized bulk downloads and cross-account data transfers.\n",[66,67,68,69],"T1530","T1567.002","T1537","T1119","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fdetecting-s3-data-exfiltration-attempts",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":81,"prompt":91,"zipAvailable":92},[82,85,88],{"tool":83,"command":84},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill detecting-s3-data-exfiltration-attempts",{"tool":86,"command":87},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill detecting-s3-data-exfiltration-attempts",{"tool":89,"command":90},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill detecting-s3-data-exfiltration-attempts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-s3-data-exfiltration-attempts\u002FSKILL.md",true,[94,99,105,109],{"path":95,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-s3-data-exfiltration-attempts\u002FLICENSE",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fapi-reference.md","REFERENCE","参考文档",2540,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-s3-data-exfiltration-attempts\u002Freferences\u002Fapi-reference.md",{"path":106,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Ffix-and-verify.md",4636,"https:\u002F\u002Fgithub.com\u002Fkevinpita\u002Fnixos-config\u002Fblob\u002Fmain\u002Fagents\u002Fskills\u002Fthermo-loop\u002Freferences\u002Ffix-and-verify.md",{"path":110,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":113,"sourceHtmlUrl":114},"scripts\u002Fagent.py","SCRIPT","脚本",8238,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-s3-data-exfiltration-attempts\u002Fscripts\u002Fagent.py",[116,146,175,206,235,267],{"skillNo":117,"name":118,"nameZh":119,"description":120,"descriptionZh":121,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":122,"categories":123,"keywords":128,"publishedAt":51},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[124,125],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":126,"categoryName":127,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[129,130,131,132,43,50,133,134,49,135,136,137,138,139,140,141,142,143,144,145],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":147,"name":148,"nameZh":149,"description":150,"descriptionZh":151,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":152,"categories":153,"keywords":158,"publishedAt":51},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[154,155],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":156,"categoryName":157,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[159,142,160,161,43,162,50,49,163,164,165,166,167,168,169,170,171,172,173,174],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":176,"name":177,"nameZh":178,"description":179,"descriptionZh":180,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":181,"categories":182,"keywords":189,"publishedAt":51},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[183,186],{"categoryNo":184,"categoryName":185,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":187,"categoryName":188,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[169,190,191,192,193,50,194,195,163,196,197,198,199,200,38,201,202,203,204,205],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":207,"name":208,"nameZh":209,"description":210,"descriptionZh":211,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":212,"categories":213,"keywords":218,"publishedAt":51},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[214,215],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":216,"categoryName":217,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[219,220,221,50,222,223,48,224,225,226,227,33,228,229,230,231,166,232,233,234],"windows","kape","triaging windows with kape","registry","browser","windows-forensics","dfir","mft","mftecmd","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":236,"name":237,"nameZh":238,"description":239,"descriptionZh":240,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":241,"categories":242,"keywords":247,"publishedAt":51},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[243,246],{"categoryNo":244,"categoryName":245,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[248,249,250,50,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":268,"name":269,"nameZh":270,"description":271,"descriptionZh":272,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":273,"categories":274,"keywords":279,"publishedAt":51},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[275,276],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":277,"categoryName":278,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎",[43,280,50,281,282,283,284,285,286,287,288,201,289,202,290,291,292,293,294,295],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]