last sync: 2020-Aug-05 13:05:29 UTC

Azure Policy

[Preview]: Kubernetes cluster containers should only use allowed ProcMountType

Policy DisplayName [Preview]: Kubernetes cluster containers should only use allowed ProcMountType
Policy Id f85eb0dd-92ee-40e9-8a76-db25a507d6d3
Policy Category Kubernetes
Policy Description This policy ensures containers only use allowed ProcMountType in a Kubernetes cluster. For instructions on using this policy, visit https://aka.ms/kubepolicydoc.
Policy Mode Microsoft.Kubernetes.Data
Policy Type BuiltIn
Policy in Preview True
Policy Deprecated FALSE
Policy Effect Default: audit
Allowed: (audit,deny,disabled)
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2020-07-08 14:28:08 add: Policy f85eb0dd-92ee-40e9-8a76-db25a507d6d3
Used in Policy Initiative(s) none
Policy Rule
{
  "properties": {
  "displayName": "[Preview]: Kubernetes cluster containers should only use allowed ProcMountType",
    "policyType": "BuiltIn",
    "mode": "Microsoft.Kubernetes.Data",
    "description": "This policy ensures containers only use allowed ProcMountType in a Kubernetes cluster. For instructions on using this policy, visit https://aka.ms/kubepolicydoc.",
    "metadata": {
      "version": "1.0.0-preview",
      "category": "Kubernetes",
      "preview": true
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
        "displayName": "[Preview]: Effect",
          "description": "'Audit' allows a non-compliant resource to be created or updated, but flags it as non-compliant. 'Deny' blocks the non-compliant resource creation or update. 'Disabled' turns off the policy."
        },
        "allowedValues": [
          "audit",
          "deny",
          "disabled"
        ],
        "defaultValue": "audit"
      },
      "excludedNamespaces": {
        "type": "Array",
        "metadata": {
        "displayName": "[Preview]: Namespace exclusions",
          "description": "List of Kubernetes namespaces to exclude from policy evaluation."
        },
        "defaultValue": [
          "kube-system",
          "gatekeeper-system",
          "azure-arc"
        ]
      },
      "procMountType": {
        "type": "String",
        "metadata": {
        "displayName": "[Preview]: ProcMountType",
          "description": "The ProcMountType that containers are allowed to use in the cluster."
        },
        "allowedValues": [
          "Unmasked",
          "Default"
        ],
        "defaultValue": "Default"
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "in": [
          "AKS Engine",
          "Microsoft.Kubernetes/connectedClusters",
          "Microsoft.ContainerService/managedClusters"
        ]
      },
      "then": {
      "effect": "[parameters('effect')]",
        "details": {
          "constraintTemplate": "https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-references/Kubernetes/allowed-proc-mount-types/template.yaml",
          "constraint": "https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-references/Kubernetes/allowed-proc-mount-types/constraint.yaml",
          "values": {
          "procMount": "[parameters('procMountType')]",
          "excludedNamespaces": "[parameters('excludedNamespaces')]"
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/f85eb0dd-92ee-40e9-8a76-db25a507d6d3",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "f85eb0dd-92ee-40e9-8a76-db25a507d6d3"
}