Skip to main content
Welcome back. This lesson revisits AWS Config and automated remediation for cloud governance. We’ll cover:
  • Cloud governance and the compliance lifecycle (monitor → assess → detect → remediate)
  • AWS Config fundamentals and configuration items (CIs)
  • Config Rules: managed vs custom and conformance packs
  • Building custom rule evaluations with Lambda
  • Remediation framework (SSM Automation, Lambda, EventBridge)
  • Multi-account aggregation using AWS Organizations
  • Integrating AWS Security Hub as an aggregator and responder
  • Troubleshooting common issues
The diagram below shows the compliance lifecycle and how monitoring inputs feed assessment, detection, and remediation workflows.
A slide diagram titled "Automating Security Controls and Governance in AWS" showing an AWS security workflow: Assess (AWS Config) → Detect (AWS Security Hub) → Remediate (AWS Systems Manager) with Monitor inputs (CloudWatch, EventBridge) feeding alerts/metrics back into reassessment and remediation.
Manual security checks do not scale to hundreds or thousands of resources. The goal of automated governance is to produce continuous compliance dashboards and automated remediation so teams can act at cloud scale.
A screenshot of an AWS Compliance Dashboard titled "Scenario: The Cloud Governance Challenge," showing a compliance summary. The dashboard highlights 24.75% (199) of resources in violation and other metrics like 804 resources monitored and 1 account analyzed.

AWS Config fundamentals

AWS Config provides a configuration inventory, change tracking, and a historical timeline of resource configurations. Config acts as a configuration recorder producing configuration items (CIs), storing snapshots, and emitting streams you can route to storage, notifications, and aggregators.
A diagram titled "AWS Config Fundamentals" showing how AWS CloudTrail feeds into AWS Config's configuration recorder to produce configuration items and history. Those configuration streams are sent to Amazon S3 (storage), Amazon SNS (notifications), and AWS Organizations (multi-account) for snapshots and delivery.
A configuration item is a point-in-time snapshot of a resource. Example (simplified):
Key Config outputs:
  • History: stored snapshots for auditing and drift analysis.
  • Streams: near-real-time notifications to SNS, EventBridge, or S3.
  • Rules: evaluation constructs that assess CI state and mark COMPLIANT or NON_COMPLIANT.

AWS Config Rules: managed vs custom

Config rules evaluate resource state and determine compliance. Rules can be triggered by configuration changes, periodic evaluations, or manual invocation. There are two primary rule types: Conformance packs bundle rules (managed and custom) into templates for consistent deployment across accounts and regions (useful for security, operational controls, or regulatory baselines).
A slide titled "AWS Config Rules" showing a comparison table of AWS Managed Rules vs Custom Rules across features like definition, customization, maintenance, use cases, deployment, evaluation speed, and conformance packs. It contrasts pre-built AWS-maintained rules with user-defined Lambda-based custom rules and their respective responsibilities and trade-offs.
Rule evaluation flow: an evaluation trigger (change, periodic, or manual) invokes evaluation logic and yields an evaluation result (COMPLIANT / NON_COMPLIANT). That result can trigger notifications or automated remediation.
A slide titled "AWS Config Rule Evaluation Rules" showing a flowchart from "Evaluation Trigger" to "Rule Evaluation" to "Evaluation Result." It lists trigger types (configuration changes, periodic, manual) and evaluation details (scope, parameters, logic, remediation) that produce a compliant/non-compliant result.
If a resource is NON_COMPLIANT you can:
  • Send notifications via SNS or EventBridge.
  • Trigger automated remediation (SSM Automation runbooks, Lambda, or other automation).
Conformance packs standardize and automate deployments of related rules and remediation controls across OUs and accounts.
A slide titled "Managed Rules and Conformance Packs" showing an AWS Config conformance pack diagram: a central "Conformance Pack" node branching to four colored boxes labeled "Operational Best Practices," "Security Best Practices," "Service-Specific Rules," and "Regulatory Compliance." The layout visually represents the structure of conformance packs and their rule categories.

Custom Config rules and Lambda-based evaluations

Custom rules receive a configurationItem and ruleParameters, run evaluation logic, and return an evaluation result to AWS Config. Most custom rules are implemented as Lambda functions that parse the event, examine the CI, and call PutEvaluations. Example Lambda evaluation function (Python, simplified):
When Config detects NON_COMPLIANT, the rule can invoke a remediation action and pass parameters (resourceId, securityGroupId, region, etc.) to the automation target.
A presentation slide titled "Remediations Framework" with a heading "AWS Config Remediation: Parameter Mapping Example." It shows a boxed bullet list mapping ResourceId -> AutomationParameter:InstanceId, SecurityGroupId -> AutomationParameter:GroupID, and Region -> AutomationParameter:Region.

Remediation targets: SSM Automation, Lambda, and others

Systems Manager Automation runbooks are common remediation targets because they support long-running tasks, step logging, approvals, and role-based execution. SSM Automation is preferable for complex, auditable operational changes.
A presentation slide titled "Systems Manager Automation for Remediation" showing a small diagram that maps config rule parameters to automation parameters (e.g., BucketName -> S3BucketName, KmsKeyId -> KMSKeyId, EnableLogging -> LoggingEnabled).
Lambda-based remediation functions are usually triggered via EventBridge when a Config rule or Security Hub finding indicates non-compliance. The Lambda performs corrective actions, logs to CloudWatch, and can report status back to Config or SSM.
An AWS architecture diagram titled "Lambda-Based Custom Remediation" showing AWS Config (with an optional EventBridge trigger) invoking a Lambda remediation function. The Lambda updates a target AWS resource (e.g., security group) and sends logs to CloudWatch.
Basic remediation Lambda outline:
Lambda execution time and memory limits still apply. For long-running or multi-step remediations prefer SSM Automation; use Lambda for short corrective actions that complete within the runtime limits.
Parameters commonly passed into remediation actions include bucket names, KMS key IDs, instance IDs, and region values. Design parameter mapping carefully so runbooks and Lambdas are reusable across accounts and regions.

Multi-account governance and aggregators

Large organizations typically centralize Config data into an aggregator account using AWS Organizations. Typical steps:
  • Enable AWS Organizations and a management account.
  • Create a central S3 bucket and ensure proper bucket policy/IAM permissions for delivery.
  • Deploy Config recorders, delivery channels, and rule sets via CloudFormation StackSets across OUs/accounts/regions.
A vertical flowchart titled "Multi-Account Governance" showing the deployment workflow for organization-wide AWS Config implementation. It lists steps like prerequisites, create CloudFormation StackSet, select deployment targets, set deployment options, and review and deploy.
Aggregators require correct IAM roles and S3 policies so member accounts can deliver configuration snapshots and streams. Ensure region coverage and resource-type recording settings are consistent across accounts. When compliance state changes occur, AWS Config can publish events to SNS or EventBridge. Example EventBridge pattern to catch NON_COMPLIANT notifications:
SNS is useful for distribution to email, webhooks, or downstream systems (SQS, Lambda).

Security Hub integration

AWS Security Hub aggregates findings from Config, GuardDuty, Inspector, Macie, and other services, normalizing them into a single view. Benefits:
  • Correlate Config compliance results with threat and vulnerability findings.
  • Trigger automation (EventBridge rules → Lambda / SSM) from Security Hub findings.
  • Use Security Hub insights and playbooks to orchestrate investigative and remediation workflows.
A Config-based finding may appear in Security Hub with severity and status fields—use these to prioritize and automate responses.

Troubleshooting and common challenges

Common failure points and mitigations: Example CloudWatch Logs entry for a remediation permission failure:
Permissions are the most frequent cause of remediation failures—make role policies and trust relationships an early troubleshooting focus.
When designing your automation, balance evaluation frequency (continuous vs periodic) against cost and risk. Use periodic evaluations for low-risk resources and continuous monitoring for high-risk assets.
Thanks for reading.

Watch Video