Study Guides/AWS Cybersecurity Notes/Security Hub & Guard Duty
Amazon Guard Duty
This is a managed threat detection service.
- Uses machine learning
- Is charged to your account /not free.
- No up-front costs or charge for enabling the service.
- Billed for foundational log analysis - for example:
- $4 for 1 million coundtrail events.
- VPC Flow logs - 500 GB / $1
- This can get expensive!!!
- Is charged to your account /not free.
- Can process millions of events, captured by:
- CloudTrail
- DNS (Route 53)
- VPC Flow longs
Guard duty learns what is normal in the account and attempts to find abnormal behavior.
- Can detect connections with unisal sources.
- EG: data been exfiltrated to a remote FTP server.
It's important to note that guard duty is:
- A detection service
- NOT a reporting service
- NOT a remediation service
Reporting >> Cloudwatch
Remediation >> Lambda / Kinesis / ECS Tasks / Step functions / SNS / SQS / EC2 instances.
For example:
- Guard duity detects a an issue with an EC2 instance
- Cloudwatch reports the issue (think of it as the data bus)
- EC2 shuts down the instance / SNS notifies the team (remediaion and notification)
Guard duty is always on.
- Issues can be found without incurring a performance hit.
- No local agentds are needed - this is Security as a Service
- No upfront costs with GuardDuty - BUT remember their are costs!!
- Installs in One Click nothing to configure,
Additionally:
- Coverage is global.
- Can detect intel-based well known threats
- Can find behaviour based threats
- Can monitor security over different accounts
Guard Duty Data Sources
In the bigger picture guard duty is a data processor - so where does it get the data?
- VPC Flow logs
- Provide details about network communication
- VPC flow logs can be turned off - because of this Guard Duty uses its onwn flow log stream seperate from your logs.
- CloudTrail Events
- Stores SDK / Command line use for future reference.
- Helps build a profile of your account to understand norms.
- DNS logs
- Checks for queries of known and unknown instances.
- Can look at domains queries and compre them to threat intelligence.
- Can be done with or without route 53 enabled.
Guard duty vs Macie
Guard duty and Macie can be confused, here are the core differences:
✅ Macie reads data in an S3 bucket to find PII / Gurad duty does not
❌ Macie does not read coludtrail events, VPC flow logs ord DNS logs.
❌ Macie does not ideifity kown or uknown threats.
To summarise / Macie works with data at rest to locate, report and redact PII. Guard duty works with data in transit (VPC / Clouwdwatch logs) to find abnormlaities in behaviour. If the concern is data at rest Macie is the correct choice over Guard Duty. However both hace a place in securing the cloud.
GuardDuty Alerts
All detections are ranked: High, Medium or Low
- Different actions can be performed based on the severity - for example:
- Placing low in an SQS for a ticketing system.
- Alerting high via SNS
- This approach lets the team correctly proririze issues.
Findings
It's important to note that findings will be delayed 8 to 10 minutes.
Events will be aggrigated:
- This is done to prevent alert fatigue
- Example: A secret key is exposed and used 200 times / the team will get one alert regarding the key rather than 200.
- The alert will repeat based on the scedule / this defaults to 6 hours.
Findings are devliered to three places:
- Your secutiy hub.
- A designated s3 bucket.
- CloudWarch Events or Eventbridge
Output options
- Security hub - lets you see everything in one place.
- Cloudwatch / Eventbridge can provide near realtime alerts using SNS.
- S3 Keeps an audutable log of alerts.
Detection signatures
Guard duty uses three major sources for detecton information.
- AWS security intelegence.
- AWS Partners such as CrowdString and Proofpoint.
- Customer provided infomration.
What can be detected
Using this intelgence GuardDuty can detect:
- Hosts infected with known malware.
- Proxies or TOR gateways
- Crypto mining or wallets
- Hosting of malware or hacking tools
Macie vs GuardDuty
- Macie looks at information stored in S3:
- Tries to classifiy the data and assess it's risk
- Macie is also a fullly managed macine learning system.
- Macie allows proactive safeguards on sesnsative infomration.
- GuardDury does not:
- Read the S3 bucket data
- Find data containing PII
- Guard duty does:
- Aggrigrate cloud trail events.
Macie - inforMation
Guard duty - Trails & logs (guards follow trails)
Severity of items
A numerical scale is used for guard duty:
- High - 7.0 - 8.9
- Medium - 4.0.- 6.9
- Low - 1.0 - 3.9
These values can be used to trigger SNS alerts.
Testing Guard Duty
AWS has a guard duty repo with simulated malware.
More information can be found here: at https://github.com/awslabs/amazon-guardduty-tester
This is a GIT repo that contains cloudformation templates.
After setup findings should appear in guard duty after 8 to 10 minutes.
Findings & Cloudwatch
Multiple simular events will be combined - this is to prevent too much noise.
- An inital alert is sent out, guard duty then waits for a backoff period before alerting again.
- By default this period is six hours.
Remediation
Any automated remeidation is done using cloudwatch.
For manual, Guard duity provides a remeidation guide.
Security hub
Scurity hub provides a central location for finding, alerts and complnaice information.
This includes data from:
- IAM
- Macie
- Guard Duty
- Inspector
- Firewall
- 3rd party tools
Scurity hub can be configured in a hub and spoke model.
- Member accounts sync data to the admin account
- This approach enables multiple regions to be supported
- By default security hub is a reginal service / Therefore the admin-member relatiohsip is required for multiple region support.
Automated compliance and configuration checks
This is one of the most compelling reasons for security hub. Ensuring a account remains compliant.
Out of the box:
- 43 fully automated checks are conducted
- Findings are displayed on a dsahboard
This is not AWS Config
- Security hub looks at the account level
- AWS config looks at the resource level
If you're concerned about resource configuration - choose AWS config!.
AWS security hub focuses on CIS best practices at the account level - the account may be ok in the eyes on security hub, but the resources could still be misconfigured!. This is why having AWS Config is required to enable security hub.
Security hub standards
Security hub has 5 standards that the envioment can be referecned against at time of writing, each of these have a different number of controls ranging from AWS CIS 1.4 (least restrictive) to NIST 800-53 the most restrictive.