Security Logging and Security Resources
Overview
When something goes wrong, you need evidence. AWS produces logs at several layers, and also publishes plenty of security guidance. Exam Task 2.4 asks you to know where to find logs and which AWS resources help with security questions.
Think of a building with different recording devices: a visitor book at reception (CloudTrail records who called what), a CCTV on corridors (VPC Flow Logs record network traffic), sign-in sheets for each shop (S3 and load balancer access logs), and a security desk that collects everything (Security Hub). Beyond the building there is a library of how-to guides (Security Blog, Knowledge Center).
Key Concepts
- AWS CloudTrail records account activity and API calls (management events by default for 90 days in Event history).
- Amazon CloudWatch Logs collects and stores application, system and service logs.
- VPC Flow Logs capture IP traffic metadata for network interfaces, subnets or VPCs.
- S3 server access logs and ELB access logs record requests to buckets and load balancers.
- AWS Security Hub aggregates and prioritises findings from GuardDuty, Inspector, Macie and other tools.
- AWS Trusted Advisor has security checks such as open ports and MFA on root.
- AWS Marketplace offers third-party security products; the Security Blog, Security Center and Knowledge Center offer guidance.
- Always protect log storage: send logs to a locked-down S3 bucket in a separate account.
Detailed Notes
Where to find which logs
| Question | Log source |
|---|---|
| Who deleted this bucket or changed this security group? | CloudTrail |
| What did my application print or error on? | CloudWatch Logs |
| Which IP address tried to reach my instance and was it accepted? | VPC Flow Logs |
| Who downloaded this object from S3? | S3 server access logs (or CloudTrail data events) |
| Which clients hit my load balancer? | ELB access logs |
| What DNS queries did my VPC make? | Route 53 Resolver query logs |
| Which findings need attention? | GuardDuty, Inspector, Security Hub |
CloudTrail essentials
| Feature | Notes |
|---|---|
| Event history | Last 90 days of management events, free and enabled by default |
| Trail | Delivers events to S3 (and optionally CloudWatch Logs) for long-term retention |
| Event types | Management events, data events (S3 objects, Lambda), Insights events |
| Organization trail | One trail capturing all accounts |
| Log file validation | Detects tampering |
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=EventName,AttributeValue=DeleteBucket \
--max-results 5
VPC Flow Logs
Flow Logs do not capture packet contents, only metadata: source, destination, ports, protocol, bytes and ACCEPT or REJECT. They are good for diagnosing why a connection fails, for example a security group blocking traffic.
Security Hub and friends
| Service | Role |
|---|---|
| GuardDuty | Threat detection findings |
| Inspector | Vulnerability scanning |
| Macie | Sensitive data discovery in S3 |
| Detective | Investigate root cause of findings |
| Security Hub | Central dashboard and standards checks (CIS, PCI) |
| Audit Manager | Evidence collection for audits |
Where to learn and get help
| Resource | Use |
|---|---|
| AWS Security Center | Portal of security guidance and best practices |
| AWS Security Blog | News, bulletins and how-to posts |
| AWS Knowledge Center | Answers to frequently asked support questions |
| AWS Trusted Advisor | In-account recommendations for security gaps |
| AWS Marketplace | Buy firewalls, antivirus and SIEM tools as AMIs or SaaS |
| AWS Security Bulletins | Notifications about vulnerabilities |
| AWS Trust and Safety | Report abuse of AWS resources |
Reporting abuse
If you suspect that AWS resources are being used for spam, DDoS or malware, contact AWS Trust and Safety through the abuse form or by emailing the abuse address.
Bringing it together
{
"detect": ["GuardDuty", "Inspector", "Macie"],
"aggregate": "Security Hub",
"investigate": "Detective + CloudTrail",
"retain": "S3 bucket with Object Lock in a log-archive account"
}
Real World Example
A fintech company enables an organisation-wide CloudTrail trail that writes to a locked bucket in a dedicated log-archive account. When a security group is unexpectedly opened, CloudTrail shows which role did it and when. VPC Flow Logs reveal rejected traffic from an unfamiliar IP.
Security Hub merges GuardDuty and Inspector findings into one dashboard, and the team follows the AWS Security Blog for new advisories. A paid firewall appliance from AWS Marketplace is added for inspection.
Architecture Diagram
- 1Services write activity and traffic records to their logs.
- 2Logs are delivered to a protected S3 bucket or CloudWatch Logs.
- 3Detection services analyse the data.
- 4Security Hub aggregates findings for the security team.
Best Practices
- ✓Enable an organisation-wide CloudTrail trail with log file validation.
- ✓Turn on VPC Flow Logs for critical VPCs.
- ✓Store logs in a separate, restricted account with Object Lock where needed.
- ✓Use Security Hub to see all findings in one place.
- ✓Read the Security Blog and bulletins and report abuse to Trust and Safety.
Common Interview Questions
Exam Tips
CLF-C02 focus
- "API call history" = CloudTrail; "network traffic metadata" = VPC Flow Logs.
- "Single pane for security findings" = Security Hub.
- "Third-party security software" = AWS Marketplace.
- "Report abuse" = AWS Trust and Safety.
Chapter quiz
Security, Identity and Compliance · 10 questions
1.A company wants an application running on EC2 to read objects from S3 without storing credentials on the instance. What should they use?
2.Which AWS service creates and manages encryption keys and logs their use in CloudTrail?
3.Which service analyses CloudTrail events, VPC Flow Logs and DNS logs to detect malicious activity?
4.A compliance officer needs to download AWS's SOC 2 report. Where should they go?
5.Which service would help block SQL injection attempts against a website behind an Application Load Balancer?
6.Which task can ONLY be performed by the AWS account root user?
7.A company wants employees to sign in once with their corporate credentials and reach several AWS accounts. Which service is MOST appropriate?
8.A mobile app needs sign-up and sign-in for millions of end customers, including Google login. Which service should it use?
9.A security analyst needs to know which user deleted an S3 bucket yesterday. Which service provides this?
10.A team wants a single dashboard that combines findings from GuardDuty, Inspector and Macie. Which service fits?
0 of 10 answered
Finished this lesson?
0 of 43 lessons done · 0% of the course

