Sub topic 3
Protection plans: S3, EKS, Malware, RDS, Lambda, and Runtime Monitoring
This chapter assumes you know the foundational GuardDuty data sources (CloudTrail management events, VPC Flow Logs, and Route 53 DNS logs) and can run aws guardduty commands against a detector. It covers the optional protection plans: what each one analyzes, what it adds to your bill, and how to turn it on and check it.
What a protection plan is
GuardDuty's foundational sources are on whenever the detector is enabled. A protection plan adds a data source or a scanning capability for one kind of workload. Each plan is a separate switch, billed on its own usage, and produces its own finding types.
In the API, most plans are called features. They are set on the detector with update-detector. Each feature has a name and a status, and some have additional configuration.
| Plan | Feature name | What it analyzes | Example finding type |
|---|---|---|---|
| S3 Protection | `S3_DATA_EVENTS` | CloudTrail S3 data events, such as `GetObject` and `PutObject` | `Exfiltration:S3/AnomalousBehavior` |
| EKS Protection | `EKS_AUDIT_LOGS` | Kubernetes audit logs from EKS clusters | `Policy:Kubernetes/AnonymousAccessGranted` |
| Malware Protection for EC2 | `EBS_MALWARE_PROTECTION` | EBS volume snapshots, scanned after a suspicious finding | `Execution:EC2/MaliciousFile` |
| Malware Protection for S3 | Separate protection plan resource | New objects uploaded to a bucket you select | `Object:S3/MaliciousFile` |
| RDS Protection | `RDS_LOGIN_EVENTS` | Login activity on supported Aurora and RDS databases | `CredentialAccess:RDS/AnomalousBehavior.SuccessfulLogin` |
| Lambda Protection | `LAMBDA_NETWORK_LOGS` | Network activity from Lambda functions | `CryptoCurrency:Lambda/BitcoinTool.B` |
| Runtime Monitoring | `RUNTIME_MONITORING` | OS-level events from a security agent on EC2, ECS Fargate, and EKS | `Execution:Runtime/NewBinaryExecuted` |
S3 Protection
Foundational CloudTrail coverage includes only management events, such as creating a bucket or changing a policy. Reading and writing objects are data events. They are high volume and are not in the foundational analysis.
S3 Protection makes GuardDuty analyze those data events. It can then detect:
- Unusual download volume from a bucket (exfiltration).
- Access from known-malicious IP addresses.
- Policy changes that make a bucket public (these come from management events and fit the same finding family).
- Object deletion patterns that suggest ransomware.
You do not need to enable CloudTrail data event logging yourself. GuardDuty reads the events from its own independent stream, and the events do not appear in your trail.
Cost scales with the number of data events, so accounts with very busy buckets pay the most. Check the volume before you enable it everywhere.
EKS Protection and Runtime Monitoring
These two are easy to confuse because they cover overlapping resources. They watch different layers.
EKS Protection reads the Kubernetes audit log, which is the control plane's record of API calls. It finds problems in how the cluster is used: anonymous access granted, a privileged container created, or a suspicious exec into a pod.
Runtime Monitoring looks inside the workload. A GuardDuty security agent runs on the host and reports events from the operating system: process starts, file access, and network connections. It finds things the audit log cannot see, such as a cryptominer binary running in a container.
Runtime Monitoring supports EC2 instances, ECS on Fargate, and EKS. It replaced the older, EKS-only "EKS Runtime Monitoring" feature. Do not enable both. Use RUNTIME_MONITORING for new setups.
The agent has to be deployed. You can manage it yourself or let GuardDuty do it with automated agent configuration. The additional configuration names are:
EKS_ADDON_MANAGEMENTECS_FARGATE_AGENT_MANAGEMENTEC2_AGENT_MANAGEMENT
For EC2, automated management uses AWS Systems Manager, so the instances must be managed by it. For EKS, the agent is an EKS add-on. If you deploy the agent manually, GuardDuty reports coverage gaps but does not fix them.
Malware Protection
There are two separate capabilities with the same name, and they work differently.
Malware Protection for EC2 is reactive. When GuardDuty raises a finding that suggests an instance or container workload is compromised, it can create snapshots of the attached EBS volumes. It scans the snapshots for malware. Your running instance is not touched and is not slowed down. The result is an additional finding, such as Execution:EC2/MaliciousFile. You can choose whether to keep snapshots when malware is found. This plan is a feature on the detector.
Malware Protection for S3 is proactive. You pick a bucket, and GuardDuty scans each new object uploaded to it. It tags the object with the scan result, and it can publish a result event to EventBridge. This is a protection plan resource attached to a bucket, not a detector feature. It needs an IAM role that lets GuardDuty read and tag objects. It is useful for buckets that take uploads from users or partners, where you want to block unscanned files from downstream processing.
RDS Protection and Lambda Protection
RDS Protection watches login attempts to supported Amazon Aurora and RDS databases. It builds a baseline of normal behavior and flags things like a successful login after a run of failures, or a login from a location never seen before. It reads login events directly from the database service. You do not enable database logging and you pay no performance cost. Check the documentation for which engines and versions are supported before assuming coverage.
Lambda Protection analyzes the network activity of your functions, using VPC Flow Log-style data collected for Lambda. It flags a function that talks to a command-and-control server or a known cryptomining pool. It covers functions in your account, with or without a VPC. It can only see network behavior, not the code that runs.
Choosing plans
Start from what you run, then weigh the cost. The diagram gives a starting point.
Two practical rules:
- Production accounts usually justify all plans that match their workloads. Development accounts with little data may need only the defaults.
- Enable plans for the whole organization from the delegated administrator account, so new accounts get the same settings. Later chapters cover that setup.
Enabling plans with the CLI
This example turns on S3 Protection, Lambda Protection, RDS Protection, and EBS malware scanning for one detector.
DETECTOR_ID=$(aws guardduty list-detectors --query 'DetectorIds[0]' --output text)
aws guardduty update-detector \
--detector-id "$DETECTOR_ID" \
--features '[
{"Name":"S3_DATA_EVENTS","Status":"ENABLED"},
{"Name":"LAMBDA_NETWORK_LOGS","Status":"ENABLED"},
{"Name":"RDS_LOGIN_EVENTS","Status":"ENABLED"},
{"Name":"EBS_MALWARE_PROTECTION","Status":"ENABLED"}
]'This example turns on Runtime Monitoring and lets GuardDuty manage the agent on EKS and EC2.
aws guardduty update-detector \
--detector-id "$DETECTOR_ID" \
--features '[
{
"Name":"RUNTIME_MONITORING",
"Status":"ENABLED",
"AdditionalConfiguration":[
{"Name":"EKS_ADDON_MANAGEMENT","Status":"ENABLED"},
{"Name":"EC2_AGENT_MANAGEMENT","Status":"ENABLED"}
]
}
]'Verify what is on, and what is not:
aws guardduty get-detector \
--detector-id "$DETECTOR_ID" \
--query 'Features[].[Name,Status]' \
--output tableA feature you leave out of the --features list keeps its current setting. Features are per Region, so repeat the call in every Region you use.
Common errors
- Assuming enabled means covered. Runtime Monitoring can be enabled while some hosts have no working agent. Check the coverage view or the
list-coverageAPI, and fix hosts that are unhealthy. - Enabling both Runtime Monitoring and the legacy EKS Runtime Monitoring. The API rejects the combination. Use
RUNTIME_MONITORING. - Forgetting Regions. An attacker can use a Region you never look at. Enable plans in all Regions, or block unused Regions with a service control policy.
- Skipping the cost check. S3 data events and S3 malware scanning scale with usage. Use the usage statistics GuardDuty provides for each data source before enabling organization-wide.
- Expecting prevention. Every plan detects and reports. None of them blocks traffic or deletes a file. Blocking needs the response automation covered later.
Exercise
A team runs a container workload on EKS and wants to know if an attacker has started a cryptominer process inside a pod. They have EKS Protection turned on, but no alert fired when the miner ran. Which plan do they need, and why did EKS Protection miss it?
Show answer
They need Runtime Monitoring. EKS Protection reads the Kubernetes audit log, which records API calls to the control plane, such as creating pods or granting roles. A process starting inside a running container is an operating-system event and never reaches the audit log. Runtime Monitoring runs a security agent on the host and reports process, file, and network events, so it can raise a finding such as CryptoCurrency:Runtime/BitcoinTool.B.
Exercise
You run aws guardduty update-detector with a --features list containing only S3_DATA_EVENTS. What happens to the RDS Protection setting that was already enabled, and how do you confirm the result?
Show answer
Features omitted from the list keep their current setting, so RDS Protection stays enabled. Confirm with aws guardduty get-detector --detector-id "$DETECTOR_ID" --query 'Features[].[Name,Status]' --output table, which lists every feature and its status.