Skip to content

Manage MCSB Control Overrides

The engineer's guide to switching off Microsoft Cloud Security Benchmark (MCSB) controls. Use this runbook to:

  • Disable an MCSB control that is permanently not-applicable by design.
  • Re-enable a control you previously disabled.
  • Work out why a subscription still shows a recommendation you disabled.

For what Secure Score measures and why changing this list moves it, see Defender for Cloud Secure Score.

Assignment B moved to azure-defender (November 2026)

The per-subscription side used to be the azure-mcsb-overrides project. It now lives in azure-defender's config/disabled-checks.yaml. See Manage Defender for Cloud.

Disable or exempt?

Disable a control only when it can never be met under the operating model. For example, "more than one owner on subscriptions" fails forever because Owner is only granted just-in-time through PIM. If the control could be met one day, or only one resource can't meet it, use a policy exemption with an expiresOn of 90 days or less.

Why there are two places to change

MCSB checks every subscription twice, through two separate policy assignments:

Assignment Scope Owned by Feeds
A psa-sec-mcsb-001 mg-intermediate-root, inherited by every subscription EPAC Regulatory compliance dashboard
B SecurityCenterBuiltIn ("ASC Default") Each subscription on its own Defender for Cloud, which creates and keeps resetting it Secure Score and Defender recommendations

EPAC is told to leave Defender's own assignments alone (keepDfcSecurityAssignments = true in global-settings.jsonc), so it can't touch B. Terraform can't own B either: Defender would keep putting it back. So B is handled by a small Terraform deployment that only patches one property on it.

A control disabled in only one of them keeps showing up through the other. Always change both.

The projects

Project Lane Holds
azure-governance-epac Tier 1, CI applies Assignment A. Each control's effect lives in one row of pa-sec-MsftCloudSecurityBenchmarkV2.csv.
azure-defender B Assignment B, for every subscription below mg-intermediate-root except those under mg-sandboxes. The list lives in config/disabled-checks.yaml.

Both are Tier 1: CI plans on the MR and applies on main after merge.

How azure-defender handles assignment B

  • Subscriptions are found automatically, at any depth below mg-intermediate-root. Nobody lists them or their management groups.
  • Terraform only changes overrides. One override sets policyEffect = Disabled for every check in config/disabled-checks.yaml. Defender keeps owning everything else on the assignment.
  • Each ID is checked against the live rule set. A typo fails the plan.
  • A nightly pipeline schedule on main picks up new subscriptions.
  • Identity: sp-pla-tf-azure-defender-rw, defined in azure-service-principals-platform.

Before you start, find the control's reference ID

Both projects identify a control by its policyDefinitionReferenceId, the member's name inside the MCSB initiative (for example identityDesignateMoreThanOneOwnerMonitoring). It is not the display name and not the policy definition GUID.

The quickest place to find it is the EPAC CSV, which lists every member it sets an effect for. If the control isn't there yet, look it up in the live initiative:

(Get-AzPolicySetDefinition -Name 'e3ec7e09-768c-4b64-882c-fcada3772047').PolicyDefinition |
  Where-Object policyDefinitionId -match '<policy-definition-guid>' |
  Select-Object policyDefinitionReferenceId, policyDefinitionId

Also write down why it can never apply. You'll need that for the code comment and for ADR-0001.


Disable a control

1. Disable it in EPAC (assignment A)

📁 azure-governance-epac: 📃 Definitions/policyAssignments/security/pa-sec-MsftCloudSecurityBenchmarkV2.csv

Find the control's row and set prodEffect to Disabled. If it has no row, add one. The name column is the policy definition GUID, not the reference ID. EPAC fails Build-DeploymentPlans with "unknown Policy name" if you put the reference ID there.

name,referencePath,policyDefinitionReferenceId,category,displayName,allowedEffects,prodEffect,prodParameters
09024ccc-0c5f-475e-9457-b7c0d9ed487b,,identityDesignateMoreThanOneOwnerMonitoring,Identity,More than one owner should be designated for subscriptions,AuditIfNotExists;Disabled,Disabled,{}

Disabled must be one of the values in allowedEffects.

Open an MR. Check the plan changes only psa-sec-mcsb-001's parameters, then merge.

2. Disable it on every subscription (assignment B)

📁 azure-defender: 📃 config/disabled-checks.yaml

Add the same reference ID, with its title and reason:

checks:
  identityDesignateMoreThanOneOwnerMonitoring:
    title: "There should be more than one owner assigned to subscriptions"
    reason: "No standing Owner role assignments by design. Owner is granted just in time through the PIM-eligible platform group."

Open an MR. CI posts the plan. Check it shows one in-place update per subscription to azapi_update_resource.disabled_checks["<sub-id>"], and that each update only changes the overrides list. It should create or destroy nothing. Merge, then press play on apply.

3. Record it in ADR-0001

📁 azure-governance-epac: 📃 Docs/adr/ADR-0001-mcsb-audit-separate-enforcement.md

Add a row to the By-design not-applicable MCSB controls table with the reference ID, the reason, and both places it is disabled. This is the record auditors read. The code comments don't replace it.


Re-enable a control

Do the steps above in reverse:

  1. EPAC: set the CSV row's prodEffect back to its audit effect (Audit or AuditIfNotExists). Merge.
  2. azure-defender: remove the entry from config/disabled-checks.yaml. Merge and apply.
  3. ADR-0001: remove the row, or mark it re-enabled with the date.

Removing the deployment does not undo the overrides

azapi_update_resource doesn't revert its change when it's destroyed. If you delete the resource, or the whole deployment, the last override stays on every subscription. To clear everything, set checks: {} and let it apply first. That sends an empty overrides list.


Check it worked

On one subscription, read the override straight from the assignment:

az policy assignment show \
  --name SecurityCenterBuiltIn \
  --scope /subscriptions/<sub-id> \
  --query "overrides[0].selectors[0].in"

The output should match the keys of config/disabled-checks.yaml exactly.

In the portal: Defender for Cloud → Recommendations. The control's recommendation drops out of the list, and out of Secure Score, once Defender re-assesses. That takes up to about 24 hours. Seeing it on the day of the merge doesn't mean the change failed.


When it fails

Symptom Cause Fix
Nightly run fails with 404 on …/policyAssignments/SecurityCenterBuiltIn for one subscription Defender for Cloud isn't on for that subscription yet, so the assignment doesn't exist. EPAC psa-sec-defender-001 turns it on, but only after a remediation cycle. Nothing. The next nightly run passes once EPAC has enrolled it. If it keeps failing for days, check the psa-sec-defender-001 remediation for that subscription.
A subscription still shows a disabled recommendation after 24h It's under mg-sandboxes, or outside mg-intermediate-root Accept it for a sandbox. Otherwise move the subscription into the governed hierarchy.
Recommendation is gone from Secure Score but still fails on the regulatory compliance dashboard Disabled on B only Do step 1.
Compliance dashboard is clean but the recommendation still appears Disabled on A only Do step 2.
Build-DeploymentPlans fails with "unknown Policy name" CSV name column holds the reference ID instead of the policy definition GUID Put the GUID in name and the reference ID in policyDefinitionReferenceId.
Plan wants to change selectors on every subscription when you didn't change the list Someone changed config/disabled-checks.yaml on main without an apply Read the diff. If it matches what's on main, let it apply.

Secure Score will move

Disabling a control takes it out of the score calculation, so the score usually goes up after this change. Re-enabling one usually takes it down. Mention the expected effect in the MR so a jump in the weekly governance report isn't mistaken for real drift.