BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeAWS Certified DevOps Engineer - Professional (DOP-C02)AWS Security Auditing & Compliance Mastery
Study Guide1,050 words

AWS Security Auditing & Compliance Mastery

Security auditing services and features (for example, AWS CloudTrail, AWS Config, VPC Flow Logs, AWS CloudFormation drift detection)

AWS Security Auditing & Compliance Mastery

This guide covers the essential services used to audit, monitor, and maintain security posture within an AWS environment, specifically focusing on the DevOps Engineer Professional domain of security automation and response.

Learning Objectives

After studying this guide, you should be able to:

  • Implement robust auditing using AWS CloudTrail and AWS Config.
  • Analyze network traffic patterns with VPC Flow Logs to identify security gaps.
  • Detect configuration drift in CloudFormation stacks and remediate manual changes.
  • Differentiate between threat detection (GuardDuty), vulnerability scanning (Inspector), and configuration auditing (Config).
  • Design automated remediation workflows using EventBridge and AWS Lambda.

Key Terms & Glossary

  • Management Events: API operations performed on resources in your AWS account (e.g., AttachRolePolicy).
  • Data Events: Resource-level operations (e.g., S3 GetObject, Lambda Invoke). High volume, disabled by default.
  • Configuration Recorder: An AWS Config component that records changes to the configuration of supported resources.
  • Aggregator: An AWS Config feature that collects compliance data from multiple accounts and regions into a single view.
  • Drift: The difference between the expected configuration of a CloudFormation stack and its actual, live state.
  • Finding: A security notification generated by GuardDuty or Inspector indicating a potential issue.

The "Big Idea"

[!IMPORTANT] Security auditing is the process of verifying that your environment's state matches your policy and that all actions are recorded.

Think of CloudTrail as the Video Camera (who did what?), AWS Config as the Inventory Ledger (how is it configured now vs. then?), and VPC Flow Logs as the Network Tap (who is talking to whom?). Together, they provide the visibility required for a "Defense in Depth" strategy.

Formula / Concept Box

ServicePrimary Question AnsweredTrigger Mechanism
AWS CloudTrailWho called this API?API Call / Event
AWS ConfigIs this resource compliant?Configuration Change / Periodic
VPC Flow LogsWhere is the traffic going?IP Traffic at ENI
CFN Drift DetectionDid someone manual change my IaC?Manual Request
GuardDutyIs there a malicious actor?Log Analysis (Internal)

Hierarchical Outline

  1. API Auditing (AWS CloudTrail)
    • Trails: Regional vs. All-Region (Best Practice: All-Region).
    • Integrity: Log File Validation (RSA/SHA-256) to detect tampering.
    • Multi-account: Organizational Trails for centralized logging.
  2. Resource Auditing (AWS Config)
    • Config Rules: Managed (AWS-defined) vs. Custom (Lambda-based).
    • Remediation: Automated via SSM Documents or Lambda.
    • Compliance: Timeline view of resource history.
  3. Network Auditing (VPC Flow Logs)
    • Scope: VPC, Subnet, or ENI level.
    • Destinations: CloudWatch Logs (real-time) or S3 (long-term/Athena analysis).
  4. Infrastructure-as-Code Auditing (CloudFormation Drift)
    • Status: IN_SYNC vs. DRIFTED.
    • Scope: Property-level differences (e.g., Security Group Port 80 changed to 22).

Visual Anchors

Auditing Workflow

Loading Diagram...
Figure 1 — Mermaid diagram

Drift Detection Logic

Compiling TikZ diagram…
⏳
Running TeX engine…
This may take a few seconds
Figure 2 — TikZ diagram

Definition-Example Pairs

  • CloudTrail Log File Validation: A feature that generates a digital signature for log files.
    • Example: An auditor uses the aws cloudtrail verify-logs command to prove that a specific log entry hasn't been deleted or modified after being written to S3.
  • Config Remediation: An automated action triggered when a resource is found non-compliant.
    • Example: If a Config Rule detects an S3 bucket is public, it triggers an SSM Automation document to set the bucket to private immediately.
  • VPC Flow Log Filtering: Capturing only specific types of traffic (Accept, Reject, or All).
    • Example: A security engineer enables "REJECT" logs only to identify attempts by external IPs to scan blocked ports in a private subnet.

Worked Examples

Example 1: Identifying a Security Breach

Scenario: A developer reports that an EC2 instance was modified, but they don't know who did it.

  1. Search CloudTrail: Open CloudTrail Event History.
  2. Filter: Filter by ResourceName (Instance ID) or EventName (ModifyInstanceAttribute).
  3. Analysis: Locate the userIdentity field to find the IAM User and the sourceIpAddress to see where the request originated.

Example 2: Handling CloudFormation Drift

Scenario: A stack is DRIFTED because a Security Group rule was manually added to allow port 3389 (RDP).

  1. Detect Drift: Run Drift Detection on the Stack via Console or CLI.
  2. View Detail: Identify the specific property SecurityGroupIngress that differs.
  3. Resolution: Either update the CloudFormation template to include the rule OR (recommended) delete the manual rule to return the environment to the template's source of truth.

Checkpoint Questions

  1. Which service should you use to see the history of configuration changes for an IAM Role over the last 6 months? (Answer: AWS Config)
  2. How can you ensure CloudTrail logs from all accounts in an organization are stored in a single, tamper-proof bucket? (Answer: Use an Organizational Trail and enable Log File Validation)
  3. You suspect an instance is communicating with a known command-and-control server. Which two logs are most useful? (Answer: VPC Flow Logs and DNS Logs/GuardDuty Findings)
  4. True or False: CloudFormation drift detection automatically rolls back resources to the template state. (Answer: False; it only detects the difference. You must remediate manually or via automation.)

Muddy Points & Cross-Refs

  • CloudTrail vs. CloudWatch: CloudTrail is for "Who did what" (Auditing). CloudWatch is for "What is the performance/health" (Monitoring).
  • AWS Config vs. AWS AppConfig: AWS Config audits resource state. AppConfig (part of Systems Manager) manages application-level configuration flags/parameters.
  • Inspector vs. GuardDuty: Inspector is a "Static/Scheduled" scanner for vulnerabilities (CVEs). GuardDuty is "Continuous/Behavioral" analysis of logs to find active threats.

Comparison Tables

GuardDuty vs. Macie vs. Inspector

FeatureGuardDutyMacieInspector
FocusThreat DetectionData Privacy (S3)Vulnerability Management
Primary SourceCloudTrail, VPC, DNS LogsS3 BucketsEC2, ECR, Lambda
DetectsMalware, Crypto-miningPII, Public S3 BucketsUnpatched software, CVEs
Analysis StyleIntelligent/BehavioralPattern Matching/MLSignature-based Scan

Config Rule vs. CloudFormation Drift

AWS ConfigCFN Drift Detection
ScopeAccount-wide, multi-resourceOnly resources within a CFN Stack
PersistenceContinuous recordingPoint-in-time check
AutomationNative remediation supportManual check required
Use CaseCompliance/GovernanceMaintaining IaC Integrity
All AWS Certified DevOps Engineer - Professional (DOP-C02) Study Resources

Related Notes

  • Mastering AWS Alerting and Automated Remediation1,050 words
  • Study Guide: Analyzing Failed Deployments in AWS940 words
  • Incident Analysis: Troubleshooting Failed Processes in AWS1,050 words
  • Mastering AWS Monitoring & Security Analytics: Logs, Metrics, and Findings1,050 words
  • AWS Log Analysis: Athena, CloudWatch Insights, and OpenSearch920 words
  • Analyzing Real-Time Log Streams with Amazon Kinesis Data Streams985 words
  • CloudWatch Anomaly Detection Alarms: Professional Study Guide820 words
  • AWS Application Storage Patterns: EBS, EFS, and S31,054 words
  • Lab: Automating Security Controls and Data Protection with AWS Secrets Manager and Config942 words
  • Master Study Guide: Automating Security Controls & Data Protection (AWS DOP-C02)1,184 words
  • Mastering AWS CloudFormation StackSets: Multi-Account & Multi-Region Orchestration895 words
  • Mastering System Configuration Changes in AWS945 words

Ready to study AWS Certified DevOps Engineer - Professional (DOP-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study AWS Certified DevOps Engineer - Professional (DOP-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
AWS Certified DevOps Engineer - Professional (DOP-C02) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.

Loading Diagram...
Flowchart, top to bottom. User/System Action connects to Action Type. B connects to AWS CloudTrail ("API Call"). B connects to VPC Flow Logs ("Network Packet"). B connects to AWS Config ("State Change"). C connects to S3 Security Bucket. D connects to F. E connects to F. F connects to Amazon Athena / OpenSearch Analysis.