Bylaw

Gallery › Security Center › Azure built-in policies

[Deprecated]: Azure registry container images should have vulnerabilities resolved (powered by Qualys)

Converted Policy AuditIfNotExists Disabled Mode All Version 2.1.0-deprecated Deprecated

As outlined in the unified vulnerability assessment solution strategy blog (https://aka.ms/MDCUnifiedVAblog), we have made a strategic decision to unify all vulnerability assessment solutions in Defender for Cloud to use Defender vulnerability management. As part of this change, the built-in Qualys offering is now retired. See https://aka.ms/TransitionToMDVM4Containers for more information and transition guidelines.

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONASC_ContainerRegistryVulnerabilityAssessment_Audit.json · 55 lines
{
  "properties": {
    "displayName": "[Deprecated]: Azure registry container images should have vulnerabilities resolved (powered by Qualys)",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "As outlined in the unified vulnerability assessment solution strategy blog (https://aka.ms/MDCUnifiedVAblog), we have made a strategic decision to unify all vulnerability assessment solutions in Defender for Cloud to use Defender vulnerability management. As part of this change, the built-in Qualys offering is now retired. See https://aka.ms/TransitionToMDVM4Containers for more information and transition guidelines.",
    "metadata": {
      "version": "2.1.0-deprecated",
      "category": "Security Center",
      "deprecated": true
    },
    "version": "2.1.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "defaultValue": "Disabled"
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "equals": "Microsoft.ContainerRegistry/registries"
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Security/assessments",
          "name": "dbd0cb49-b563-45e7-9724-889e799fa648",
          "existenceCondition": {
            "field": "Microsoft.Security/assessments/status.code",
            "in": [
              "NotApplicable",
              "Healthy"
            ]
          }
        }
      }
    },
    "versions": [
      "2.1.0",
      "2.0.2",
      "2.0.1"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/5f0f936f-2f01-4bf5-b6be-d423792fa562",
  "name": "5f0f936f-2f01-4bf5-b6be-d423792fa562"
}
Bylaw5f0f936f-2f01-4bf5-b6be-d423792fa562.bylaw.ps1 · 28 lines
# Converted from ASC_ContainerRegistryVulnerabilityAssessment_Audit.json by ConvertTo-Bylaw.
Policy '5f0f936f-2f01-4bf5-b6be-d423792fa562' {

    Properties @{
        DisplayName   = '[Deprecated]: Azure registry container images should have vulnerabilities resolved (powered by Qualys)'
        Description   = 'As outlined in the unified vulnerability assessment solution strategy blog (https://aka.ms/MDCUnifiedVAblog), we have made a strategic decision to unify all vulnerability assessment solutions in Defender for Cloud to use Defender vulnerability management. As part of this change, the built-in Qualys offering is now retired. See https://aka.ms/TransitionToMDVM4Containers for more information and transition guidelines.'
        Version       = '2.1.0-deprecated'
        Category      = 'Security Center'
        Deprecated    = $true
        PolicyVersion = '2.1.0'
        Mode          = 'All'
    }

    Parameter Effect @{
        AllowedValues = @('AuditIfNotExists', 'Disabled')
        Default       = 'Disabled'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policy'
    }

    Resource 'Microsoft.ContainerRegistry/registries'

    AuditIfNotExists 'Microsoft.Security/assessments' -Name 'dbd0cb49-b563-45e7-9724-889e799fa648' -Effect (Param Effect) {
        Require 'status.code is one of 2 values' {
            Field status.code | Must -BeIn @('NotApplicable', 'Healthy')
        }
    }
}

Source: built-in-policies/policyDefinitions/Security Center/ASC_ContainerRegistryVulnerabilityAssessment_Audit.json in Azure/azure-policy, under the MIT licence.