last sync: 2020-Jul-10 14:05:01 UTC

Azure Policy

[Preview]: Enforce HTTPS ingress in Kubernetes cluster

Policy DisplayName [Preview]: Enforce HTTPS ingress in Kubernetes cluster
Policy Id 1a5b4dca-0b6f-4cf5-907c-56316bc1bf3d
Policy Category Kubernetes
Policy Description This policy enforces HTTPS ingress 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: deny
Allowed: (audit,deny,disabled)
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2020-04-23 15:06:19 change: DisplayName previous DisplayName: [Preview]: [AKS Engine] Enforce HTTPS ingress in Kubernetes cluster
2019-10-29 23:04:36 add: Policy 1a5b4dca-0b6f-4cf5-907c-56316bc1bf3d
Used in Policy Initiative(s) none
Policy Rule
{
  "properties": {
  "displayName": "[Preview]: Enforce HTTPS ingress in Kubernetes cluster",
    "policyType": "BuiltIn",
    "mode": "Microsoft.Kubernetes.Data",
    "description": "This policy enforces HTTPS ingress in a Kubernetes cluster. For instructions on using this policy, visit https://aka.ms/kubepolicydoc.",
    "metadata": {
      "version": "4.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, but flags it as non-compliant. 'Deny' blocks the resource creation. 'Disable' turns off the policy."
        },
        "allowedValues": [
          "audit",
          "deny",
          "disabled"
        ],
        "defaultValue": "deny"
      },
      "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"
        ]
      }
    },
    "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/ingress-https-only/template.yaml",
          "constraint": "https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-references/Kubernetes/ingress-https-only/constraint.yaml",
          "values": {
          "excludedNamespaces": "[parameters('excludedNamespaces')]"
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/1a5b4dca-0b6f-4cf5-907c-56316bc1bf3d",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "1a5b4dca-0b6f-4cf5-907c-56316bc1bf3d"
}