Skip to content

Governance and loggingService 04 of 139 controls

Amazon GuardDuty security hardening

Run GuardDuty in every account and Region from a delegated administrator, choose protection plans on purpose, page on real findings and suppress noise safely.

Published on Updated on 9 min readTags:#detection#threat-detection#incident-response
On this page

Amazon GuardDuty is the managed threat detection service for AWS: it analyses CloudTrail, network and DNS activity, plus optional workload data, and raises findings when something looks like an attack. It is off by default, and when teams do enable it they often do so in one account and one Region. That misses the patterns that matter most in real cloud incidents: access keys leaked in a public repository and used within minutes to launch cryptomining instances in a Region nobody watches, instance role credentials stolen through SSRF and used from outside AWS (the Capital One 2019 pattern), or a role quietly enumerating and copying every bucket. This page runs GuardDuty for the whole organization from a delegated administrator, chooses protection plans on purpose, routes findings to people, and keeps noise down without blinding the detector.

Baseline controls

9 controlsCIS numbers refer to the CIS AWS Foundations Benchmark v7.1.0 unless another CIS benchmark is named; Security Hub CSPM IDs are listed where a control exists.
  1. 01GuardDuty delegated admin in every Region

    GuardDuty is Regional and can only report on Regions where a detector runs.

    How to check: aws guardduty list-organization-admin-accounts --region eu-west-1
    Mapping: GuardDuty.1, CIS 2.1.6
  2. 02Auto-enable ALL for organization members

    Covers existing and future accounts without anyone remembering to turn it on.

    How to check: aws guardduty describe-organization-configuration --detector-id DETECTOR_ID
  3. 03S3 Protection on

    Exfiltration and mass deletion from buckets are the most common end goals of a compromise.

    How to check: aws guardduty get-detector --detector-id DETECTOR_ID --query Features
    Mapping: GuardDuty.10
  4. 04Runtime Monitoring with managed agents

    Catches reverse shells, miners and container escapes that network signals miss.

    How to check: aws guardduty get-coverage-statistics --detector-id DETECTOR_ID
    Mapping: GuardDuty.7, GuardDuty.11, GuardDuty.12, GuardDuty.13
  5. 05Malware Protection for EC2 on

    Scans EBS volumes when GuardDuty sees suspicious behaviour, so cost follows incidents.

    How to check: aws guardduty get-malware-scan-settings --detector-id DETECTOR_ID
    Mapping: GuardDuty.8
  6. 06EKS, RDS and Lambda Protection where used

    Adds audit log, database login and function network signals the base service lacks.

    How to check: aws guardduty get-detector --detector-id DETECTOR_ID --query Features
    Mapping: GuardDuty.5, GuardDuty.6, GuardDuty.9
  7. 07High and critical findings page a human

    A finding nobody reads is the same as no detection.

    How to check: aws events list-rules --name-prefix guardduty
  8. 08Findings exported to S3 with a KMS key

    Keeps findings beyond the GuardDuty retention window for investigations.

    How to check: aws guardduty list-publishing-destinations --detector-id DETECTOR_ID
  9. 09Suppression rules narrow and documented

    Broad suppressions silently hide attacks and starve Extended Threat Detection.

    How to check: aws guardduty list-filters --detector-id DETECTOR_ID

Understand what GuardDuty watches

Once enabled in a Region, GuardDuty consumes three foundational data sources without any configuration: CloudTrail management events, VPC flow logs and Route 53 Resolver DNS query logs. It reads its own independent copies, so you do not need a trail or flow logs for GuardDuty to work. You still want them for your own investigations (see CloudTrail and VPC).

Protection plans add data sources for specific services. Their API feature names are:

Protection planAPI feature nameWhat it watches
S3 ProtectionS3_DATA_EVENTSS3 data plane activity (object reads, writes, deletes)
EKS ProtectionEKS_AUDIT_LOGSKubernetes audit logs of EKS clusters
Runtime MonitoringRUNTIME_MONITORINGOS level events from EKS, ECS (including Fargate) and EC2 through a security agent
Malware Protection for EC2EBS_MALWARE_PROTECTIONAgentless scans of EBS volumes when suspicious behaviour is detected
RDS ProtectionRDS_LOGIN_EVENTSLogin activity on Aurora and supported RDS engines
Lambda ProtectionLAMBDA_NETWORK_LOGSNetwork activity of Lambda functions

Malware Protection for S3 is configured differently: it is a per bucket plan that scans newly uploaded objects. Extended Threat Detection is on by default in every account with GuardDuty, at no extra cost. It correlates signals over time into attack sequence findings, which GuardDuty rates Critical.

Cover every account and Region

Delegate administration in every Region

Do not administer GuardDuty from the management account. Register the security tooling account as delegated administrator, in every Region, because GuardDuty is a Regional service:

for region in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do
  aws guardduty enable-organization-admin-account \
    --admin-account-id 111122223333 \
    --region "$region"
done

Use the same delegated administrator in all Regions; splitting it makes organization-wide configuration impossible to reason about. Cover every enabled Region, not only the ones you use. A stolen credential can launch instances in a Region you never look at, and GuardDuty only reports where it runs. Security Hub CSPM control GuardDuty.1 checks exactly this. If you block unused Regions with an SCP (see Organizations), GuardDuty there stays cheap because there is little activity to analyse.

Auto-enable every member account

From the delegated administrator, in each Region, turn on organization auto-enable with the protection plans you want:

DETECTOR_ID=$(aws guardduty list-detectors --query 'DetectorIds[0]' --output text)

aws guardduty update-organization-configuration \
  --detector-id "$DETECTOR_ID" \
  --auto-enable-organization-members ALL \
  --features '[
    { "Name": "S3_DATA_EVENTS", "AutoEnable": "ALL" },
    { "Name": "EKS_AUDIT_LOGS", "AutoEnable": "ALL" },
    { "Name": "EBS_MALWARE_PROTECTION", "AutoEnable": "ALL" },
    { "Name": "RDS_LOGIN_EVENTS", "AutoEnable": "ALL" },
    { "Name": "LAMBDA_NETWORK_LOGS", "AutoEnable": "ALL" },
    {
      "Name": "RUNTIME_MONITORING",
      "AutoEnable": "ALL",
      "AdditionalConfiguration": [
        { "Name": "EKS_ADDON_MANAGEMENT", "AutoEnable": "ALL" },
        { "Name": "ECS_FARGATE_AGENT_MANAGEMENT", "AutoEnable": "ALL" },
        { "Name": "EC2_AGENT_MANAGEMENT", "AutoEnable": "ALL" }
      ]
    }
  ]'

ALL enables GuardDuty in existing members and in accounts that join later; NEW only covers future accounts. It can take up to 24 hours for the configuration to reach every member. Only the delegated administrator can change protection plans for members, which is what you want: a compromised member account cannot quietly switch them off.

AWS Organizations also offers a GUARDDUTY_POLICY policy type for managing GuardDuty declaratively. If you already manage Security Hub CSPM that way, evaluate it as an alternative to the per-Region CLI loop.

Verify coverage

aws guardduty list-members --detector-id "$DETECTOR_ID" \
  --query 'Members[?RelationshipStatus!=`Enabled`].[AccountId,RelationshipStatus]' \
  --output table

aws guardduty get-coverage-statistics --detector-id "$DETECTOR_ID" \
  --statistics-type COUNT_BY_COVERAGE_STATUS

get-coverage-statistics reports Runtime Monitoring coverage, which tells you which clusters and instances actually have a healthy agent. Suspended member accounts make the protection plan controls fail in Security Hub CSPM until you disassociate them in GuardDuty.

Choose protection plans on purpose

Every plan has a cost tied to the volume it analyses. Enabling everything is simple and defensible, but make the choice consciously.

S3 Protection

Enable it. Data exfiltration and destructive deletion from buckets are among the most common outcomes of a cloud compromise, and attack sequence findings involving S3 depend on it. For buckets that receive untrusted uploads (customer files, partner drops), add Malware Protection for S3. The account that owns the bucket configures it; a delegated administrator cannot enable it on a member's bucket. With tagging on, each scanned object gets a GuardDutyMalwareScanStatus tag, and the bucket policy can deny reads of anything not tagged NO_THREATS_FOUND (see S3).

Runtime Monitoring

Enable it where you run containers or long lived EC2 workloads. Agent based visibility catches reverse shells, crypto miners and container escapes that network signals miss. Let GuardDuty manage the agent (EKS_ADDON_MANAGEMENT, ECS_FARGATE_AGENT_MANAGEMENT, EC2_AGENT_MANAGEMENT); Security Hub CSPM checks each one separately (GuardDuty.7, GuardDuty.12, GuardDuty.13). On EC2 the agent is deployed through Systems Manager, another reason to manage instances with SSM (see EC2).

Malware Protection

Enable Malware Protection for EC2. Scans only start when GuardDuty sees suspicious behaviour on an instance or container workload, or when you request an on-demand scan, so cost follows incidents. Snapshots are retained only when malware is found, which preserves evidence for the investigation.

EKS, RDS and Lambda Protection

Enable EKS Protection if you run EKS: audit logs reveal anonymous access and suspicious role bindings (see EKS). Enable RDS Protection where databases hold sensitive data; it profiles login activity and flags anomalous or brute force logins (see RDS). Enable Lambda Protection where functions run business logic; it watches function network traffic for signs of malicious code such as mining pool connections (see Lambda).

Route findings to people

Findings sit in the console until someone looks. Every finding is published to EventBridge in the account that owns the detector, and member findings also appear in the delegated administrator account. Create a rule there for high and critical findings:

aws events put-rule \
  --name guardduty-high-critical \
  --event-pattern '{
    "source": ["aws.guardduty"],
    "detail-type": ["GuardDuty Finding"],
    "detail": { "severity": [ { "numeric": [">=", 7] } ] }
  }'

aws events put-targets \
  --rule guardduty-high-critical \
  --targets Id=sns,Arn=arn:aws:sns:eu-west-1:111122223333:security-pager

Severity 7.0 to 8.9 is High and 9.0 and above is Critical. Medium findings go to a ticket queue, not a pager. GuardDuty findings also flow into Security Hub CSPM automatically, which gives you one triage place; do not page twice for the same finding.

Export findings for retention

Export findings to S3 for retention beyond the GuardDuty window, encrypted with a KMS key whose policy lets GuardDuty use it (see KMS):

aws guardduty create-publishing-destination \
  --detector-id "$DETECTOR_ID" \
  --destination-type S3 \
  --destination-properties DestinationArn=arn:aws:s3:::org-guardduty-findings,KmsKeyArn=arn:aws:kms:eu-west-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

Test the pipeline with sample findings

Before you rely on alerting, prove it works. Sample findings are clearly marked as samples:

aws guardduty create-sample-findings \
  --detector-id "$DETECTOR_ID" \
  --finding-types "UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS" "CryptoCurrency:EC2/BitcoinTool.B!DNS"

Check that the event reaches EventBridge, the SNS topic, your SIEM and the on-call channel, and repeat after any routing change. For a more realistic test, the open source GuardDuty tester and Stratus Red Team generate real attacker behaviour in a sandbox account.

Reduce noise without going blind

Some findings are expected: an internal vulnerability scanner that port scans your instances, a penetration test, a known partner IP. Handle these with targeted rules, never by disabling detection.

Suppression rules archive new findings that match criteria. The findings are still generated and kept, just archived:

aws guardduty create-filter \
  --detector-id "$DETECTOR_ID" \
  --name suppress-internal-scanner \
  --action ARCHIVE \
  --rank 1 \
  --finding-criteria '{
    "Criterion": {
      "type": { "Eq": ["Recon:EC2/Portscan"] },
      "resource.instanceDetails.tags.value": { "Eq": ["vuln-scanner"] }
    }
  }'

Extended Threat Detection does not consider archived findings, including those archived by suppression rules. Keep suppressions narrow (one finding type, one tag or account), document why each exists, and review them quarterly.

Trusted IP lists stop findings for activity from listed addresses entirely. Use them sparingly, only for fixed egress addresses you control:

aws guardduty create-ip-set \
  --detector-id "$DETECTOR_ID" \
  --name corporate-egress \
  --format TXT \
  --location https://s3.amazonaws.com/org-guardduty-lists/trusted-ips.txt \
  --activate

Threat intel lists do the opposite: they add known bad IPs or domains so GuardDuty flags any communication with them. Feed them from your threat intelligence platform with create-threat-intel-set.

Triage your first findings

When GuardDuty first runs across an organization, most findings reflect hygiene issues rather than active attacks. Treat each one as either an incident or a hardening ticket:

  • Policy:IAMUser/RootCredentialUsage: someone used the root user. See Organizations for root lockdown.
  • UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS: instance role credentials used outside AWS. Revoke active sessions on the role and check that IMDSv2 is enforced (see EC2).
  • Policy:S3/BucketBlockPublicAccessDisabled: someone turned off Block Public Access on a bucket.
  • Stealth:IAMUser/CloudTrailLoggingDisabled: treat as an incident until proven otherwise.

Logging and detection

  • EventBridge: besides the severity rule above, add a dedicated rule for attack sequence findings (type prefix AttackSequence:) and for Stealth: and Impact: finding types regardless of severity.
  • CloudTrail: alert on calls that weaken detection: DeleteDetector, UpdateDetector with Enable false, DisassociateFromAdministratorAccount, DeleteMembers, CreateFilter, UpdateFilter, CreateIPSet and UpdateIPSet. A new suppression rule or trusted IP list is a classic way to hide an intrusion. Deny the destructive calls with an SCP for everyone outside the security account.
  • Security Hub CSPM: enable the GuardDuty controls (GuardDuty.1, GuardDuty.5 to GuardDuty.13) so coverage gaps surface as posture findings, which appear only in the delegated administrator account.
  • Retention: the S3 export is your long term record; give the bucket Object Lock or at least a deny-delete bucket policy.

Common mistakes

  • Running GuardDuty in a few Regions only. Attackers launch resources where you do not look. Enable every Region, or block unused ones with an SCP.
  • Using NEW instead of ALL for auto-enable. Existing member accounts stay uncovered. Use ALL, then verify with list-members.
  • Administering from the management account. It widens the use of your most sensitive account. Delegate to the security tooling account, the same one in every Region.
  • Nobody receives findings. Without an EventBridge rule and a tested route, findings rot in the console. Page on High and Critical, ticket the rest.
  • Broad suppression rules and trusted IP lists. They hide real attacks and remove findings from Extended Threat Detection. Keep them narrow and reviewed, and alert when they change.
  • Runtime agents not actually running. Enabling the plan is not coverage. Check get-coverage-statistics and fix unhealthy clusters and instances.
  • Treating GuardDuty as prevention. It tells you what is being exploited, not what is misconfigured. Pair it with Security Hub CSPM and preventive controls.

References

Written by

Florian Amette

Security engineer writing practical, benchmark-aligned hardening baselines for AWS services, from the organization and identities to data, networks and workloads.

Related services

All services