Skip to content

Policy reconciliation and lab risk contract

In Step 3.5: Governance, 04g-Governance ran discover.py (apex-azure-governance-discovery) against the live workload subscription and its management-group hierarchy (Tenant Root Group and mg-factory-corp). Later, during Step 4 planning reviews (pass1 through pass11), challenger-review-subagent surfaced two non-production lab findings that could not be technically closed within the archetype’s fixed scope, triggering APEX’s cryptographic lab risk-authorization workflow (risk-envelope-v1).

discover.py discovered 28 policy assignments, filtered 3 automatic Microsoft Defender for Cloud subscription assignments by default (later verified separately as deployIfNotExists only, adding zero Deny rules), and retained 25 active assignments containing 19 Deny blocker findings across 17 unique policy definitions:

Policy effect / categoryDiscovered countReconciliation against the university design
Deny blockers (applicable to deployed types)8 unique definitions100% satisfied by design (0 conflicts). Every required Bicep property path is wired explicitly in 04-implementation-plan.md and attested in 05-iac-handoff.json.
Deny blockers (not applicable to deployed types)9 unique definitions (11 findings incl. 3x Block VM SKU Sizes)Not applicable. Targets VMs, VMSS, AKS, Azure SQL logical servers, Cognitive Services/OpenAI, Sentinel workspaces, Key Vault Managed HSM, or retired ASM Microsoft.Classic* types.
Modify assignments13 policiesAligned explicitly. Templates set allowBlobPublicAccess: false, allowSharedKeyAccess: false, disableLocalAuth: true, and publicNetworkAccess: 'Disabled' upfront so create requests match Modify mutations with zero drift.
DeployIfNotExists (DINE) assignments33 policies (4 Private DNS + 7 ALZ-lite diagnostics + 22 Defender/MCAPSGov)Unverified at plan time; gated post-deploy. Templates omit privateDnsZoneGroup on PEs and omit duplicate log settings on DINE-covered types, then verify zone groups, private IP resolution, and log-management sinks in postdeploy-tests.ps1.
Tag enforcement policies0 policies9-tag APEX lowercase fallback applied explicitly to rg-university-<suffix> and every created resource; vended rg-spoke is never retagged.

Every active Deny policy affecting a resource type in infra/bicep/university/ maps to an explicit Bicep property in the Step 4 governance compliance matrix:

Policy display nameInherited scopeEnforced target and property pathPlanned Bicep value
Storage accounts should disable public network accessmg-factory-corpMicrosoft.Storage/storageAccounts -> properties.publicNetworkAccess'Disabled'
Public network access should be disabled for Container registriesmg-factory-corpMicrosoft.ContainerRegistry/registries -> properties.publicNetworkAccess'Disabled'
Azure Key Vault should disable public network accessmg-factory-corpMicrosoft.KeyVault/vaults -> properties.publicNetworkAccess'Disabled'
Service Bus Namespaces should disable public network accessmg-factory-corpMicrosoft.ServiceBus/namespaces -> properties.publicNetworkAccess and networkRuleSets.properties.publicNetworkAccess'Disabled' on both
Azure SQL Managed Instances should disable public network accessmg-factory-corpMicrosoft.Sql/managedInstances -> properties.publicDataEndpointEnabledfalse
Network interfaces should not have public IPsmg-factory-corpMicrosoft.Network/networkInterfaces -> ipConfigurations[*].publicIpAddress.idAbsent (zero public IPs declared)
SFI-ID4.2.4 SQL Managed Instance - Safe Secrets StandardTenant Root GroupMicrosoft.Sql/managedInstances -> properties.administrators.azureADOnlyAuthenticationtrue (Entra admin = deployer)
Resources should not be created in West EuropeTenant Root GroupAll resources -> location@allowed(['swedencentral', 'germanywestcentral'])

In addition, ALZ-lite: Allowed locations and ALZ-lite: Audit resource location matches resource group location at mg-factory-corp were verified via az policy assignment show as Audit effect (enforcementMode: Default), and co-locating rg-university-<suffix> and all regional resources in the hub’s EU region satisfies both.

Because tags_required returned empty at both subscription and management-group scopes, the archetype applies the canonical 9-tag lowercase contract from apex-azure-defaults as a constant object on rg-university-<suffix> and every taggable workload resource:

Tag contract in main.bicep
var tags = {
environment: 'dev'
owner: 'lab-admin'
costcenter: 'apex-factory'
application: 'university'
workload: 'university'
sla: 'best-effort'
'backup-policy': 'platform-default'
'maint-window': 'system-default'
'technical-contact': 'ghostbusters'
}

Challenger pass 11 and the risk-envelope-v1 lab contract

Section titled “Challenger pass 11 and the risk-envelope-v1 lab contract”

During iterative plan hardening (challenge-findings-plan.json through challenge-findings-plan-pass11.json), 05-IaC Planner resolved nine passes of technical findings (including ARM atScope() policy discovery on Windows, multi-IP ACR private DNS verification, ARM audience token checks for UAMI ACR pulls, and fail-closed SQL virtual cluster checks).

Pass 11 returned NEEDS_REVISION on two genuine security boundaries intrinsic to the owner’s hackathon kit architecture:

Finding IDClassificationRule / boundaryResidual exposure preserved in risk-authorization.r2.json
bc629836mandatory-with-exceptionIaC security baseline: public HTTPS web apps require authentication and edge security controlsEnd-user auth (Easy Auth) and WAF were excluded from B09 by owner decision (public_edge_auth=none; app auth belongs to B06/B10). If an adopter deploys an unauthenticated app that invokes id-university-<suffix>, anonymous callers could trigger its Blob, Service Bus, or Key Vault RBAC permissions within that lab RG.
a749666a (prior 569fbf8e)residual-riskManaged identity attachment boundary on shared id-sqlmi-directorySQL MI needs Microsoft Graph read (User.Read.All, GroupMember.Read.All, Application.Read.All) so C7 can create Entra database users. Vending (B08) grants members Managed Identity Operator on shared id-sqlmi-directory, which allows attaching that UAMI to another resource in their lab subscription to obtain tenant-wide Graph read tokens.

Why APEX uses signed risk envelopes instead of suppressing findings

Section titled “Why APEX uses signed risk envelopes instead of suppressing findings”

APEX forbids rewriting NEEDS_REVISION to APPROVED or marking unmitigated risks “closed by prose.” Instead, for non-production lab kits, apex-recall enforces a cryptographic risk-envelope-v1 / risk-authorization-v1 workflow (agent-output/university/risk/):

  1. Review integrity stays untouched. challenge-findings-plan-pass11.json remains NEEDS_REVISION, and both findings remain explicitly open and risk-accepted rather than closed.
  2. SHA-256 input binding. risk-authorization.r2.json binds its Ed25519 signature (key_id: "lab-kit-owner") to the exact SHA-256 digests of challenge-findings-plan-pass11.json, 04-implementation-plan.md, 04-iac-contract.json, 04-policy-property-map.json, 04-environment-manifest.json, 04-governance-constraints.md/.json, risk-eligibility-bc629836.r2.json, risk-exception-bc629836.r2.json, and risk-eligibility-a749666a.r2.json. Editing a single byte of the plan or contract invalidates the authorization (revocation_conditions: ["input-change", "scope-change", "authority-revoked", "authorization-revoked", "validity-expired"]).
  3. Kit-only action ceiling. actions is restricted strictly to ["plan-complete", "codegen", "code-complete"] (expires_at: "2026-11-19T12:23:00Z"). Running apex-recall check-gate university --action codegen --json returns exception-authorized, whereas any deployment gate check blocks because kit authoring permission never authorizes deployment.
  4. Binding adopter obligations. Two mandatory obligations[] travel with the kit:
    • adopter-deployment-authorization (before-deploy): each adopting team must obtain a separate signed deployment authorization bound to their own tenant, subscription, event window, cleanup owner, and teardown deadline before running Step 6.
    • adopter-teardown-verification (after-teardown): after the event, the cleanup owner must independently verify and collect post-teardown evidence that all SQL MI consumers, id-sqlmi-directory and its Graph grants, and the public web app have been deleted.