- Newest
- Most votes
- Most comments
Hello Sujal, Based on your scenario, there are a couple of scenarios where GuardDuty might not be triggering. I've outlined those scenarios below and suggested some modifications to your test:
Key Requirements for Detection:
GuardDuty primarily looks for credential usage from IP addresses outside of AWS's IP ranges
The credentials need to be used to make AWS API calls
There should be a clear pattern of credential exfiltration (not just a single API call)
Why Your Test Might Not Trigger:
Single API call (sts:GetCallerIdentity) might not be sufficient
Tor exit nodes might be filtered out by GuardDuty's detection logic
The time window between credential retrieval and usage might matter
Modified Test Approach:
On EC2 instance
Get credentials
ROLE_NAME=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/) CREDS=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$ROLE_NAME)
On external machine (without Tor initially)
Make multiple API calls to different services
aws configure set aws_access_key_id <AccessKeyId> --profile test aws configure set aws_secret_access_key <SecretAccessKey> --profile test aws configure set aws_session_token <SessionToken> --profile test
Make multiple API calls
aws s3 ls --profile test aws ec2 describe-instances --profile test aws iam list-users --profile test aws sts get-caller-identity --profile test
Additional Testing Considerations:
Try without Tor first to establish a baseline
Ensure GuardDuty is properly configured:
aws guardduty get-detector-status --detector-id <detector-id>
Check if your test region has GuardDuty enabled Verify findings settings:
aws guardduty list-findings --detector-id <detector-id>
Common Gotchas:
GuardDuty might have a detection delay (up to 30 minutes)
The IP address you're testing from might be allow-listed
Some finding types might be disabled in your GuardDuty configuration
Enhanced Test Scenario:
#!/bin/bash
Script to simulate multiple credential usage patterns
Configure AWS CLI with stolen credentials
aws configure set region us-east-1 --profile stolen aws configure set aws_access_key_id $ACCESS_KEY --profile stolen aws configure set aws_secret_access_key $SECRET_KEY --profile stolen aws configure set aws_session_token $SESSION_TOKEN --profile stolen
Make multiple API calls over time
services=("s3" "ec2" "iam" "rds" "lambda") for service in "${services[@]}"; do case $service in "s3") aws s3 ls --profile stolen ;; "ec2") aws ec2 describe-instances --profile stolen ;; "iam") aws iam list-users --profile stolen ;; "rds") aws rds describe-db-instances --profile stolen ;; "lambda") aws lambda list-functions --profile stolen ;; esac sleep 30 # Wait between calls done
Verification Steps:
Check GuardDuty findings
aws guardduty list-findings
--detector-id <detector-id>
--finding-criteria '{"Criterion": {"type": {"Eq": ["CredentialAccess:InstanceCredentialExfiltration"]}}}'
Recommendations:
Start testing without Tor/ProxyChains
Make multiple API calls to different services
Ensure your external IP is clearly outside AWS ranges
Wait at least 30 minutes for detection
Verify GuardDuty settings in the console
Check CloudTrail to confirm API calls are being logged
If still no findings appear, consider:
Opening a support ticket with AWS
Verifying GuardDuty's service-linked role permissions
Testing in a different region
Creating a fresh AWS account for testing
Note: Remember to clean up any test credentials and roles after testing to maintain security.
Hopefully this provides some clarity on the issue and gives some direction on identifying a potential root cause.
Thank you for using AWS! Brian
Relevant content
- asked 2 months ago
- asked 6 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago