[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73AQQYWSHS0NAE73VF8T3QF":3,"skill-same:01M73AQQYWSHS0NAE73VF8T3QF":90},{"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":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M73AQQYWSHS0NAE73VF8T3QF","detecting-compromised-cloud-credentials",null,"Detecting compromised cloud credentials across AWS, Azure, and GCP by analyzing anomalous API activity, impossible travel patterns, unauthorized resource provisioning, and credential abuse indicators using GuardDuty, Defender for Identity, and SCC Event Threat Detection.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-compromised-cloud-credentials\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-compromised-cloud-credentials\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: detecting-compromised-cloud-credentials\ndescription: 'Detecting compromised cloud credentials across AWS, Azure, and GCP by\n  analyzing anomalous API activity, impossible travel patterns, unauthorized resource\n  provisioning, and credential abuse indicators using GuardDuty, Defender for Identity,\n  and SCC Event Threat Detection.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- cloud-security\n- credential-compromise\n- threat-detection\n- guardduty\n- incident-response\n- anomaly-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- T1078.004\n- T1530\n- T1537\n- T1580\n- T1003\nsource: https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\nsource_commit: 04450304b12645cb2b974ab96d28c0664758a88d\nnote: \"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.\"\n---\n\n# Detecting Compromised Cloud Credentials\n\n## When to Use\n\n- When investigating alerts about unusual cloud API activity from unfamiliar locations\n- When building detection rules for credential theft and abuse across cloud environments\n- When responding to notifications from cloud providers about exposed credentials\n- When monitoring for credential stuffing or brute force attacks against cloud identities\n- When assessing the scope of a credential compromise after initial detection\n\n**Do not use** for preventing credential compromise (use MFA, credential rotation, and secrets management), for detecting application-level credential theft (use application security monitoring), or for endpoint credential harvesting detection (use EDR tools).\n\n## Prerequisites\n\n- AWS GuardDuty enabled across all accounts and regions\n- Azure Defender for Identity and Entra ID Protection configured\n- GCP Security Command Center with Event Threat Detection enabled\n- CloudTrail, Azure Activity Log, and GCP Audit Log centralized for analysis\n- SIEM integration for cross-cloud correlation of credential abuse indicators\n- Threat intelligence feeds for known malicious IP ranges\n\n## Workflow\n\n### Step 1: Detect Credential Compromise Indicators in AWS\n\nMonitor GuardDuty findings and CloudTrail anomalies that indicate credential abuse.\n\n```bash\n# List GuardDuty credential-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          \"UnauthorizedAccess:IAMUser\u002FInstanceCredentialExfiltration.OutsideAWS\",\n          \"UnauthorizedAccess:IAMUser\u002FMaliciousIPCaller\",\n          \"UnauthorizedAccess:IAMUser\u002FMaliciousIPCaller.Custom\",\n          \"UnauthorizedAccess:IAMUser\u002FTorIPCaller\",\n          \"UnauthorizedAccess:IAMUser\u002FConsoleLoginSuccess.B\",\n          \"Recon:IAMUser\u002FMaliciousIPCaller\",\n          \"Recon:IAMUser\u002FMaliciousIPCaller.Custom\",\n          \"InitialAccess:IAMUser\u002FAnomalousBehavior\",\n          \"CredentialAccess:IAMUser\u002FAnomalousBehavior\",\n          \"Persistence:IAMUser\u002FAnomalousBehavior\"\n        ]\n      },\n      \"service.archived\": {\"Eq\": [\"false\"]}\n    }\n  }' --output json\n\n# Check for console logins from new locations\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.userName, sourceIPAddress, responseElements.ConsoleLogin\n    | filter eventName = \"ConsoleLogin\"\n    | filter responseElements.ConsoleLogin = \"Success\"\n    | stats count() by userIdentity.userName, sourceIPAddress\n    | sort count desc\n  '\n\n# Detect impossible travel (same user from geographically distant IPs within short time)\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, eventName\n    | filter userIdentity.type = \"IAMUser\"\n    | stats earliest(@timestamp) as first_seen, latest(@timestamp) as last_seen,\n            count_distinct(sourceIPAddress) as unique_ips by userIdentity.arn\n    | filter unique_ips > 3\n  '\n```\n\n### Step 2: Detect Credential Abuse in Azure\n\nMonitor Entra ID sign-in logs and Defender for Identity alerts for compromised credentials.\n\n```bash\n# Check for risky sign-ins\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FauditLogs\u002FsignIns?\\$filter=riskLevelDuringSignIn ne 'none' and createdDateTime ge 2026-02-16T00:00:00Z&\\$top=50\" \\\n  --query \"value[*].{User:userPrincipalName,Risk:riskLevelDuringSignIn,IP:ipAddress,Location:location.city,App:appDisplayName,Status:status.errorCode}\" \\\n  -o table\n\n# Check for sign-ins from anonymous or Tor IPs\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FauditLogs\u002FsignIns?\\$filter=riskEventTypes_v2\u002Fany(r:r eq 'anonymizedIPAddress') and createdDateTime ge 2026-02-22T00:00:00Z\" \\\n  --query \"value[*].{User:userPrincipalName,IP:ipAddress,Location:location.city}\" \\\n  -o table\n\n# List users flagged as compromised by Identity Protection\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FidentityProtection\u002FriskyUsers?\\$filter=riskLevel eq 'high'\" \\\n  --query \"value[*].{User:userPrincipalName,RiskLevel:riskLevel,RiskState:riskState,LastDetected:riskLastUpdatedDateTime}\" \\\n  -o table\n\n# Check for suspicious application consent grants\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FauditLogs\u002FdirectoryAudits?\\$filter=activityDisplayName eq 'Consent to application' and activityDateTime ge 2026-02-16T00:00:00Z\" \\\n  --query \"value[*].{Activity:activityDisplayName,User:initiatedBy.user.userPrincipalName,App:targetResources[0].displayName}\" \\\n  -o table\n```\n\n### Step 3: Detect Credential Abuse in GCP\n\nQuery GCP audit logs and SCC findings for credential compromise indicators.\n\n```bash\n# Check SCC Event Threat Detection findings\ngcloud scc findings list ORG_ID \\\n  --filter=\"state=\\\"ACTIVE\\\" AND (category=\\\"ANOMALOUS_CALLER_LOCATION\\\" OR category=\\\"SUSPICIOUS_LOGIN\\\" OR category=\\\"CREDENTIAL_ACCESS\\\")\" \\\n  --format=\"table(finding.category, finding.severity, finding.resourceName, finding.eventTime)\"\n\n# Query audit logs for service account key usage from unusual IPs\ngcloud logging read '\n  protoPayload.authenticationInfo.principalEmail:*@*.iam.gserviceaccount.com\n  AND protoPayload.requestMetadata.callerIp!=(\"10.\" OR \"172.\" OR \"192.168.\")\n  AND timestamp>=\"2026-02-22T00:00:00Z\"\n' --limit=100 --format=\"table(timestamp, protoPayload.authenticationInfo.principalEmail, protoPayload.requestMetadata.callerIp, protoPayload.methodName)\"\n\n# Detect API calls from Tor exit nodes\ngcloud logging read '\n  protoPayload.requestMetadata.callerIp:(\"185.\" OR \"198.\" OR \"45.\")\n  AND protoPayload.authenticationInfo.principalEmail:*@company.com\n  AND timestamp>=\"2026-02-22T00:00:00Z\"\n' --limit=50 --format=json\n\n# Check for new service account keys created (persistence indicator)\ngcloud logging read '\n  protoPayload.methodName=\"google.iam.admin.v1.CreateServiceAccountKey\"\n  AND timestamp>=\"2026-02-16T00:00:00Z\"\n' --format=\"table(timestamp, protoPayload.authenticationInfo.principalEmail, protoPayload.request.name)\"\n```\n\n### Step 4: Build Cross-Cloud Correlation Rules\n\nCreate SIEM rules that correlate credential abuse indicators across cloud providers.\n\n```python\n# siem_correlation.py - Cross-cloud credential abuse detection\nimport json\nfrom datetime import datetime, timedelta\n\ndef detect_impossible_travel(events):\n    \"\"\"Detect same identity used from distant locations in short timeframe.\"\"\"\n    user_events = {}\n    for event in events:\n        user = event.get('principal', '')\n        ip = event.get('source_ip', '')\n        ts = event.get('timestamp', '')\n        cloud = event.get('cloud_provider', '')\n\n        key = f\"{user}_{cloud}\"\n        if key not in user_events:\n            user_events[key] = []\n        user_events[key].append({'ip': ip, 'timestamp': ts, 'cloud': cloud})\n\n    alerts = []\n    for user_key, accesses in user_events.items():\n        accesses.sort(key=lambda x: x['timestamp'])\n        for i in range(1, len(accesses)):\n            time_diff = (datetime.fromisoformat(accesses[i]['timestamp']) -\n                        datetime.fromisoformat(accesses[i-1]['timestamp']))\n            if time_diff \u003C timedelta(hours=1) and accesses[i]['ip'] != accesses[i-1]['ip']:\n                alerts.append({\n                    'type': 'IMPOSSIBLE_TRAVEL',\n                    'user': user_key,\n                    'ip_1': accesses[i-1]['ip'],\n                    'ip_2': accesses[i]['ip'],\n                    'time_gap_minutes': time_diff.total_seconds() \u002F 60,\n                    'severity': 'HIGH'\n                })\n    return alerts\n\ndef detect_credential_stuffing(events, threshold=10):\n    \"\"\"Detect multiple failed logins followed by success.\"\"\"\n    user_attempts = {}\n    for event in events:\n        user = event.get('principal', '')\n        success = event.get('success', False)\n        key = user\n        if key not in user_attempts:\n            user_attempts[key] = {'failures': 0, 'success_after_failures': False}\n        if not success:\n            user_attempts[key]['failures'] += 1\n        elif user_attempts[key]['failures'] >= threshold:\n            user_attempts[key]['success_after_failures'] = True\n\n    return [{'user': u, 'failures': d['failures'], 'severity': 'CRITICAL'}\n            for u, d in user_attempts.items() if d['success_after_failures']]\n```\n\n### Step 5: Respond to Confirmed Credential Compromise\n\nExecute containment actions when credential compromise is confirmed.\n\n```bash\n# AWS: Deactivate access key immediately\naws iam update-access-key --user-name COMPROMISED_USER \\\n  --access-key-id AKIA_COMPROMISED --status Inactive\n\n# AWS: Invalidate temporary role credentials by updating role trust policy\naws iam update-assume-role-policy --role-name COMPROMISED_ROLE \\\n  --policy-document '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"sts:AssumeRole\"}]}'\n\n# AWS: Revoke all sessions for an IAM user\naws iam put-user-policy --user-name COMPROMISED_USER \\\n  --policy-name RevokeOldSessions \\\n  --policy-document '{\n    \"Version\":\"2012-10-17\",\n    \"Statement\":[{\n      \"Effect\":\"Deny\",\n      \"Action\":\"*\",\n      \"Resource\":\"*\",\n      \"Condition\":{\"DateLessThan\":{\"aws:TokenIssueTime\":\"2026-02-23T10:00:00Z\"}}\n    }]\n  }'\n\n# Azure: Revoke all sign-in sessions\naz rest --method POST \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002Fusers\u002FCOMPROMISED_USER_ID\u002FrevokeSignInSessions\"\n\n# Azure: Force password reset\naz ad user update --id COMPROMISED_USER_ID --force-change-password-next-sign-in true\n\n# GCP: Disable service account\ngcloud iam service-accounts disable COMPROMISED_SA_EMAIL\n\n# GCP: Delete service account keys\ngcloud iam service-accounts keys delete KEY_ID --iam-account=COMPROMISED_SA_EMAIL\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Impossible Travel | Detection of the same credential being used from geographically distant locations within a time period that makes physical travel impossible |\n| Credential Stuffing | Attack using stolen username\u002Fpassword combinations from data breaches to attempt login across multiple cloud services |\n| Instance Credential Exfiltration | GuardDuty finding indicating EC2 instance role credentials are being used from outside the expected AWS network |\n| Anomalous Behavior | Machine learning-based detection of API call patterns that deviate significantly from the established baseline for a principal |\n| Session Revocation | Invalidating all active authentication sessions for a compromised principal to force re-authentication with new credentials |\n| Persistence Indicator | Attacker actions designed to maintain access after initial compromise, such as creating new access keys or service account keys |\n\n## Tools & Systems\n\n- **AWS GuardDuty**: ML-based threat detection with specific finding types for credential compromise and unauthorized access\n- **Microsoft Entra ID Protection**: Identity risk detection for sign-in anomalies, compromised credentials, and risky user behavior\n- **GCP Event Threat Detection**: SCC component detecting anomalous API usage and credential abuse in GCP environments\n- **CloudTrail \u002F Activity Log \u002F Audit Log**: API audit logs providing the raw data for credential compromise investigation\n- **SIEM (Splunk, Elastic, Sentinel)**: Centralized platform for cross-cloud correlation of credential abuse indicators\n\n## Common Scenarios\n\n### Scenario: Detecting an Access Key Compromised via Phishing\n\n**Context**: A developer receives a phishing email that harvests their AWS console credentials. The attacker logs in from a foreign IP, creates a new access key, and begins enumerating the account.\n\n**Approach**:\n1. GuardDuty triggers `UnauthorizedAccess:IAMUser\u002FConsoleLoginSuccess.B` for login from unusual country\n2. SOC reviews the finding and correlates with phishing reports from the email security team\n3. Query CloudTrail for all actions by the compromised user from the attacker's IP\n4. Discover the attacker created new access keys and ran IAM enumeration commands\n5. Immediately deactivate all access keys for the user and revoke active sessions\n6. Force password reset and re-enroll MFA\n7. Check for persistence: new IAM users, roles, Lambda functions, or EC2 instances created\n8. Remove any persistence artifacts and document the incident timeline\n\n**Pitfalls**: Simply changing the password does not invalidate existing access keys or active sessions. All access keys must be rotated and temporary credentials revoked by adding a deny-all policy for tokens issued before the compromise was detected. Attackers may create new IAM users or roles for persistence before the initial credential is revoked.\n\n## Output Format\n\n```\nCloud Credential Compromise Detection Report\n===============================================\nDetection Date: 2026-02-23\nScope: Multi-cloud (AWS, Azure, GCP)\nPeriod: 2026-02-16 to 2026-02-23\n\nACTIVE COMPROMISE INDICATORS:\n[CRED-001] AWS Console Login from Unusual Location\n  User: developer@company.com\n  Source IP: 185.x.x.x (Russia)\n  Normal Location: US-East\n  GuardDuty Finding: UnauthorizedAccess:IAMUser\u002FConsoleLoginSuccess.B\n  Severity: HIGH\n  Status: Credential deactivated\n\n[CRED-002] Azure Impossible Travel Detection\n  User: admin@company.onmicrosoft.com\n  Location 1: New York, US (09:00 UTC)\n  Location 2: Beijing, CN (09:15 UTC)\n  Risk Level: HIGH\n  Status: Sessions revoked, under investigation\n\nDETECTION METRICS (Last 7 Days):\n  Impossible travel detections:        5\n  Anomalous API activity alerts:      12\n  Failed login attempts > threshold:   3\n  New credentials from unusual IPs:    2\n  Total compromises confirmed:         2\n\nCONTAINMENT ACTIONS TAKEN:\n  AWS access keys deactivated:    3\n  Azure sessions revoked:         2\n  GCP service accounts disabled:  1\n  Passwords force-reset:          4\n  MFA re-enrolled:                4\n```\n","# Detecting Compromised Cloud Credentials\n\n## When to Use\n\n- When investigating alerts about unusual cloud API activity from unfamiliar locations\n- When building detection rules for credential theft and abuse across cloud environments\n- When responding to notifications from cloud providers about exposed credentials\n- When monitoring for credential stuffing or brute force attacks against cloud identities\n- When assessing the scope of a credential compromise after initial detection\n\n**Do not use** for preventing credential compromise (use MFA, credential rotation, and secrets management), for detecting application-level credential theft (use application security monitoring), or for endpoint credential harvesting detection (use EDR tools).\n\n## Prerequisites\n\n- AWS GuardDuty enabled across all accounts and regions\n- Azure Defender for Identity and Entra ID Protection configured\n- GCP Security Command Center with Event Threat Detection enabled\n- CloudTrail, Azure Activity Log, and GCP Audit Log centralized for analysis\n- SIEM integration for cross-cloud correlation of credential abuse indicators\n- Threat intelligence feeds for known malicious IP ranges\n\n## Workflow\n\n### Step 1: Detect Credential Compromise Indicators in AWS\n\nMonitor GuardDuty findings and CloudTrail anomalies that indicate credential abuse.\n\n```bash\n# List GuardDuty credential-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          \"UnauthorizedAccess:IAMUser\u002FInstanceCredentialExfiltration.OutsideAWS\",\n          \"UnauthorizedAccess:IAMUser\u002FMaliciousIPCaller\",\n          \"UnauthorizedAccess:IAMUser\u002FMaliciousIPCaller.Custom\",\n          \"UnauthorizedAccess:IAMUser\u002FTorIPCaller\",\n          \"UnauthorizedAccess:IAMUser\u002FConsoleLoginSuccess.B\",\n          \"Recon:IAMUser\u002FMaliciousIPCaller\",\n          \"Recon:IAMUser\u002FMaliciousIPCaller.Custom\",\n          \"InitialAccess:IAMUser\u002FAnomalousBehavior\",\n          \"CredentialAccess:IAMUser\u002FAnomalousBehavior\",\n          \"Persistence:IAMUser\u002FAnomalousBehavior\"\n        ]\n      },\n      \"service.archived\": {\"Eq\": [\"false\"]}\n    }\n  }' --output json\n\n# Check for console logins from new locations\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.userName, sourceIPAddress, responseElements.ConsoleLogin\n    | filter eventName = \"ConsoleLogin\"\n    | filter responseElements.ConsoleLogin = \"Success\"\n    | stats count() by userIdentity.userName, sourceIPAddress\n    | sort count desc\n  '\n\n# Detect impossible travel (same user from geographically distant IPs within short time)\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, eventName\n    | filter userIdentity.type = \"IAMUser\"\n    | stats earliest(@timestamp) as first_seen, latest(@timestamp) as last_seen,\n            count_distinct(sourceIPAddress) as unique_ips by userIdentity.arn\n    | filter unique_ips > 3\n  '\n```\n\n### Step 2: Detect Credential Abuse in Azure\n\nMonitor Entra ID sign-in logs and Defender for Identity alerts for compromised credentials.\n\n```bash\n# Check for risky sign-ins\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FauditLogs\u002FsignIns?\\$filter=riskLevelDuringSignIn ne 'none' and createdDateTime ge 2026-02-16T00:00:00Z&\\$top=50\" \\\n  --query \"value[*].{User:userPrincipalName,Risk:riskLevelDuringSignIn,IP:ipAddress,Location:location.city,App:appDisplayName,Status:status.errorCode}\" \\\n  -o table\n\n# Check for sign-ins from anonymous or Tor IPs\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FauditLogs\u002FsignIns?\\$filter=riskEventTypes_v2\u002Fany(r:r eq 'anonymizedIPAddress') and createdDateTime ge 2026-02-22T00:00:00Z\" \\\n  --query \"value[*].{User:userPrincipalName,IP:ipAddress,Location:location.city}\" \\\n  -o table\n\n# List users flagged as compromised by Identity Protection\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FidentityProtection\u002FriskyUsers?\\$filter=riskLevel eq 'high'\" \\\n  --query \"value[*].{User:userPrincipalName,RiskLevel:riskLevel,RiskState:riskState,LastDetected:riskLastUpdatedDateTime}\" \\\n  -o table\n\n# Check for suspicious application consent grants\naz rest --method GET \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002FauditLogs\u002FdirectoryAudits?\\$filter=activityDisplayName eq 'Consent to application' and activityDateTime ge 2026-02-16T00:00:00Z\" \\\n  --query \"value[*].{Activity:activityDisplayName,User:initiatedBy.user.userPrincipalName,App:targetResources[0].displayName}\" \\\n  -o table\n```\n\n### Step 3: Detect Credential Abuse in GCP\n\nQuery GCP audit logs and SCC findings for credential compromise indicators.\n\n```bash\n# Check SCC Event Threat Detection findings\ngcloud scc findings list ORG_ID \\\n  --filter=\"state=\\\"ACTIVE\\\" AND (category=\\\"ANOMALOUS_CALLER_LOCATION\\\" OR category=\\\"SUSPICIOUS_LOGIN\\\" OR category=\\\"CREDENTIAL_ACCESS\\\")\" \\\n  --format=\"table(finding.category, finding.severity, finding.resourceName, finding.eventTime)\"\n\n# Query audit logs for service account key usage from unusual IPs\ngcloud logging read '\n  protoPayload.authenticationInfo.principalEmail:*@*.iam.gserviceaccount.com\n  AND protoPayload.requestMetadata.callerIp!=(\"10.\" OR \"172.\" OR \"192.168.\")\n  AND timestamp>=\"2026-02-22T00:00:00Z\"\n' --limit=100 --format=\"table(timestamp, protoPayload.authenticationInfo.principalEmail, protoPayload.requestMetadata.callerIp, protoPayload.methodName)\"\n\n# Detect API calls from Tor exit nodes\ngcloud logging read '\n  protoPayload.requestMetadata.callerIp:(\"185.\" OR \"198.\" OR \"45.\")\n  AND protoPayload.authenticationInfo.principalEmail:*@company.com\n  AND timestamp>=\"2026-02-22T00:00:00Z\"\n' --limit=50 --format=json\n\n# Check for new service account keys created (persistence indicator)\ngcloud logging read '\n  protoPayload.methodName=\"google.iam.admin.v1.CreateServiceAccountKey\"\n  AND timestamp>=\"2026-02-16T00:00:00Z\"\n' --format=\"table(timestamp, protoPayload.authenticationInfo.principalEmail, protoPayload.request.name)\"\n```\n\n### Step 4: Build Cross-Cloud Correlation Rules\n\nCreate SIEM rules that correlate credential abuse indicators across cloud providers.\n\n```python\n# siem_correlation.py - Cross-cloud credential abuse detection\nimport json\nfrom datetime import datetime, timedelta\n\ndef detect_impossible_travel(events):\n    \"\"\"Detect same identity used from distant locations in short timeframe.\"\"\"\n    user_events = {}\n    for event in events:\n        user = event.get('principal', '')\n        ip = event.get('source_ip', '')\n        ts = event.get('timestamp', '')\n        cloud = event.get('cloud_provider', '')\n\n        key = f\"{user}_{cloud}\"\n        if key not in user_events:\n            user_events[key] = []\n        user_events[key].append({'ip': ip, 'timestamp': ts, 'cloud': cloud})\n\n    alerts = []\n    for user_key, accesses in user_events.items():\n        accesses.sort(key=lambda x: x['timestamp'])\n        for i in range(1, len(accesses)):\n            time_diff = (datetime.fromisoformat(accesses[i]['timestamp']) -\n                        datetime.fromisoformat(accesses[i-1]['timestamp']))\n            if time_diff \u003C timedelta(hours=1) and accesses[i]['ip'] != accesses[i-1]['ip']:\n                alerts.append({\n                    'type': 'IMPOSSIBLE_TRAVEL',\n                    'user': user_key,\n                    'ip_1': accesses[i-1]['ip'],\n                    'ip_2': accesses[i]['ip'],\n                    'time_gap_minutes': time_diff.total_seconds() \u002F 60,\n                    'severity': 'HIGH'\n                })\n    return alerts\n\ndef detect_credential_stuffing(events, threshold=10):\n    \"\"\"Detect multiple failed logins followed by success.\"\"\"\n    user_attempts = {}\n    for event in events:\n        user = event.get('principal', '')\n        success = event.get('success', False)\n        key = user\n        if key not in user_attempts:\n            user_attempts[key] = {'failures': 0, 'success_after_failures': False}\n        if not success:\n            user_attempts[key]['failures'] += 1\n        elif user_attempts[key]['failures'] >= threshold:\n            user_attempts[key]['success_after_failures'] = True\n\n    return [{'user': u, 'failures': d['failures'], 'severity': 'CRITICAL'}\n            for u, d in user_attempts.items() if d['success_after_failures']]\n```\n\n### Step 5: Respond to Confirmed Credential Compromise\n\nExecute containment actions when credential compromise is confirmed.\n\n```bash\n# AWS: Deactivate access key immediately\naws iam update-access-key --user-name COMPROMISED_USER \\\n  --access-key-id AKIA_COMPROMISED --status Inactive\n\n# AWS: Invalidate temporary role credentials by updating role trust policy\naws iam update-assume-role-policy --role-name COMPROMISED_ROLE \\\n  --policy-document '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"sts:AssumeRole\"}]}'\n\n# AWS: Revoke all sessions for an IAM user\naws iam put-user-policy --user-name COMPROMISED_USER \\\n  --policy-name RevokeOldSessions \\\n  --policy-document '{\n    \"Version\":\"2012-10-17\",\n    \"Statement\":[{\n      \"Effect\":\"Deny\",\n      \"Action\":\"*\",\n      \"Resource\":\"*\",\n      \"Condition\":{\"DateLessThan\":{\"aws:TokenIssueTime\":\"2026-02-23T10:00:00Z\"}}\n    }]\n  }'\n\n# Azure: Revoke all sign-in sessions\naz rest --method POST \\\n  --url \"https:\u002F\u002Fgraph.microsoft.com\u002Fv1.0\u002Fusers\u002FCOMPROMISED_USER_ID\u002FrevokeSignInSessions\"\n\n# Azure: Force password reset\naz ad user update --id COMPROMISED_USER_ID --force-change-password-next-sign-in true\n\n# GCP: Disable service account\ngcloud iam service-accounts disable COMPROMISED_SA_EMAIL\n\n# GCP: Delete service account keys\ngcloud iam service-accounts keys delete KEY_ID --iam-account=COMPROMISED_SA_EMAIL\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Impossible Travel | Detection of the same credential being used from geographically distant locations within a time period that makes physical travel impossible |\n| Credential Stuffing | Attack using stolen username\u002Fpassword combinations from data breaches to attempt login across multiple cloud services |\n| Instance Credential Exfiltration | GuardDuty finding indicating EC2 instance role credentials are being used from outside the expected AWS network |\n| Anomalous Behavior | Machine learning-based detection of API call patterns that deviate significantly from the established baseline for a principal |\n| Session Revocation | Invalidating all active authentication sessions for a compromised principal to force re-authentication with new credentials |\n| Persistence Indicator | Attacker actions designed to maintain access after initial compromise, such as creating new access keys or service account keys |\n\n## Tools & Systems\n\n- **AWS GuardDuty**: ML-based threat detection with specific finding types for credential compromise and unauthorized access\n- **Microsoft Entra ID Protection**: Identity risk detection for sign-in anomalies, compromised credentials, and risky user behavior\n- **GCP Event Threat Detection**: SCC component detecting anomalous API usage and credential abuse in GCP environments\n- **CloudTrail \u002F Activity Log \u002F Audit Log**: API audit logs providing the raw data for credential compromise investigation\n- **SIEM (Splunk, Elastic, Sentinel)**: Centralized platform for cross-cloud correlation of credential abuse indicators\n\n## Common Scenarios\n\n### Scenario: Detecting an Access Key Compromised via Phishing\n\n**Context**: A developer receives a phishing email that harvests their AWS console credentials. The attacker logs in from a foreign IP, creates a new access key, and begins enumerating the account.\n\n**Approach**:\n1. GuardDuty triggers `UnauthorizedAccess:IAMUser\u002FConsoleLoginSuccess.B` for login from unusual country\n2. SOC reviews the finding and correlates with phishing reports from the email security team\n3. Query CloudTrail for all actions by the compromised user from the attacker's IP\n4. Discover the attacker created new access keys and ran IAM enumeration commands\n5. Immediately deactivate all access keys for the user and revoke active sessions\n6. Force password reset and re-enroll MFA\n7. Check for persistence: new IAM users, roles, Lambda functions, or EC2 instances created\n8. Remove any persistence artifacts and document the incident timeline\n\n**Pitfalls**: Simply changing the password does not invalidate existing access keys or active sessions. All access keys must be rotated and temporary credentials revoked by adding a deny-all policy for tokens issued before the compromise was detected. Attackers may create new IAM users or roles for persistence before the initial credential is revoked.\n\n## Output Format\n\n```\nCloud Credential Compromise Detection Report\n===============================================\nDetection Date: 2026-02-23\nScope: Multi-cloud (AWS, Azure, GCP)\nPeriod: 2026-02-16 to 2026-02-23\n\nACTIVE COMPROMISE INDICATORS:\n[CRED-001] AWS Console Login from Unusual Location\n  User: developer@company.com\n  Source IP: 185.x.x.x (Russia)\n  Normal Location: US-East\n  GuardDuty Finding: UnauthorizedAccess:IAMUser\u002FConsoleLoginSuccess.B\n  Severity: HIGH\n  Status: Credential deactivated\n\n[CRED-002] Azure Impossible Travel Detection\n  User: admin@company.onmicrosoft.com\n  Location 1: New York, US (09:00 UTC)\n  Location 2: Beijing, CN (09:15 UTC)\n  Risk Level: HIGH\n  Status: Sessions revoked, under investigation\n\nDETECTION METRICS (Last 7 Days):\n  Impossible travel detections:        5\n  Anomalous API activity alerts:      12\n  Failed login attempts > threshold:   3\n  New credentials from unusual IPs:    2\n  Total compromises confirmed:         2\n\nCONTAINMENT ACTIONS TAKEN:\n  AWS access keys deactivated:    3\n  Azure sessions revoked:         2\n  GCP service accounts disabled:  1\n  Passwords force-reset:          4\n  MFA re-enrolled:                4\n```\n",{"name":5,"note":25,"tags":26,"author":33,"domain":34,"source":35,"license":15,"version":36,"nist_csf":37,"subdomain":27,"description":42,"mitre_attack":43,"source_commit":49},"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.",[27,28,29,30,31,32],"cloud-security","credential-compromise","threat-detection","guardduty","incident-response","anomaly-detection","mahipal","cybersecurity","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","1.0",[38,39,40,41],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","Detecting compromised cloud credentials across AWS, Azure, and GCP by analyzing anomalous API activity, impossible travel patterns, unauthorized resource provisioning, and credential abuse indicators using GuardDuty, Defender for Identity, and SCC Event Threat Detection.\n",[44,45,46,47,48],"T1078.004","T1530","T1537","T1580","T1003","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Fdetecting-compromised-cloud-credentials",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill detecting-compromised-cloud-credentials",{"tool":66,"command":67},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill detecting-compromised-cloud-credentials",{"tool":69,"command":70},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill detecting-compromised-cloud-credentials","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-compromised-cloud-credentials\u002FSKILL.md",true,[74,78,84],{"path":75,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fapi-reference.md","REFERENCE","参考文档",2521,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-compromised-cloud-credentials\u002Freferences\u002Fapi-reference.md",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fagent.py","SCRIPT","脚本",7443,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-compromised-cloud-credentials\u002Fscripts\u002Fagent.py",[91,99,106,114,122,130],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\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},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\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":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":20},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":20},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":20},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]