EventBridge, Config and automated remediation

SOA-C03 · Monitoring, Logging, Analysis, Remediation, and Performance Optimization · Updated

Operations teams are expected to detect drift and fix it automatically. The exam tests which service detects, which one reacts, and which one performs the fix.

Who does what

ServiceRole
CloudTrailRecords API activity (who did what)
AWS ConfigRecords resource configuration history and evaluates it against rules
EventBridgeRoutes events to targets based on rules and schedules
Systems Manager AutomationRuns runbooks that change resources
Security HubAggregates findings from other security services

AWS Config

Config tracks configuration items for supported resources. A Config rule evaluates them and marks each resource compliant or noncompliant. Rules can be AWS managed (for example s3-bucket-versioning-enabled, required-tags, restricted-ssh) or custom using Lambda or Guard.

A rule can be triggered by a configuration change or on a periodic schedule. A conformance pack deploys a set of rules and remediations together. An aggregator gives a multi-account, multi-Region view.

Remediation

Config can attach a remediation action to a rule. It uses a Systems Manager Automation document, such as AWS-EnableS3BucketEncryption or one you write. Choose:

  • Manual: an operator starts it from the console.
  • Automatic: Config runs it for every noncompliant resource, with retry settings.

The remediation runs with an Automation assume role that must allow the fix, for example s3:PutBucketVersioning.

EventBridge for event-driven fixes

When an event should trigger work immediately, create an EventBridge rule with an event pattern. Typical sources:

  • CloudTrail management events (detail-type: AWS API Call via CloudTrail).
  • Config compliance change events.
  • Security Hub findings, for example an open management port.
  • Service events such as EC2 state changes.

Targets include Lambda, SNS, SQS, Step Functions and SSM Automation. A schedule rule replaces cron for periodic jobs, for example a Lambda that publishes a weekly SNS message.

A small pattern example:

{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": { "state": ["stopped"] }
}

Choosing the pattern

  • Need a fix for any noncompliant resource, including ones that already exist: Config rule plus remediation.
  • Need to react to one specific event within seconds: EventBridge rule plus target.
  • Need to notify a team: add SNS as a target.

Exam traps

  • CloudTrail does not evaluate compliance. Config does. CloudTrail shows who made the call.
  • Config alone does not fix anything. Remediation needs an Automation document and an IAM role.
  • Rules evaluate existing resources, but preventive controls such as SCPs or IAM conditions stop the action before it happens.
  • EventBridge was formerly named CloudWatch Events. They are the same service.
  • Config needs a recorder turned on in each Region, otherwise rules have nothing to evaluate.

Practice questions

Choose an answer, then review the explanation to check your understanding.

1. Every S3 bucket must have versioning enabled, and noncompliant buckets must be fixed without human action. Which design fits best?

Show answer

Answer: B.AWS Config evaluates configuration against rules and can attach automatic remediation that runs a Systems Manager Automation runbook.

2. A team wants an immediate notification and a Lambda function run when a security group is changed to allow port 22 from anywhere. What should trigger the function?

Show answer

Answer: B.EventBridge receives CloudTrail management events and Config compliance changes, and can target Lambda, SNS or SSM Automation.

3. Which service records who called the API that terminated an EC2 instance?

Show answer

Answer: B.CloudTrail records API calls (who, when, from where). Config records what the resource configuration looked like over time.

4. Instances without a Department tag must be found across all accounts in an organization. Which feature gives one view?

Show answer

Answer: A.A Config aggregator collects configuration and compliance data from multiple accounts and Regions into one place.

SOA-C03 course outline

All 8 lessons · Course overview
  1. CloudWatch agent, metrics and alarmsMonitoring, Logging, Analysis, Remediation, and Performance Optimization Free
  2. EventBridge, Config and automated remediationMonitoring, Logging, Analysis, Remediation, and Performance Optimization Free
  3. AWS Backup, snapshots and S3 replicationReliability and Business Continuity Full access
  4. Load balancing and Auto Scaling for availabilityReliability and Business Continuity Full access
  5. CloudFormation stacks, failures and driftDeployment, Provisioning, and Automation Full access
  6. Systems Manager patching and fleet managementDeployment, Provisioning, and Automation Full access
  7. KMS keys, Secrets Manager and S3 access controlSecurity and Compliance Full access
  8. Route 53 routing, VPC connectivity and DNSNetworking and Content Delivery Full access