CLOUD CONCEPT

Configuration Drift

Configuration drift is the divergence of a resource’s actual configuration from its declared or approved desired state over time.

Cloud Concepts Hub →

What is Configuration Drift

Configuration drift occurs when running infrastructure, operating systems, or applications no longer match their intended configuration, often because of manual changes, competing automation, or incomplete deployments. Detecting and managing drift helps engineers preserve security controls, reproduce environments, and investigate unexpected changes before they cause incidents.

Configuration drift is a mismatch between an expected configuration and the configuration that actually exists. The expected state might be defined in an infrastructure-as-code template, a version-controlled operating-system baseline, or an approved security policy. For example, an administrator might temporarily open a security group to the internet during troubleshooting but forget to restore its original rules. The resource continues working, yet its configuration has diverged from the approved baseline.

Reliable drift management starts by defining the source of truth and the scope of comparison. Infrastructure templates describe particular resources and properties, while security policies express constraints such as requiring encryption or prohibiting unrestricted administrative access. These comparisons answer different questions. A resource can differ from its deployment template while still satisfying security policy, and it can match its template while remaining insecure because the template itself is flawed.

Cloud implementations combine change-triggered evaluations with scheduled assessments. Change-triggered checks shorten the interval between a modification and its detection. Scheduled checks provide recurring assurance and can assess conditions that do not have a suitable change trigger. Neither approach guarantees complete visibility: coverage depends on supported resource types, recorded properties, enabled accounts and Regions, permissions, and successful execution. A missed assessment or failed configuration recorder should therefore be treated as a monitoring gap, not as evidence of compliance.

On AWS, AWS Config records supported resource configurations and evaluates them using rules. Conformance packs package rules and remediation configurations to deploy a consistent assessment baseline across accounts and Regions. Rule evaluations may be change-triggered, periodic, or both, depending on the rule. Organization-wide aggregation supports centralized investigation, but aggregating results does not itself deploy rules or remediate resources.

Host-level configuration requires a different mechanism. AWS Systems Manager State Manager uses associations to apply desired configurations to managed nodes on a defined schedule or when otherwise triggered. An association might ensure that a security agent is installed and configured. Its compliance results reflect the association’s execution and assessment logic; they are not proof that every host setting remains continuously correct between executions. AWS Security Hub security controls and integrated findings provide centralized security posture visibility, but they do not replace infrastructure-template comparisons or host configuration enforcement.

Detection should lead to a controlled response. Preserve the observed configuration, identify the responsible change using audit records, assess the impact, and either restore the baseline or approve and codify the new state. For example, an unexpected inbound access rule can generate an alert and start a remediation workflow. Low-risk corrections can be automatic, while changes that might interrupt production traffic should require approval. Remediation should use least-privilege permissions, bounded retries, and checks that the resource is still noncompliant before modification.

Automation introduces trade-offs. Frequent assessments increase execution costs and API activity, while slower schedules leave longer exposure windows. Uncoordinated controllers can repeatedly overwrite one another, and automatic rollback can erase a legitimate emergency change. Use explicit ownership, time-limited exceptions, idempotent remediation, and post-remediation verification. Infrastructure as code reduces opportunities for drift but does not prevent out-of-band changes by itself. Drift detection is also not threat detection: an unexpected change warrants investigation, but it is not automatically malicious.

Key aspects of Configuration Drift

Effective drift management combines an explicit baseline, reliable assessments, actionable evidence, and safe reconciliation across the environment.

Explicit desired state

Define the expected configuration in version-controlled templates, policies, or configuration documents. Assign ownership so engineers can distinguish an unauthorized deviation from an approved baseline change.

Recurring and change-triggered assessment

Use change-triggered evaluations for timely detection and scheduled assessments for regular assurance. Monitor evaluation failures and coverage gaps rather than interpreting missing results as compliance.

Drift and compliance are different comparisons

Template drift checks whether a resource matches its declared configuration; compliance checks whether it satisfies a policy. Evaluate both because matching a template does not establish that the template is secure.

Controlled reconciliation

Restore the intended state or formally approve and update the baseline. Make remediation idempotent, verify current conditions before changing resources, and require approval where corrections could disrupt workloads.

Investigation and evidence

Retain configuration history, assessment results, and audit events to establish what changed and who initiated it. Verify remediation with a fresh assessment rather than relying only on a successful automation execution.

Organization-wide coverage

Apply consistent assessment policies across relevant accounts, Regions, and managed nodes. Centralized reporting improves visibility, but deployment coverage and remediation permissions must be configured separately.

Cloud services for Configuration Drift

AWS Config assesses resource configurations, while CloudFormation drift detection compares supported infrastructure properties with stack definitions. Systems Manager State Manager addresses desired configuration on managed nodes. Security Hub consolidates security findings, and EventBridge routes relevant events into alerting or response workflows. CloudTrail supplies activity evidence for investigating the changes behind a deviation.

Across an organization, deploy assessment policies and host associations to the intended accounts, Regions, and nodes before relying on centralized results. Use separately authorized remediation workflows, preserve investigation evidence, and verify the resulting state after correction. Centralized findings and successful automation executions do not by themselves establish complete coverage or continuous compliance.

AWS Config image AWS Config

Records supported resource configurations and evaluates them against AWS Config rules. Conformance packs deploy collections of rules and remediation configurations, while aggregators centralize configuration and compliance visibility across accounts and Regions.

Open AWS Config →
AWS Systems Manager image AWS Systems Manager

State Manager associations apply desired configurations to managed nodes and report association compliance. Systems Manager Automation runbooks can support investigations and corrective actions, including remediation initiated through AWS Config.

Open AWS Systems Manager →
AWS Security Hub image AWS Security Hub

Security Hub CSPM evaluates security controls and consolidates findings to expose deviations from security requirements. Many controls depend on AWS Config recording, and findings require separately configured response workflows rather than implying automatic remediation.

Open AWS Security Hub →
AWS CloudFormation image AWS CloudFormation

Drift detection compares supported deployed resource properties with expected values in a stack template. Coverage is limited to supported resources and properties, generally those explicitly set in the template or through its parameters; detection does not itself repair drift.

Open AWS CloudFormation →
Amazon EventBridge image Amazon EventBridge

Routes supported compliance-change events and security findings to notification, investigation, or remediation targets. Event rules and downstream workflows must be configured explicitly, with appropriate permissions and failure handling.

Open Amazon EventBridge →
AWS CloudTrail image AWS CloudTrail

Provides API activity records that help investigators attribute configuration changes to identities, sessions, and automation. It complements configuration assessments but does not determine whether the resulting resource state matches an approved baseline.

Open AWS CloudTrail →