Join our Newsletter — 33% off our NHI Course
Home› Guides› Configuration Drift and Baseline Enforcement Guide: GPO, Intune,…
Guide Endpoint Security

Configuration Drift and Baseline Enforcement Guide: GPO, Intune, Ansible and DSC

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

A hardened build is only hardened on the day it is built: without continuous enforcement, emergency fixes, local admin changes, software installs and failed policy delivery move every host away from its baseline. Configuration drift is the gap between the state you approved and the state that is actually running, and it is where audit findings, failed controls and easy attacker paths come from. This guide explains how to choose a baseline, how the main enforcement engines (Group Policy, Microsoft Intune, PowerShell DSC and Azure Machine Configuration, Ansible) detect and correct drift, how to roll enforcement out without outages, and how to measure whether it is working. It is written for endpoint and server engineers, platform teams and security architects who own configuration across mixed Windows and Linux estates.

Key takeaways

  • Start from a published baseline. Microsoft recommends adopting an industry-standard, well-tested configuration such as its security baselines rather than writing your own; CIS Benchmarks and DISA STIGs fill the same role across platforms.
  • Know each engine's enforcement mode. Group Policy refreshes every 90 minutes but its extensions reapply settings only when they detect a change; PowerShell DSC defaults to ApplyAndMonitor, which reports drift without fixing it; Ansible fixes only when it runs.
  • Audit before you enforce. Use Ansible --check --diff, DSC Test, Machine Configuration Audit mode or Intune reporting to see the gap before switching to auto-correction.
  • One owner per setting. Overlapping GPOs, Intune profiles and baselines create conflicts that look like drift; Intune itself does not decide which conflicting default wins.
  • Protect the enforcement plane. Whoever can edit a GPO, an Intune baseline or an Ansible inventory can change every host; those identities are some of the most privileged in the estate.

What configuration drift is and where it comes from

Drift has a handful of repeat causes, and each needs a different response.

Source of driftExampleBest counter
Manual change by an administratorFirewall rule added during an incident and never removedAuto-correction plus change records; remove standing local admin rights
Software installationInstaller enables a service or adds a firewall exceptionBaseline covers services and firewall; application allow listing
Failed policy deliveryDevice off the corporate network, broken MDM enrolment, GPO filtered out by WMI or security filteringReport on last successful check-in and policy status, not only on assignment
Conflicting policyGPO and Intune both set Defender settings with different valuesSingle source of authority per setting; conflict reports
Baseline ageingNew OS release adds settings the old baseline does not coverVersion baselines; review at each OS feature update
Image driftGolden image built months ago, patched differently from running hostsRebuild images on a schedule; immutable infrastructure where practical
Malicious changeAttacker disables logging or modifies the firewallDetection on configuration change, not only periodic scans

The last row matters: ATT&CK lists T1685 Disable or Modify Tools, T1686 Disable or Modify System Firewall and T1112 Modify Registry as defence impairment techniques, and drift detection is often the first place they show.

Choosing the baseline

  • Microsoft security baselines: Published in the Security Compliance Toolkit as GPO backups and as MDM baselines in Intune, for Windows 11, Windows 10 and Windows Server 2016 to 2022. They assume a well-managed organisation where standard users are not administrators, and they enforce a setting only if it mitigates a current threat without causing worse operational problems. See the Microsoft Security Baselines and Security Compliance Toolkit Guide.
  • CIS Benchmarks: Cover Windows, Linux distributions, Unix, cloud and applications, with Level 1 and Level 2 profiles. See the CIS Benchmarks Guide.
  • DISA STIGs: Required for many government and defence suppliers; stricter and more prescriptive. Intune offers an audit-only STIG baseline in GCC High. See the DISA STIG Guide.
  • Vendor built-ins: Some platforms ship their own assessment profiles, such as the Solaris compliance tool or OpenSCAP content for RHEL. See the OpenSCAP and Linux Compliance Scanning Guide.

Decision guidance: pick one primary baseline per platform, document deviations as a tailoring (not as edits scattered through policies), and map it to the controls auditors ask about. A small organisation running Windows and Microsoft 365 can usually adopt the Microsoft baselines through Intune with few changes. A regulated or mixed estate typically needs CIS or STIG for evidence, with the Microsoft baseline used as the starting point for Windows settings.

Enforcement engines compared

EnginePlatformsModelDrift behaviourBest fit
Group PolicyDomain-joined WindowsPull, background refresh every 90 minutes plus up to 30 minutes random offset; DCs every 5 minutesClient-side extensions reapply during refresh only when they detect a change, so a locally changed value can persist until the policy changes or a forced refreshOn-premises AD estates; servers
Microsoft Intune (MDM baselines, settings catalog)Windows 10/11, plus macOS, iOS, Android profilesCloud pull at device check-inRe-delivers assigned settings at check-in; reports per-setting status and conflictsCloud-managed and remote endpoints
PowerShell DSC (PSDSC with LCM)Windows (and Linux historically)Push or pull; LCM checks every ConfigurationModeFrequencyMins (default 15)ApplyOnly never rechecks; ApplyAndMonitor (default) logs drift; ApplyAndAutoCorrect logs and reappliesServers needing exact state with self-healing
Microsoft DSC 3.0Windows, Linux, macOSdsc command, JSON or YAML documents; no local configuration manager or serviceGet, Test and Set operations; scheduling comes from the orchestratorCross-platform declarative resources driven by another tool
Azure Machine ConfigurationAzure VMs and Azure Arc-enabled servers, Windows and many Linux distributionsAzure Policy guest assignmentsAudit, Apply and Monitor, or Apply and Autocorrect per assignmentHybrid fleets already governed with Azure Policy
Ansible (and AWX or Automation Controller)Linux, Unix, Windows, network devicesAgentless push over SSH or WinRMIdempotent tasks correct drift on each run; nothing happens between runsLinux and mixed estates; network devices
Configuration Manager compliance settingsWindowsAgent with configuration baselinesEvaluate on schedule, optional remediationExisting ConfigMgr estates

Agent-based tools in the same family (Puppet, Chef, Salt) follow the Ansible and DSC pattern: a desired state, a periodic run, and a report of what changed. The choice is usually decided by what the estate already uses. The rule that matters is that each setting has exactly one engine responsible for it.

Engine-specific notes

  • Group Policy: Processing order is Local, Site, Domain, OU (LSDOU), with the last applied setting winning; Enforced links override lower GPOs and Block Inheritance does not stop Enforced links. Force a reapply of unchanged settings with gpupdate /force or Invoke-GPUpdate when investigating. Consider enabling the per-extension option to process policy even if the GPOs have not changed for security-relevant extensions, so local changes are overwritten on the next refresh. See the Group Policy Security Guide.
  • Intune baselines: When a new baseline version is released, profiles on older versions become read-only; you change a profile's version in place. Different baselines can set the same setting with different defaults and Intune does not pick the best one, so conflicts must be investigated. Microsoft warns that default firewall settings in baselines may stop local and connection security rules from merging with MDM rules. See the Microsoft Intune Guide.
  • PSDSC: Set ConfigurationMode = 'ApplyAndAutoCorrect' only after a period in ApplyAndMonitor; decide whether RebootNodeIfNeeded is acceptable for each server class.
  • Ansible: ansible-playbook site.yml --check --diff --limit host previews changes; modules without check mode support do nothing and report nothing in check mode, and tasks depending on registered variables may not simulate correctly. Use diff: false on tasks that template secrets. Schedule runs (for example through AWX) so correction is continuous, not only at deployment. See the Ansible and AWX Security Guide.

Immutable and rebuilt infrastructure

The strongest answer to drift is to stop patching running hosts in place. Cloud instances, containers and VDI pools can be rebuilt from a versioned image or template on every change, so the running state is always the tested state and a drifted host is simply replaced. This works well for stateless tiers and poorly for databases, domain controllers and long-lived application servers, which still need an enforcement engine. Many estates combine both: rebuild where the workload allows it, enforce continuously everywhere else, and use the same baseline definition for image builds and runtime checks so the two never diverge.

Implementing enforcement: a phased rollout

  1. Inventory and scope: List every platform, management channel (GPO, Intune, ConfigMgr, Ansible, Arc) and which devices each reaches. Devices with no channel are your first finding. See the CIS Control 1 Inventory and Control of Enterprise Assets Guide.
  2. Select and tailor: Choose the baseline per platform, record each deviation with a reason, owner and review date, and store the tailoring in version control.
  3. Assign ownership of settings: Decide, area by area (firewall, Defender, BitLocker, user rights, audit policy), which engine is authoritative. Remove duplicate settings from the others. Co-managed Windows devices are the usual conflict zone.
  4. Measure the gap: Run in audit only: Policy Analyzer comparisons of GPOs against the baseline, Intune baseline reports, DSC Test, Machine Configuration Audit, Ansible check mode, OpenSCAP scans.
  5. Pilot rings: Apply enforcement to IT devices, then a representative pilot ring (around 5 to 10 percent including each major application owner), then broad deployment. Hold each ring for at least one full patch cycle.
  6. Switch to auto-correct: Move from monitor to correction once exceptions are agreed: DSC ApplyAndAutoCorrect, Machine Configuration Apply and Autocorrect, scheduled Ansible runs, Intune assignment.
  7. Roll back cleanly: For GPOs keep backups and unlink rather than delete; for Intune keep the previous profile and reassign; for code-driven tools revert the commit and rerun. Know which settings tattoo (persist after policy removal), because unassigning a policy does not always restore the old value.
  8. Operate: Review baseline versions at every OS feature update, re-certify exceptions quarterly, and feed drift into vulnerability and risk reporting.

Exceptions and conflicts

  • Exceptions as code: Express each approved exception as a scoped group, filter or variable, never as a manual change on the host. Otherwise the enforcement engine will "fix" it, or it will be invisible.
  • Expiry: Give every exception an end date and owner; expired exceptions should revert automatically.
  • Conflict reporting: Treat Intune conflict states, GPO Resultant Set of Policy surprises and Ansible tasks that report "changed" on every run as defects. A task that changes every run usually means two engines are fighting.
  • Small versus large organisations: Small teams should use one engine per platform and accept a near-default baseline. Large estates need a configuration owner per area, a change board for baseline versions, and a pipeline that tests baselines against reference builds before release.

Where identity fits

Enforcement engines are privileged identities with fleet-wide reach. An account that can edit a GPO linked to the domain, modify an Intune security baseline, or push an Ansible playbook as root can disable controls everywhere at once, which is why ATT&CK tracks T1484.001 Group Policy Modification. Limit GPO edit rights and Intune roles with scope tags to small groups using privileged access workstations, store Ansible and DSC credentials in a vault rather than in inventories, and alert on changes to baseline objects. See the Privileged Access Workstations Guide.

Detection and measurement

  • Change events: Monitor directory service changes to GPOs (Windows event 5136 on domain controllers when Directory Service Changes auditing is enabled), Intune audit logs for baseline and profile edits, and commits to configuration repositories.
  • Host-side signals: DSC drift entries in its operational logs, Machine Configuration non-compliant guest assignments, Ansible "changed" counts per host, and local security policy changes.
  • Coverage: Devices that have not checked in or applied policy within the expected window are drift by definition.
MetricWhat it showsTarget
Baseline conformance per platformPercentage of settings compliant across in-scope devices95% or above, trending up
Management coverageDevices reporting to at least one enforcement engine100% of inventory
Mean time to correct driftTime from detected drift to compliant stateWithin one enforcement cycle
Open exceptions past expiryGovernance healthZero
Settings with conflictsOverlapping enginesZero on security settings
Baseline version lagMonths since the current vendor baseline was adoptedOne release cycle or less

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev. 5CM-2 Baseline Configuration; CM-2(2) Automation Support for Accuracy and Currency; CM-3 Configuration Change Control; CM-6 Configuration SettingsDefines, automates and controls the baseline
NIST CSF 2.0PR.PS-01 Configuration management practices are established and applied; DE.CM-09 monitoring of computing hardware and softwareOutcome statements for enforcement and drift detection
CIS Controls v8.1Control 4 Secure Configuration of Enterprise Assets and SoftwareSecure configuration process and its maintenance
ISO/IEC 27001:2022Annex A 8.9 Configuration managementRequires configurations to be established, documented, implemented, monitored and reviewed
MITRE ATT&CK v20T1484.001, T1685, T1686, T1112Attacker changes that drift detection should catch

See the CIS Control 4 Secure Configuration of Enterprise Assets and Software Guide.

Common failure patterns

  • Monitor mode forever: DSC left at the default ApplyAndMonitor, Machine Configuration at Audit, or Ansible run only at build time, so drift is reported in dashboards nobody owns.
  • Two engines, one setting: Group Policy and Intune both manage the firewall or Defender, leaving results that depend on timing. Hosts flip between states and every report shows "changed".
  • Assignment counted as compliance: Reports show the policy is assigned to all devices, while offline or broken-enrolment devices never received it.
  • Stale baseline: A baseline adopted for an older OS release and never versioned, missing new protections and still enforcing obsolete ones.
  • Unprotected enforcement plane: Broad GPO edit rights or a shared Ansible SSH key, so a single compromised admin can push malicious configuration fleet-wide. The same lesson applies to SaaS configuration; see the SaaS Security Guide.
  • Exceptions applied by hand: Local changes that the next enforcement run reverts, causing outages and pressure to switch enforcement off.

Practitioner checklist

  • Map every device to an enforcement engine and close the coverage gaps first.
  • Adopt one published baseline per platform and keep the tailoring in version control.
  • Assign a single authoritative engine to each security setting area and remove duplicates.
  • Run audit or check mode across the estate and fix the largest gaps before enforcing.
  • Roll out through pilot rings, then switch to auto-correction (ApplyAndAutoCorrect, Autocorrect, scheduled Ansible).
  • Give exceptions owners and expiry dates, implemented as scoped policy, not manual changes.
  • Restrict and monitor who can change GPOs, Intune baselines and playbooks.
  • Report conformance, coverage, time to correct and exception expiry monthly.
  • Review baseline versions at every OS feature update.

Standards and references

Related NHI Mgmt Group resources: Microsoft Security Baselines and Security Compliance Toolkit Guide · Group Policy Security Guide · Ansible and AWX Security Guide · CIS Benchmarks Guide · SaaS Security Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.