Lesson 1 of 6 Threat Detection and Compliance Services

Detecting Threats with Amazon GuardDuty

This lesson explains how GuardDuty, a managed threat detection service, continuously analyses account activity and network logs to find malicious or unauthorised behaviour, with no agents to deploy.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify what GuardDuty analyses.
  • Explain how EventBridge automates responses to findings.
  • Describe organisation-wide GuardDuty coverage.

What GuardDuty analyses

GuardDuty detects threats by continuously analysing activity in an account with threat intelligence and machine learning. From CloudTrail management events, it detects unusual API activity, such as calls from a known malicious IP address or an attempt to disable logging. From VPC Flow Logs and DNS logs, it detects network threats, such as an instance mining cryptocurrency, communicating with a command-and-control server or scanning ports.

With S3 Protection, it analyses S3 data events for suspicious access patterns that suggest data exfiltration. Optional protection plans extend coverage to EKS audit logs, runtime monitoring of processes on EC2, ECS and EKS, RDS login activity, Lambda network activity, and malware scanning of EBS volumes and new S3 objects. The following table summarises the sources.

SourceExamples of findings
CloudTrail management eventsUnusual API calls, disabled logging, calls from malicious IPs
VPC Flow Logs and DNS logsCrypto mining, communication with command-and-control servers, port scanning
S3 data events (S3 Protection)Suspicious access patterns and data exfiltration
Optional protection plansEKS audit logs, runtime monitoring for EC2, ECS and EKS, RDS login activity, Lambda network activity, malware scanning of EBS volumes and S3 uploads

GuardDuty reads these sources directly from AWS, so enabling it changes nothing in your own logging and has no performance impact. Findings carry a severity and are retained for 90 days.

True or false

GuardDuty facts

Exam skills 1.2.3

Check how GuardDuty works.

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

Automated response

GuardDuty findings are most valuable when they trigger a response within minutes, and Amazon EventBridge makes that automatic. Each finding is published as an event, and an EventBridge rule matching findings of a given type or severity starts a response.

The response is usually performed by a Lambda function or a Step Functions workflow: isolating a compromised instance by changing its security group, revoking a role's active sessions, or blocking an attacker's IP address in a network ACL or AWS WAF. At the same time, Amazon SNS notifies the security team, who investigate and complete the remediation.

The following diagram shows the automated response described above.

Automated response to a GuardDuty finding. Each finding is published to Amazon EventBridge, where a rule matching its type or severity starts a Lambda function or Step Functions workflow that, for example, isolates the instance by changing its security group. Amazon SNS notifies the security team at the same time.
Automation contains the threat within minutes; the security team still investigates and completes the remediation.
Put in order

Responding to a finding

Exam skills 1.2.3

Put the stages of an automated GuardDuty response in order.

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

Organisation-wide coverage

Use a delegated administrator with auto-enable for new accounts, so coverage does not depend on each team. Trusted IP lists and suppression rules reduce noise from known activity.

Worked example

Responding to a compromised instance automatically

A security team wants compromised EC2 instances isolated within minutes, without waiting for a person.

StepService
Detect communication with a known malicious IPAmazon GuardDuty finding
Match high-severity EC2 findingsAmazon EventBridge rule
Replace the instance's security groups with an isolation group and snapshot its volumesLambda function or Systems Manager Automation
Notify the teamAmazon SNS
Investigate what else the attacker didAmazon Detective
Find the vulnerability that let them inAmazon Inspector findings for the instance

GuardDuty detects but never blocks; EventBridge and automation provide the response. Enabling GuardDuty organisation-wide from a delegated administrator ensures every account is covered.

Check yourself

Which data sources does GuardDuty analyse without any agents?

Show answer

CloudTrail management events, VPC Flow Logs and DNS query logs, plus optional sources such as S3 data events and EKS audit logs, which it reads directly from AWS.

Exam Tips

Remember for the exam

  • To detect compromised instances or malicious activity with no agents, use GuardDuty.
  • To isolate a compromised instance automatically, route the GuardDuty finding through EventBridge to a Lambda function that changes the security group.
  • To enable threat detection in every current and future account, use a delegated administrator with auto-enable.
  • To scan uploaded S3 objects for malware, use GuardDuty Malware Protection for S3.