last sync: 2020-Oct-23 19:29:54 UTC

Azure Policy

[Preview]: Secrets should have content type set

Name [Preview]: Secrets should have content type set
Id 75262d3e-ba4a-4f43-85f8-9f72c090e5e3
Version 1.0.0-preview
details on versioning
Category Key Vault
Description A content type tag helps identify whether a secret is a password, connection string, etc. Different secrets have different rotation requirements. Content type tag should be set on secrets.
Mode Microsoft.KeyVault.Data
Type BuiltIn
Preview True
Deprecated FALSE
Effect Default: Audit
Allowed: (Audit,Deny,Disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2020-10-16 12:27:50 add 75262d3e-ba4a-4f43-85f8-9f72c090e5e3
Used in Initiatives none
Json
{
  "properties": {
  "displayName": "[Preview]: Secrets should have content type set",
    "policyType": "BuiltIn",
    "mode": "Microsoft.KeyVault.Data",
    "description": "A content type tag helps identify whether a secret is a password, connection string, etc. Different secrets have different rotation requirements. Content type tag should be set on secrets.",
    "metadata": {
      "version": "1.0.0-preview",
      "category": "Key Vault",
      "preview": true
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "'Audit' allows a non-compliant resource to be created, but flags it as non-compliant. 'Deny' blocks the resource creation. 'Disable' turns off the policy."
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.KeyVault.Data/vaults/secrets"
          },
          {
            "field": "Microsoft.KeyVault.Data/vaults/secrets/contentType",
            "exists": false
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/75262d3e-ba4a-4f43-85f8-9f72c090e5e3",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "75262d3e-ba4a-4f43-85f8-9f72c090e5e3"
}