Infrastructure

Azure Backup: validate immutability and Resource Guard before locking the vault

A production runbook for qualifying immutability, Resource Guard, MUA roles and restore evidence before making an Azure Backup vault lock irreversible.

24 Oct 2026 azureazure-backuprecovery-services-vaultimmutabilityresource-guardmuasecurityrbacpimbackupgovernanceautomationrunbookrollbackproduction

A team wants to lock immutability on its Recovery Services vault after a security review. The intent is sound: prevent a compromised account from reducing retention or deleting backups. But moving from Unlocked to Locked is irreversible. If policies are oversized, Resource Guard sits inside the same administrative boundary, or nobody has tested a restore, the lock fixes none of those problems and can preserve a bad configuration.

The running case is a vault protecting production VMs. The goal is not to enable a setting. It is to produce an operational decision: lock the vault, keep immutability reversible while gaps are corrected, or stop the change. A Private Endpoint can protect the network path for supported workloads; it does not replace immutability, separation of authority, or restore evidence.

Freeze the contract before any change

Start with the vault, workloads, policies, owners and decision window. Separate what remains reversible from what will not.

yaml backup-lock-change.yml
change_id: CHG-BKP-482
vault: rsv-prod-core
subscription: sub-platform-prod
region: westeurope
protected_workloads:
- vm-orders-prod
- vm-billing-prod
current_immutability: Unlocked
target_immutability: Locked
resource_guard: rg-backup-guard-prod
backup_admin_team: platform-ops
security_admin_team: security-ops
restore_evidence: DRILL-2026-10-18
decision: pending

The change record must also state who can change retention, who owns Resource Guard, how temporary access is granted, and which restore test proves the retained points are useful.

Inventory before locking

Do not start from the vault overview alone. List policies, protected items, recent jobs, and the immutability state returned by the API.

bash 01-inventory-vault.sh
SUBSCRIPTION="00000000-0000-0000-0000-000000000000"
VAULT_RG="rg-prod-backup"
VAULT="rsv-prod-core"

az account set --subscription "$SUBSCRIPTION"

az backup vault show \
--resource-group "$VAULT_RG" \
--name "$VAULT" \
--query "{id:id,location:location,immutability:properties.immutabilitySettings.state,softDelete:properties.securitySettings.softDeleteSettings.softDeleteState}" \
--output yaml

az backup policy list \
--resource-group "$VAULT_RG" \
--vault-name "$VAULT" \
--query "[].{name:name,type:properties.backupManagementType,schedule:properties.schedulePolicy,retention:properties.retentionPolicy}" \
--output json > backup-policies.json

az backup item list \
--resource-group "$VAULT_RG" \
--vault-name "$VAULT" \
--query "[].{name:properties.friendlyName,state:properties.protectionState,policy:properties.policyId,lastBackup:properties.lastBackupTime}" \
--output table

Property paths may vary with vault type and API version. Retain the raw response used during review. The durable control is consistency between the reported state, applied policies and every workload that is actually protected.

Prove the retention impact

Immutability blocks operations that would remove recovery points before their protected duration ends. A temporary policy, excessive retention, or a workload in the wrong vault therefore becomes durable debt after locking.

text retention-review.txt
For every policy
Business owner identified
RPO and RTO approved
Daily, weekly, monthly and yearly retention justified
Cost and growth estimated across the protected duration
Temporary workloads separated from regulated workloads
No test, clone or retired server protected by mistake
Restore procedure compatible with the retained duration

Block locking when
A provisional policy still protects production
An unknown or orphaned item remains in the vault
Retention will probably need to be reduced soon
The owner cannot explain the retention requirement

Locking must not compensate for missing governance. Clean up and validate while Unlocked still provides a controlled return path.

Prove Resource Guard separation

MUA only adds value when the vault administrator does not also control Resource Guard. The guard must be in the same region, but it can sit in another subscription or tenant to strengthen isolation.

bash 02-check-resource-guard.sh
VAULT_ID=$(az backup vault show \
--resource-group "$VAULT_RG" \
--name "$VAULT" \
--query id -o tsv)

az backup vault resource-guard-mapping show \
--resource-group "$VAULT_RG" \
--vault-name "$VAULT" \
--output json > resource-guard-mapping.json

az role assignment list \
--scope "$VAULT_ID" \
--include-inherited \
--query "[].{principal:principalName,role:roleDefinitionName,scope:scope}" \
--output table

Have the security team inspect assignments on Resource Guard separately. The vault administration identity must not permanently hold Contributor, Backup MUA Admin, or Backup MUA Operator on the guard. For an approved critical operation, grant Backup MUA Operator temporarily, preferably through PIM, and remove it when the window closes.

Test a protected operation without destructive impact

MUA displayed in the portal does not prove the authority boundary works. Run a negative test with a critical operation prepared but not carried through destructively: for example, a protected policy change against a canary vault, or the authorization phase for disabling still-reversible immutability.

text mua-negative-test.txt
Identity: backup-admin-test
Context: no active elevation on Resource Guard
Operation: protected change against the canary vault
Expected result: authorization denied
Evidence: UTC time, caller, correlation ID, Activity Log

Then
Identity: same operator
Context: Backup MUA Operator activated temporarily after approval
Operation: same bounded canary change
Expected result: authorized, complete trace, no permission to delete Resource Guard
End: elevation revoked or expired

Do not prove the control by deleting real data. The evidence is the authorization boundary, not the ability to create an incident.

Validate a restore before the lock

Backups that cannot be deleted but also cannot be restored do not provide recovery. Restore one representative workload into isolation with the identity, network and dependencies expected during an actual crisis.

yaml restore-proof.yml
restore_drill:
recovery_point: before-test-change
target: isolated-recovery-subscription
network: no-production-egress
checks:
  - restore_job_completed
  - operating_system_booted
  - application_data_readable
  - runtime_identity_bounded
  - representative_query_passed
  - recovery_time_recorded
evidence:
  - vault_job_id
  - activity_log_correlation_id
  - application_probe_result
cleanup:
  - restored_workload_stopped
  - temporary_roles_removed
  - evidence_retained

The drill must prove recoverability and its boundary. MUA protects operations on vaulted backups; it does not protect the source workload directly. The security plan must cover both sides.

Canary the reversible state

Before Locked, leave the vault in Unlocked for a representative window. Observe at least one backup cycle and alert, one approved policy change on a canary, and one restore drill.

bash 03-enable-then-lock.sh
# Reversible phase, after policy and Resource Guard review
az backup vault update \
--resource-group "$VAULT_RG" \
--name "$VAULT" \
--immutability-state Unlocked

# Irreversible phase, only after the formal decision
az backup vault update \
--resource-group "$VAULT_RG" \
--name "$VAULT" \
--immutability-state Locked

The second command has no testable rollback. After Locked, you can only correct processes around the vault; immutability itself cannot be disabled.

Decide lock, hold or correct

yaml lock-decision.yml
decision:
lock:
  when:
    - all_protected_items_have_an_owner
    - retention_is_approved_and_costed
    - resource_guard_is_independently_administered
    - negative_mua_test_passed
    - isolated_restore_drill_passed
    - monitoring_and_evidence_are_searchable

hold_unlocked:
  when:
    - useful_protection_exists_but_policy_cleanup_remains
    - pim_or_security_approval_path_is_not_tested
    - restore_evidence_is_stale

correct_before_retry:
  when:
    - backup_admin_controls_the_resource_guard
    - orphaned_items_or_temporary_policies_exist
    - restore_failed_or_exceeded_rto
    - critical_operations_are_excluded_without_justification

rollback_before_lock:
- keep_immutability_unlocked
- revert_the_test_policy
- remove_temporary_role_assignments
- preserve_evidence_and_open_corrective_actions

Conclusion

Locking an Azure Backup vault is an irreversible operating decision, not a compliance checkbox. The evidence must connect inventory, retention, role separation, a MUA operation denied without approval, controlled temporary elevation, and a successful restore.

Lock when those controls converge. Stay Unlocked when protection is useful but incomplete. Stop the change when the same actor controls the vault and its guard, retention has no accountable owner, or restore readiness remains theoretical.