Lesson 2 of 3 Amazon GuardDuty

Extending GuardDuty Coverage with Protection Plans

This lesson explains the optional GuardDuty protection plans, which extend detection to particular resource types and to runtime behaviour. Exam questions often name a workload and ask which plan to enable.

Learning outcomes

After completing this lesson, you will be able to:

  • Match each protection plan to the workload it protects.
  • Explain how protection plans are billed and enabled across an organisation.
  • Describe how Malware Protection for S3 scans uploaded objects.

The plans

GuardDuty's foundational detection analyses CloudTrail management events, VPC Flow Logs and DNS logs. Protection plans, enabled separately, add further data sources. S3 Protection analyses CloudTrail S3 data events, without you having to enable, pay for or store them, to detect unusual downloads and access from malicious IP addresses. EKS Protection analyses Kubernetes audit logs for anonymous access, privileged containers and suspicious API calls. Runtime Monitoring uses a managed security agent on EKS, ECS on Fargate and EC2 to watch process, file and network activity inside the workload, detecting reverse shells, miners, privilege escalation and container escapes that logs alone cannot show.

Malware Protection for EC2 scans EBS volumes from snapshots, with no agent, when GuardDuty sees suspicious behaviour or on demand. Malware Protection for S3 scans newly uploaded objects in chosen buckets and tags each with the result, so downstream processing can skip infected files; it can be used without the rest of GuardDuty. RDS Protection analyses Aurora and RDS login activity for brute-force or anomalous logins, and Lambda Protection watches functions' network activity for communication with malicious hosts. The following table summarises the plans.

PlanAnalysesDetects
S3 ProtectionCloudTrail S3 data events (you do not pay for or store them)Unusual downloads, access from malicious IPs
EKS ProtectionKubernetes audit logsAnonymous access, privileged containers, suspicious API calls
Runtime MonitoringProcess, file and network activity via a managed security agent (EKS, ECS on Fargate, EC2)Reverse shells, miners, privilege escalation, container escapes
Malware Protection for EC2EBS volumes, agentlessly from snapshots, on suspicious behaviour or on demandMalware on instances and containers
Malware Protection for S3Newly uploaded objects in chosen buckets; tags them with the resultInfected uploads (usable without the rest of GuardDuty)
RDS ProtectionAurora and RDS login activityAnomalous or brute-force logins
Lambda ProtectionNetwork activity from functionsCommunication with malicious hosts, e.g. mining

The following diagram follows an upload through scanning to processing or quarantine.

Malware Protection for S3 in front of a processing function. Each new object in incoming/ is scanned and tagged with the result; the scan-result EventBridge event, not the upload, triggers the function, which processes clean objects and moves THREATS_FOUND objects to quarantine. The bucket policy denies GetObject unless the tag is NO_THREATS_FOUND.
The scenario is illustrative.
Match the pairs

GuardDuty protection plans

Exam skills 1.1.4 · 3.2.3

Match each threat with the protection plan that detects it.

Log in to try this activity Interactive activities are free with an account.

Enabling plans

Protection plans are turned on per detector, in addition to the foundational coverage, and each plan is billed on the volume of its own data, such as the number of S3 data events or the vCPUs monitored by Runtime Monitoring. Plans should therefore be enabled where the relevant workloads exist: EKS Protection adds nothing in an account without clusters, but S3 Protection matters wherever sensitive buckets are kept. Like the detector itself, each plan is Regional.

In an organisation, a delegated administrator account enables plans for every member account and can turn them on automatically for new accounts, so coverage does not depend on each account team. Runtime Monitoring needs its security agent on each workload; GuardDuty can manage the agent automatically for EKS, ECS on Fargate and EC2, which avoids installing it by hand.

True or false

Turning plans on

Exam skills 1.1.4 · 6.1.4

Check how protection plans are enabled and billed.

Log in to try this activity Interactive activities are free with an account.
Worked example

Scanning user uploads before processing

A document platform lets customers upload files to s3://acme-uploads/incoming/, and a Lambda function processes them. Security wants infected files never to be processed. Malware Protection for S3 scans each new object and tags it with the result, so access can be controlled by tag. The bucket policy refuses to serve objects unless they have been scanned clean:

{
  "Sid": "OnlyCleanObjects",
  "Effect": "Deny",
  "Principal": "*",
  "Action": "s3:GetObject",
  "Resource": "arn:aws:s3:::acme-uploads/incoming/*",
  "Condition": {
    "StringNotEquals": { "s3:ExistingObjectTag/GuardDutyMalwareScanStatus": "NO_THREATS_FOUND" },
    "ArnNotEquals": { "aws:PrincipalArn": "arn:aws:iam::111111111111:role/GuardDutyMalwareProtectionRole" }
  }
}

The scanner's own role is exempt so it can read the object. The processing function is triggered by the scan-result EventBridge event rather than by the upload, and moves THREATS_FOUND objects to a quarantine prefix. This plan works even in accounts that do not otherwise use GuardDuty.

Check yourself

Which protection plan detects a reverse shell inside an EKS pod or a Fargate task?

Show answer

Runtime Monitoring. EKS Protection detects suspicious Kubernetes API activity from audit logs instead.

Exam Tips

Remember for the exam

  • To scan files that users upload to S3 for malware, use Malware Protection for S3.
  • To detect a reverse shell inside an EKS pod or a Fargate task, use Runtime Monitoring.
  • Suspicious Kubernetes API activity is detected by EKS Protection, from audit logs.
  • Brute-force logins to Aurora are detected by RDS Protection.
  • Unusual patterns of S3 data access are detected by S3 Protection.