Coverage
How many of each source's definitions ConvertTo-Bylaw converts. Every conversion is proved: the file it writes compiles back to the same definition.
Each definition is counted in one of the last three columns:
- Converted: written entirely with Bylaw's keywords.
- Uses Condition: converted and proved too, but one or more of its conditions are written as raw policy JSON inside
Condition, because Bylaw's keywords can't express them yet, such as anotaround agreaterOrEqualscomparison. The definition deploys the same, but those parts read as JSON rather than Bylaw, and Bylaw checks them less (Raw conditions). They move to Converted as the language grows. - Doesn't convert yet: no file is written. The reasons are below.
| Source | Policies | Initiatives | Converted | Uses Condition | Doesn't convert yet |
|---|---|---|---|---|---|
| Azure built-in policies | 2912 | 194 | 2851 (92%) | 75 (2%) | 180 (6%) |
| Azure Community Policy | 570 | 3 | 486 (85%) | 16 (3%) | 71 (12%) |
| Azure Landing Zones Library | 149 | 44 | 192 (99%) | 1 (1%) | 0 (0%) |
Left out
- Azure built-in policies: 1567 definitions in folders the gallery doesn't show, such as Azure Government copies of public cloud definitions.
- Azure built-in policies: 832 placeholders whose rule can never match, such as the Microsoft Managed Control policies that regulatory compliance initiatives list.
What doesn't convert yet
Grouped by the first reason ConvertTo-Bylaw gives. Each code links to what it means.
- 95 BYL6002: Its mode, Microsoft.Kubernetes.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Deprecated]: No AKS Specific Labels. Versioning Test BuiltIn., [Preview]: Kubernetes cluster services should only use allowed external IPs, Kubernetes cluster pod hostPath volumes should only use allowed host paths, Kubernetes cluster containers should only use allowed ProcMountType, Kubernetes cluster containers should only use allowed seccomp profiles - 25 BYL6002: Its mode, Microsoft.KeyVault.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Deprecated]: Keys should have a rotation policy within the specified number of days after creation. Versioning Test BuiltIn., Certificates should use allowed key types, Certificates using elliptic curve cryptography should have allowed curve names, Certificates should not expire within the specified number of days, Certificates should be issued by one of the specified non-integrated certificate authorities - 20 BYL6003: BYL3062: Effect parameter '...' of a Modify policy allows '...'.
For example: CosmosDB should restrict public access but allow access from certain IP addresses, Configure managed disks to disable public access, Enable soft-delete and purge protection on Key Vaults, Add user-assigned managed identity to virtual machines., Adds route with address prefix 0.0.0.0/0 pointing to the virtual appliance in case there is none. - 17 BYL6002: Its mode, Microsoft.CognitiveServices.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Preview]: Microsoft Foundry agents and toolboxes should only use approved tools, [Preview]: Microsoft Foundry agents should only use allowed agent kinds, [Preview]: Cognitive Services Agents should only use allowed control, [Preview]: Cognitive Services Agents should only use allowed prompt content filtering, [Preview]: Cognitive Services Deployments Should Only Use Allowed Control Mode - 11 BYL6003: BYL3002: DisplayName is N characters; Azure allows at most 128.
For example: [Preview]: Configure vaulted backup with auto-protection for ADLS blobs on storage accounts without a given tag to a backup vault, [Preview]: Configure backup for Azure Files Shares without a given tag to an existing recovery services vault in the same location, [Preview]: Microsoft Managed DevOps Pools should be provided with valid subnet resource in order to configure with own virtual network., [Deprecated]: Configure Azure Arc-enabled Windows machines with Log Analytics agents connected to default Log Analytics workspace, [Deprecated]: Deploy a VMInsights Data Collection Rule and Data Collection Rule Association for Arc Machines in the Resource Group - 9 BYL6002: Its mode, Microsoft.ContainerService.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Deprecated]: Ensure only allowed container images in AKS, [Deprecated]: Ensure containers listen only on allowed ports in AKS, [Deprecated]: Do not allow privileged containers in AKS, [Deprecated]: Ensure CPU and memory resource limits defined on containers in AKS, [Deprecated]: Enforce unique ingress hostnames across namespaces in AKS - 9 BYL6003: BYL3007: Metadata key '...' is longer than the N characters Azure allows per metadata property.
For example: Audit SSH security posture for Linux (powered by OSConfig), Configure SSH security posture for Linux (powered by OSConfig), [Preview]: Audit Local Administrator Password Solution (LAPS), [Preview]: Configure Local Administrator Password Solution (LAPS), [Preview]: Audit SSH security posture for Windows - 8 BYL6003: BYL3072: Effect parameter '...' of an Append policy allows '...'.
For example: append-backup-rsvault-cmk, Append specified values for encryption using customer managed keys and infrastructure encryption for Azure Backup, Append AKS API IP Restrictions, Append NSG Rule, Create NSG Rule - 7 BYL6002: Its mode, Microsoft.ManagedHSM.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Deprecated]: Key Vault Managed HSM keys using elliptic curve cryptography should have the specified curve names. Versioning Test BuiltIn., Azure Key Vault Managed HSM keys should be the specified cryptographic type, [Preview]: Azure Key Vault Managed HSM keys using elliptic curve cryptography should have the specified curve names, [Preview]: Azure Key Vault Managed HSM keys should have an expiration date, [Preview]: Azure Key Vault Managed HSM Keys should have more than the specified number of days before expiration - 6 BYL6002: Its mode, Microsoft.MachineLearningServices.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Preview]: Configure allowed registries for specified Azure Machine Learning computes, [Preview]: Configure log filter expressions and datastore to be used for full logs for specified Azure Machine Learning computes, [Preview]: Configure allowed module authors for specified Azure Machine Learning computes, [Preview]: Configure allowed Python packages for specified Azure Machine Learning computes, [Preview]: Configure code signing for training code for specified Azure Machine Learning computes - 4 BYL6003: BYL3072: Effect parameter '...' of an AuditIfNotExists policy allows '...'.
For example: [Preview]: Azure Stack HCI systems should have encrypted volumes, [Preview]: Host and VM networking should be protected on Azure Stack HCI systems, [Preview]: Azure Stack HCI servers should meet Secured-core requirements, [Preview]: Azure Stack HCI servers should have consistently enforced application control policies - 3 BYL6002: Its mode, Microsoft.MachineLearningServices.v2.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Deprecated]: Azure Machine Learning Model Registry Deployments are restricted except for the allowed Registry. Versioning Test BuiltIn., [Preview]: Azure Machine Learning Deployments should only use approved Registry Models, [Preview]: Azure Machine Learning Model Registry Deployments are restricted except for the allowed Registry - 3 BYL6003: BYL3012: -ContainText value '...' contains '...'; Azure doesn'...'*'...'*'...'t allow wildcards in contains.
For example: [Preview]: Azure AI Services RAI policies should enforce egress baseline and endpoint restrictions, [Preview]: Azure AI Services RAI policy rewrites should target permitted destinations, Azure firewall policy should only allow user defined standard ports and FQDNs within application rules - 3 BYL6004: properties.parameters.<name>.allowedvalues: Only the first has allowedvalues.
For example: CIS Azure Foundations v3.0.0, DORA 2022 2554, K ISMS P 2023 - 2 BYL6002: Its mode, Microsoft.DataFactory.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: [Deprecated]: Azure Data Factory pipelines should only communicate with allowed domains. Versioning Test BuiltIn, [Preview]: Azure Data Factory pipelines should only communicate with allowed domains - 2 BYL6002: Its mode, Microsoft.LoadTestService.Data, is a resource provider mode, which language version 1.0 doesn't support.
For example: Load tests using Azure Load Testing should be run only against private endpoints from within a virtual network., [Deprecated]: Load tests should be run only against private endpoints from within a virtual network. Versioning Test BuiltIn. - 2 BYL6003: BYL2003: Related resource type '...'Type'...'microsoft.compute/virtualmachines'...'Microsoft.Compute/virtualMachines/extensions'...'Microsoft.HybridCompute/machines/extensions'...' is not in the alias snapshot (/home/runner/work/PowerShell-Bylaw/PowerShell-Bylaw/src/Data/aliases.json).
For example: Deploy DSC Extension to Azure VM and Arc connected machines, Onboard Azure VM and Arc connected machines to Azure Automation DSC - 2 BYL6003: BYL3027: Parameter '...' is of type Array, but its default "" is not.
For example: Apply Diagnostic Settings for AKS Microsoft.ContainerService/managedClusters to a Regional Event Hub, Apply Diagnostic Settings for Microsoft.DBforPostgreSQL/flexibleServers to a Regional Event Hub - 2 BYL6003: BYL3027: Parameter '...' is of type Array, but its default "None" is not.
For example: Allowed Role Definitions For Specific Principal IDs, Allowed Role Definitions - 2 BYL6003: BYL3072: Effect parameter '...' of a DeployIfNotExists policy allows '...'.
For example: Deploy VM auto shutdown, Deploy a Data Lifecycle Management policy for Storage Accounts - 2 BYL6004: properties.name: Only the first has name.
For example: Upgrade BlobStorage accounts to StorageV2, Upgrade GPv1 storage accounts to GPv2 - 2 BYL6004: properties.parameters.<name>.maxvalue: Only the first has maxvalue.
For example: Audit - Azure Files should have Soft Delete enabled, Audit - Azure Storage Blobs and Containers should have Soft Delete enabled - 1 BYL6003: BYL1014: Policy '...' stopped because of an error: A positional parameter cannot be found that accepts argument '...'.
For example: Protect selected resources from deletion - 1 BYL6003: BYL1015: Parameter '...' has unknown type '...'.
For example: App Configuration stores should should have soft delete enabled of 7 days - 1 BYL6003: BYL1060: Condition isn't a valid policy condition: condition needs exactly one of allOf, anyOf, not, field, value or count (found none).
For example: Audit changes to route tables (UDRs) - 1 BYL6003: BYL2001: Alias '...' is not in the alias snapshot.
For example: deploy-advanced-data-security-managed-instances - 1 BYL6003: BYL3024: -BeIn needs a list, but parameter '...' is of type String.
For example: Deploy default Log Analytics VM Extension for Linux VMs. - 1 BYL6003: BYL3027: Parameter '...' is of type Array, but its default "NA" is not.
For example: Allowed VM Images for Resource Groups containing a specific Suffix - 1 BYL6003: BYL3027: Parameter '...' is of type Array, but its default "PAYG" is not.
For example: Require SQL VM License Models - 1 BYL6003: BYL3027: Parameter '...' is of type Array, but its default "PUBLIC" is not.
For example: Require SQL Server VM SQL Connectivity - 1 BYL6003: BYL3027: Parameter '...' is of type String, but its default [] is not.
For example: CMMC Level 3 - 1 BYL6003: BYL3064: Alias '...' isn'...'t change it.
For example: Configure Azure Machine Learning Computes to disable local authentication methods - 1 BYL6003: BYL3072: Effect parameter '...' of a DenyAction policy allows '...'.
For example: Users must authenticate with multi-factor authentication to delete resources - 1 BYL6003: BYL3093: Deployment passes '...', which is not a parameter of the template file '...'.
For example: Deploy Azure Security Center Vulnerability Assessment extension if does not exist - 1 BYL6004: properties.policyRule.if: The conditions differ as written: with [[concat('...',parameters('...'), '...')] equals "[parameters('...')]"] false, [tags.locklevel equals "cannotdelete"] true, [tags['...'] equals "cannotdelete"] false, ["[length(split(field('...'),'...'))]" equals 2] true, the first matches and the second doesn't.
For example: Resource Lock should be enabled - 1 BYL6004: properties.policyRule.if: The conditions differ as written: with [tags.date match "##-???-####"] true, [tags['...'] match "##-???-####"] false, the second matches and the first doesn't.
For example: Use match condition on tag value. - 1 BYL6004: properties.policyRule.then.details.deployment.properties.name: Only the first has name.
For example: Configure Private Endpoint for PaaS services to use private DNS zones
Bylaw