Skip to content

Security Baseline

Non-negotiable security requirements for all generated infrastructure code.

The security baseline is enforced by the validate:iac-security-baseline validator (pre-commit hook + CI pipeline) and the challenger-review-subagent at adversarial review gates. Violations block code generation and deployment.

#RuleBicep PropertyTerraform ArgumentWAF Pillar
1TLS 1.2 minimumminimumTlsVersion: 'TLS1_2'min_tls_version = "1.2"SE:07
2HTTPS-only trafficsupportsHttpsTrafficOnly: truehttps_traffic_only_enabled = trueSE:07
3No public blob accessallowBlobPublicAccess: falseallow_nested_items_to_be_public = falseSE:05
4Managed Identity preferredidentity: { type: 'SystemAssigned' }identity { type = "SystemAssigned" }SE:05
5Azure AD-only SQL authazureADOnlyAuthentication: trueazuread_authentication_only = trueSE:05
6Public network disabled (prod only)publicNetworkAccess: 'Disabled'public_network_access_enabled = falseSE:06
7No shared key access on storageallowSharedKeyAccess: falseshared_access_key_enabled = falseSE:05
8App Service HTTP/2 enabledhttp20Enabled: truehttp2_enabled = trueSE:07
9Container Registry admin user disabledadminUserEnabled: falseadmin_enabled = falseSE:05

Rule 6 clarification: Public network access is only required to be disabled for production environments. Dev/test environments may keep public access enabled for developer convenience, but must still enforce all other rules.

WAF pillar key: SE:05 = Identity & access, SE:06 = Network security, SE:07 = Encryption.

The validator also catches these anti-patterns:

PatternBicepTerraformSeverity
Redis non-SSL portenableNonSslPort: trueenable_non_ssl_port = trueBlocks deployment
FTPS allowedftpsState: 'AllAllowed'ftps_state = "AllAllowed"Blocks deployment
Remote debuggingremoteDebuggingEnabled: trueremote_debugging_enabled = trueBlocks deployment
Cosmos DB local authdisableLocalAuth: falselocal_authentication_disabled = falseBlocks deployment
PostgreSQL SSL disabledsslEnforcement: 'Disabled'ssl_enforcement_enabled = falseBlocks deployment
MySQL SSL disabledsslEnforcement: 'Disabled'ssl_enforcement_enabled = falseBlocks deployment
Key Vault network opennetworkAcls.defaultAction: 'Allow'default_action = "Allow"Warning
Wildcard CORSallowedOrigins: ['*']allowed_origins = ["*"]Warning
Storage OAuth defaultdefaultToOAuthAuthentication: falsedefault_to_oauth_authentication = falseWarning

The security baseline is checked at multiple points in the workflow:

  1. CodeGen Phase 4npm run validate:iac-security-baseline runs after lint/review subagents. Violations are a hard gate before adversarial review.
  2. Deploy Preflight — the validator runs again before what-if/plan analysis. Conditional skip if CodeGen already passed (security_validation_status: PASSED).
  3. Pre-commit hooklefthook.yml runs the validator on staged .bicep/.tf files.
  4. CI pipelinevalidate:_node includes the security baseline in the parallel validation suite.
Terminal window
# Check all IaC files
npm run validate:iac-security-baseline
# Full validation suite (includes security baseline)
npm run validate:all

The validator uses regex-based single-line pattern matching. Nested or multi-line property assignments (e.g., a property split across multiple lines) may not be caught. The challenger-review-subagent provides a second layer of defense for patterns the regex cannot detect.