Bylaw

Gallery › Nexus › Azure built-in policies

[Preview]: Nexus Compute Cluster Security Baseline

Converted Initiative Version 2.1.0-preview Preview

This initiative includes policies designed to reflect the security baseline expectations of Nexus Compute Clusters. It ensures that the cluster configurations adhere to specific security controls that are critical for maintaining a secure environment.

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

Azure Policy JSONComputeClusterBaseline.json · 804 lines
{
  "properties": {
    "displayName": "[Preview]: Nexus Compute Cluster Security Baseline",
    "policyType": "BuiltIn",
    "description": "This initiative includes policies designed to reflect the security baseline expectations of Nexus Compute Clusters. It ensures that the cluster configurations adhere to specific security controls that are critical for maintaining a secure environment.",
    "metadata": {
      "version": "2.1.0-preview",
      "preview": true,
      "category": "Nexus"
    },
    "version": "2.1.0-preview",
    "parameters": {
      "effect": {
        "type": "string",
        "metadata": {
          "displayName": "Effect",
          "description": "'Audit' allows a non-compliant resource to be created or updated, but flags it as non-compliant. 'Disabled' turns off the policy."
        },
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionReferenceId": "NoNakedPodResources",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/65280eef-c8b4-425e-9aec-af55e55bf581",
        "definitionVersion": "2.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedServicePorts",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/233a2a17-77ca-4fb1-9b6b-69223d272a44",
        "definitionVersion": "8.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "allowedServicePortsList": {
            "value": [
              "1022",
              "10660",
              "10661",
              "10665",
              "111",
              "123",
              "20048",
              "2049",
              "22",
              "3128",
              "32803",
              "3443",
              "4316",
              "4317",
              "4318",
              "4319",
              "4320",
              "443",
              "4954",
              "5001",
              "50051",
              "5050",
              "5473",
              "6060",
              "6385",
              "659",
              "662",
              "6641",
              "6642",
              "6643",
              "80",
              "8080",
              "8081",
              "8089",
              "8443",
              "875",
              "9093",
              "9094",
              "9100",
              "9402",
              "9443",
              "9491"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedHostPath",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/098fc59e-46c7-4d99-9b16-64990e543d75",
        "definitionVersion": "6.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "allowedHostPaths": {
            "value": {
              "paths": [
                {
                  "pathPrefix": "/bin",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/boot",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/dev",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/dev/kmsg",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/cni/net.d",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/hostname",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/iscsi",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/kubernetes",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/kubernetes/admin.conf",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/kubernetes/controller-manager.conf",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/kubernetes/enc",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/kubernetes/pki",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/kubernetes/pki/etcd",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/kubernetes/scheduler.conf",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/kubernetes/super-admin.conf",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/localtime",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/multipath",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/opt/microsoft/mdatp",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/pki",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/rsyslog.d",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/ssl/certs",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/etc/systemd/system",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/telemetry",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/home",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/lib/modules",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/lib/systemd/system",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/lib/x86_64-linux-gnu",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/opt/cni/bin",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/opt/local-path-provisioner",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/proc",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/run/containerd/containerd.sock",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/run/dbus",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/run/log/journal",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/run/rte",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/run/systemd",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/run/undercloud-volume.csi.azure.com",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/run/xtables.lock",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/sbin",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/sys",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/tmp",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/usr/lib/systemd/system",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/usr/libexec/kubernetes/kubelet-plugins/volume/exec",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/calico",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/docker/containers",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/etcd",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/etcd-snapshots",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/kubelet",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/kubevirt",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/kubevirt-node-labeller",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/lib/otelcol",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/log",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/opt/microsoft",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/log/microsoft/mdatp",
                  "readOnly": true
                },
                {
                  "pathPrefix": "/var/microsoft/microsoft-defender-for-cloud",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/var/run",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/origin/openvswitch",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/origin/ovn",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/run/openvswitch",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/run/ovn",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/etc/containerd/certs.d",
                  "readOnly": false
                },
                {
                  "pathPrefix": "/opt/local-path-provisioner",
                  "readOnly": false
                }
              ]
            }
          },
          "excludedContainers": {
            "value": [
              "action-command-container",
              "bmmkeyset-agent",
              "busybox",
              "csi-node-exporter",
              "host-sync",
              "identity-enforcer",
              "mdatp-sync",
              "mount-leak-detector",
              "nc-toolbox-deploy",
              "networkcloud-collector",
              "node",
              "node-exporter"
            ]
          },
          "excludedImages": {
            "value": [
              "mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedContainerImages",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/febd0533-8e55-448f-b837-bd0e06f16469",
        "definitionVersion": "9.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "allowedContainerImagesRegex": {
            "value": "^(mcr\\.microsoft\\.com|nfaprodglobalacr\\.azurecr\\.io|nfaimagespublic\\.azurecr\\.io|local\\-vm\\-image\\-registry\\.nc\\-system\\.svc\\.networkcloud\\.local(:[0-9]+)?)\\/.+$"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedHostNetworking",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/82985f06-dc18-4a48-bc1c-b9f4f0098cfe",
        "definitionVersion": "7.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "allowHostNetwork": {
            "value": true
          },
          "allowedHostPorts": {
            "value": [
              "13133",
              "20257",
              "29603",
              "29652",
              "29653",
              "5140",
              "5473",
              "8089",
              "9100",
              "9101",
              "9109",
              "9203",
              "9204",
              "9256",
              "9963",
              "9964"
            ]
          },
          "excludedImages": {
            "value": [
              "mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "ReadOnlyRootFileSystem",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/df49d893-a74c-421d-bc95-c663042e5b80",
        "definitionVersion": "6.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "excludedContainers": {
            "value": [
              "action-command-container",
              "addons",
              "azlocal-dispatcher",
              "azlocal-vmo",
              "busybox",
              "ca-distributor",
              "cache-builder",
              "calico-apiserver",
              "calico-csi",
              "calico-kube-controllers",
              "calico-node",
              "calico-typha",
              "cdi-apiserver",
              "cdi-controller",
              "cdi-deployment",
              "cdi-operator",
              "cdi-uploadproxy",
              "chronyd",
              "cleaner",
              "clusterctl-init-move",
              "clusterctl-init-upgrade",
              "cni-server",
              "compute",
              "container-disk-binary",
              "csi-node-driver-registrar",
              "csi-resizer",
              "csn-dns",
              "csn-keepalived",
              "csn-ntp",
              "csn-ntp-init",
              "csn-route-add",
              "db-seed",
              "deployer",
              "distributor",
              "dnsmasq",
              "docker-cri-client",
              "etcd-snapshotter",
              "etcd-snapshotter-cleaner",
              "etcd-snapshotter-distribution",
              "flexvol-driver",
              "fluentd",
              "get-node-role",
              "guest-console-log",
              "helper-pod",
              "hook-sidecar-0",
              "hostpath-init",
              "host-image",
              "hotplug-disk",
              "identity-enforcer",
              "imagepuller",
              "importer",
              "init",
              "init-bootstrap",
              "install-cni",
              "ironic-api",
              "ironic-conductor",
              "ironic-inspector",
              "ironic-inspector-proxy",
              "ironic-mariadb",
              "ironic-monitor",
              "ironic-static",
              "kube-fledged",
              "kube-ovn-controller",
              "kube-ovn-monitor",
              "kube-rbac-proxy",
              "kubectl",
              "manager",
              "mdm",
              "mdsd",
              "microsoft-defender-pod-collector",
              "microsoft-defender-publisher",
              "migrate-sts",
              "mise-sidecar",
              "msi-adapter",
              "nc-kube-events",
              "nc-toolbox-deploy",
              "nfs",
              "nfs-server",
              "nginx",
              "old-file-cleaner",
              "openvswitch",
              "otel-collector",
              "otel-pipeline",
              "ovn-central",
              "pinger",
              "pod-collector",
              "proxy",
              "publisher",
              "resource-topology-exporter-container",
              "rp-filter",
              "sa-alerts-exporter",
              "sa-metrics-exporter",
              "scheduler-plugins-controller",
              "scheduler-plugins-scheduler",
              "server",
              "shared-pool-container",
              "syslog",
              "telegraf",
              "tigera-operator",
              "toolbox",
              "uc-volume-controller",
              "virt-api",
              "virt-controller",
              "virt-handler",
              "virt-launcher",
              "virt-launcher-image-holder",
              "virt-operator",
              "volumevmc-iso",
              "volumevmc-iso-init",
              "volume-migrator",
              "wait",
              "wait-for-certificates",
              "watcher",
              "workload-cluster-versionbundles",
              "xfs-repair"
            ]
          },
          "excludedImages": {
            "value": [
              "mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*",
              "mcr.microsoft.com/networkcloud/nc-platform-operator/aksipam-web:*"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedContainerCapabilities",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/c26596ff-4d70-4e6a-9a30-c2506bd2f80c",
        "definitionVersion": "6.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "allowedCapabilities": {
            "value": [
              "AUDIT_WRITE",
              "CHOWN",
              "DAC_OVERRIDE",
              "DAC_READ_SEARCH",
              "FOWNER",
              "FSETID",
              "KILL",
              "MAC_ADMIN",
              "MKNOD",
              "NET_ADMIN",
              "NET_BIND_SERVICE",
              "NET_RAW",
              "SETFCAP",
              "SETGID",
              "SETPCAP",
              "SETUID",
              "SYS_CHROOT",
              "SYS_NICE"
            ]
          },
          "excludedContainers": {
            "value": [
              "controller",
              "cni-server",
              "csi-node-exporter",
              "csn-ntp",
              "dnsmasq",
              "etcd-snapshotter",
              "etcd-snapshotter-cleaner",
              "etcd-snapshotter-distribution",
              "low-level-collector",
              "mount-leak-detector",
              "nfs",
              "nfs-server",
              "nginx",
              "node",
              "node-driver-registrar",
              "openvswitch",
              "otel-pipeline"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "NoDefaultNamespace",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9f061a12-e40d-4183-a00e-171812443373",
        "definitionVersion": "4.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "NoPrivilegedContainers",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/95edb821-ddaf-4404-9732-666045e056b4",
        "definitionVersion": "9.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "excludedContainers": {
            "value": [
              "action-command-container",
              "arc-for-servers-connect-agent",
              "arc-for-servers-connect-agent-init",
              "azlocal-vmo",
              "busybox",
              "ca-distributor",
              "calico-apiserver",
              "calico-csi",
              "calico-node",
              "chronyd",
              "controller",
              "csi-node-driver-registrar",
              "custom-statistics-exporter",
              "custom-statistics-exporter-rs",
              "dnsmasq",
              "etcd-snapshotter",
              "etcd-snapshotter-cleaner",
              "etcd-snapshotter-distribution",
              "flexvol-driver",
              "host-sync",
              "hostpath-init",
              "identity-enforcer",
              "idrac-exporter",
              "install-cni",
              "ironic-static",
              "kube-ovn-tolerations-webhook",
              "mdatp-sync",
              "nc-toolbox-deploy",
              "nfs",
              "nfs-server",
              "nginx",
              "node",
              "node-driver-registrar",
              "node-problem-detector",
              "nodedata-exporter",
              "proxy",
              "rp-filter",
              "syslog",
              "toolbox",
              "virt-handler",
              "virt-launcher",
              "volume-migrator",
              "vulnerability-operator-health-check",
              "vulnerability-server",
              "xfs-repair"
            ]
          },
          "excludedImages": {
            "value": [
              "mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*",
              "mcr.microsoft.com/oss/v2/aquasecurity/trivy:*"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedImagePullPolicies",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/50c83470-d2f0-4dda-a716-1938a4825f62",
        "definitionVersion": "3.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "excludedImages": {
            "value": [
              "mcr.microsoft.com/azurelinux/base/cluster-api-provider-kubevirt:*",
              "mcr.microsoft.com/networkcloud/cluster-api-provider-kubevirt/cluster-api-provider-kubevirt:*",
              "mcr.microsoft.com/networkcloud/nc-common-charts/credactor:*"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "NoPrivilegeEscalation",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1c6e92c9-99f0-4e55-9cf2-0c234dc48f99",
        "definitionVersion": "8.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "excludedContainers": {
            "value": [
              "apply",
              "calico-csi",
              "calico-node",
              "chronyd",
              "controller",
              "credactor",
              "csi-node-driver-registrar",
              "dnsmasq",
              "etcd-snapshotter",
              "etcd-snapshotter-cleaner",
              "etcd-snapshotter-distribution",
              "flexvol-driver",
              "hostpath-init",
              "install-cni",
              "kube-ovn-controller",
              "kube-ovn-monitor",
              "migrate-sts",
              "mise-sidecar",
              "nfs",
              "nfs-server",
              "node",
              "node-exporter",
              "openvswitch",
              "otel-collector",
              "otel-pipeline",
              "ovn-central",
              "pinger",
              "process-exporter",
              "proxy",
              "pure-storage-exporter",
              "reloader",
              "sa-alerts-exporter",
              "sa-metrics-exporter",
              "scaleup",
              "syslog",
              "toolbox",
              "vulnerability-server"
            ]
          },
          "excludedImages": {
            "value": [
              "mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "AuthorizedVolumeTypes",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/16697877-1118-4fb1-9b65-9898ec2509ec",
        "definitionVersion": "5.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          },
          "allowedVolumeTypes": {
            "value": [
              "configMap",
              "downwardAPI",
              "emptyDir",
              "hostPath",
              "persistentVolumeClaim",
              "projected",
              "secret"
            ]
          }
        }
      },
      {
        "policyDefinitionReferenceId": "NoExternalIPs",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/d46c275d-1680-448d-b2ec-e495a3b6cc89",
        "definitionVersion": "5.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('effect')]"
          }
        }
      }
    ],
    "versions": [
      "2.1.0-PREVIEW",
      "2.0.0-PREVIEW",
      "1.3.0-PREVIEW",
      "1.2.0-PREVIEW",
      "1.1.0-PREVIEW",
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/336cb876-5cb8-4795-b9d1-bd9323d3487e",
  "name": "336cb876-5cb8-4795-b9d1-bd9323d3487e"
}
Bylaw336cb876-5cb8-4795-b9d1-bd9323d3487e.bylaw.ps1 · 150 lines
# Converted from ComputeClusterBaseline.json by ConvertTo-Bylaw.
Initiative '336cb876-5cb8-4795-b9d1-bd9323d3487e' {

    Properties @{
        DisplayName   = '[Preview]: Nexus Compute Cluster Security Baseline'
        Description   = 'This initiative includes policies designed to reflect the security baseline expectations of Nexus Compute Clusters. It ensures that the cluster configurations adhere to specific security controls that are critical for maintaining a secure environment.'
        Version       = '2.1.0-preview'
        Preview       = $true
        Category      = 'Nexus'
        PolicyVersion = '2.1.0-preview'
    }

    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('Audit', 'Disabled')
        Default       = 'Audit'
        DisplayName   = 'Effect'
        Description   = '''Audit'' allows a non-compliant resource to be created or updated, but flags it as non-compliant. ''Disabled'' turns off the policy.'
    }

    PolicyDefinition @{
        Id          = '65280eef-c8b4-425e-9aec-af55e55bf581'
        ReferenceId = 'NoNakedPodResources'
        Version     = '2.*.*'
        Parameters  = @{
            effect = (Param Effect)
        }
    }

    PolicyDefinition @{
        Id          = '233a2a17-77ca-4fb1-9b6b-69223d272a44'
        ReferenceId = 'AuthorizedServicePorts'
        Version     = '8.*.*'
        Parameters  = [ordered]@{
            effect                  = (Param Effect)
            allowedServicePortsList = @('1022', '10660', '10661', '10665', '111', '123', '20048', '2049', '22', '3128', '32803', '3443', '4316', '4317', '4318', '4319', '4320', '443', '4954', '5001', '50051', '5050', '5473', '6060', '6385', '659', '662', '6641', '6642', '6643', '80', '8080', '8081', '8089', '8443', '875', '9093', '9094', '9100', '9402', '9443', '9491')
        }
    }

    PolicyDefinition @{
        Id          = '098fc59e-46c7-4d99-9b16-64990e543d75'
        ReferenceId = 'AuthorizedHostPath'
        Version     = '6.*.*'
        Parameters  = [ordered]@{
            effect             = (Param Effect)
            allowedHostPaths   = [ordered]@{ paths = @([ordered]@{ pathPrefix = '/bin'; readOnly = $true }, [ordered]@{ pathPrefix = '/boot'; readOnly = $true }, [ordered]@{ pathPrefix = '/dev'; readOnly = $false }, [ordered]@{ pathPrefix = '/dev/kmsg'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/cni/net.d'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/hostname'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/iscsi'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/kubernetes'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/kubernetes/admin.conf'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/kubernetes/controller-manager.conf'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/kubernetes/enc'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/kubernetes/pki'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/kubernetes/pki/etcd'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/kubernetes/scheduler.conf'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/kubernetes/super-admin.conf'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/localtime'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/multipath'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/opt/microsoft/mdatp'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/pki'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/rsyslog.d'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/ssl/certs'; readOnly = $true }, [ordered]@{ pathPrefix = '/etc/systemd/system'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/telemetry'; readOnly = $false }, [ordered]@{ pathPrefix = '/home'; readOnly = $false }, [ordered]@{ pathPrefix = '/lib/modules'; readOnly = $true }, [ordered]@{ pathPrefix = '/lib/systemd/system'; readOnly = $true }, [ordered]@{ pathPrefix = '/lib/x86_64-linux-gnu'; readOnly = $true }, [ordered]@{ pathPrefix = '/opt/cni/bin'; readOnly = $false }, [ordered]@{ pathPrefix = '/opt/local-path-provisioner'; readOnly = $false }, [ordered]@{ pathPrefix = '/proc'; readOnly = $true }, [ordered]@{ pathPrefix = '/run/containerd/containerd.sock'; readOnly = $false }, [ordered]@{ pathPrefix = '/run/dbus'; readOnly = $true }, [ordered]@{ pathPrefix = '/run/log/journal'; readOnly = $true }, [ordered]@{ pathPrefix = '/run/rte'; readOnly = $false }, [ordered]@{ pathPrefix = '/run/systemd'; readOnly = $false }, [ordered]@{ pathPrefix = '/run/undercloud-volume.csi.azure.com'; readOnly = $false }, [ordered]@{ pathPrefix = '/run/xtables.lock'; readOnly = $false }, [ordered]@{ pathPrefix = '/sbin'; readOnly = $true }, [ordered]@{ pathPrefix = '/sys'; readOnly = $true }, [ordered]@{ pathPrefix = '/tmp'; readOnly = $false }, [ordered]@{ pathPrefix = '/usr/lib/systemd/system'; readOnly = $true }, [ordered]@{ pathPrefix = '/usr/libexec/kubernetes/kubelet-plugins/volume/exec'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/calico'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/docker/containers'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/etcd'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/etcd-snapshots'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/kubelet'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/kubevirt'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/kubevirt-node-labeller'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/lib/otelcol'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/log'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/opt/microsoft'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/log/microsoft/mdatp'; readOnly = $true }, [ordered]@{ pathPrefix = '/var/microsoft/microsoft-defender-for-cloud'; readOnly = $false }, [ordered]@{ pathPrefix = '/var/run'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/origin/openvswitch'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/origin/ovn'; readOnly = $false }, [ordered]@{ pathPrefix = '/run/openvswitch'; readOnly = $false }, [ordered]@{ pathPrefix = '/run/ovn'; readOnly = $false }, [ordered]@{ pathPrefix = '/etc/containerd/certs.d'; readOnly = $false }, [ordered]@{ pathPrefix = '/opt/local-path-provisioner'; readOnly = $false }) }
            excludedContainers = @('action-command-container', 'bmmkeyset-agent', 'busybox', 'csi-node-exporter', 'host-sync', 'identity-enforcer', 'mdatp-sync', 'mount-leak-detector', 'nc-toolbox-deploy', 'networkcloud-collector', 'node', 'node-exporter')
            excludedImages     = @('mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*')
        }
    }

    PolicyDefinition @{
        Id          = 'febd0533-8e55-448f-b837-bd0e06f16469'
        ReferenceId = 'AuthorizedContainerImages'
        Version     = '9.*.*'
        Parameters  = [ordered]@{
            effect                      = (Param Effect)
            allowedContainerImagesRegex = '^(mcr\.microsoft\.com|nfaprodglobalacr\.azurecr\.io|nfaimagespublic\.azurecr\.io|local\-vm\-image\-registry\.nc\-system\.svc\.networkcloud\.local(:[0-9]+)?)\/.+$'
        }
    }

    PolicyDefinition @{
        Id          = '82985f06-dc18-4a48-bc1c-b9f4f0098cfe'
        ReferenceId = 'AuthorizedHostNetworking'
        Version     = '7.*.*'
        Parameters  = [ordered]@{
            effect           = (Param Effect)
            allowHostNetwork = $true
            allowedHostPorts = @('13133', '20257', '29603', '29652', '29653', '5140', '5473', '8089', '9100', '9101', '9109', '9203', '9204', '9256', '9963', '9964')
            excludedImages   = @('mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*')
        }
    }

    PolicyDefinition @{
        Id          = 'df49d893-a74c-421d-bc95-c663042e5b80'
        ReferenceId = 'ReadOnlyRootFileSystem'
        Version     = '6.*.*'
        Parameters  = [ordered]@{
            effect             = (Param Effect)
            excludedContainers = @('action-command-container', 'addons', 'azlocal-dispatcher', 'azlocal-vmo', 'busybox', 'ca-distributor', 'cache-builder', 'calico-apiserver', 'calico-csi', 'calico-kube-controllers', 'calico-node', 'calico-typha', 'cdi-apiserver', 'cdi-controller', 'cdi-deployment', 'cdi-operator', 'cdi-uploadproxy', 'chronyd', 'cleaner', 'clusterctl-init-move', 'clusterctl-init-upgrade', 'cni-server', 'compute', 'container-disk-binary', 'csi-node-driver-registrar', 'csi-resizer', 'csn-dns', 'csn-keepalived', 'csn-ntp', 'csn-ntp-init', 'csn-route-add', 'db-seed', 'deployer', 'distributor', 'dnsmasq', 'docker-cri-client', 'etcd-snapshotter', 'etcd-snapshotter-cleaner', 'etcd-snapshotter-distribution', 'flexvol-driver', 'fluentd', 'get-node-role', 'guest-console-log', 'helper-pod', 'hook-sidecar-0', 'hostpath-init', 'host-image', 'hotplug-disk', 'identity-enforcer', 'imagepuller', 'importer', 'init', 'init-bootstrap', 'install-cni', 'ironic-api', 'ironic-conductor', 'ironic-inspector', 'ironic-inspector-proxy', 'ironic-mariadb', 'ironic-monitor', 'ironic-static', 'kube-fledged', 'kube-ovn-controller', 'kube-ovn-monitor', 'kube-rbac-proxy', 'kubectl', 'manager', 'mdm', 'mdsd', 'microsoft-defender-pod-collector', 'microsoft-defender-publisher', 'migrate-sts', 'mise-sidecar', 'msi-adapter', 'nc-kube-events', 'nc-toolbox-deploy', 'nfs', 'nfs-server', 'nginx', 'old-file-cleaner', 'openvswitch', 'otel-collector', 'otel-pipeline', 'ovn-central', 'pinger', 'pod-collector', 'proxy', 'publisher', 'resource-topology-exporter-container', 'rp-filter', 'sa-alerts-exporter', 'sa-metrics-exporter', 'scheduler-plugins-controller', 'scheduler-plugins-scheduler', 'server', 'shared-pool-container', 'syslog', 'telegraf', 'tigera-operator', 'toolbox', 'uc-volume-controller', 'virt-api', 'virt-controller', 'virt-handler', 'virt-launcher', 'virt-launcher-image-holder', 'virt-operator', 'volumevmc-iso', 'volumevmc-iso-init', 'volume-migrator', 'wait', 'wait-for-certificates', 'watcher', 'workload-cluster-versionbundles', 'xfs-repair')
            excludedImages     = @('mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*', 'mcr.microsoft.com/networkcloud/nc-platform-operator/aksipam-web:*')
        }
    }

    PolicyDefinition @{
        Id          = 'c26596ff-4d70-4e6a-9a30-c2506bd2f80c'
        ReferenceId = 'AuthorizedContainerCapabilities'
        Version     = '6.*.*'
        Parameters  = [ordered]@{
            effect              = (Param Effect)
            allowedCapabilities = @('AUDIT_WRITE', 'CHOWN', 'DAC_OVERRIDE', 'DAC_READ_SEARCH', 'FOWNER', 'FSETID', 'KILL', 'MAC_ADMIN', 'MKNOD', 'NET_ADMIN', 'NET_BIND_SERVICE', 'NET_RAW', 'SETFCAP', 'SETGID', 'SETPCAP', 'SETUID', 'SYS_CHROOT', 'SYS_NICE')
            excludedContainers  = @('controller', 'cni-server', 'csi-node-exporter', 'csn-ntp', 'dnsmasq', 'etcd-snapshotter', 'etcd-snapshotter-cleaner', 'etcd-snapshotter-distribution', 'low-level-collector', 'mount-leak-detector', 'nfs', 'nfs-server', 'nginx', 'node', 'node-driver-registrar', 'openvswitch', 'otel-pipeline')
        }
    }

    PolicyDefinition @{
        Id          = '9f061a12-e40d-4183-a00e-171812443373'
        ReferenceId = 'NoDefaultNamespace'
        Version     = '4.*.*'
        Parameters  = @{
            effect = (Param Effect)
        }
    }

    PolicyDefinition @{
        Id          = '95edb821-ddaf-4404-9732-666045e056b4'
        ReferenceId = 'NoPrivilegedContainers'
        Version     = '9.*.*'
        Parameters  = [ordered]@{
            effect             = (Param Effect)
            excludedContainers = @('action-command-container', 'arc-for-servers-connect-agent', 'arc-for-servers-connect-agent-init', 'azlocal-vmo', 'busybox', 'ca-distributor', 'calico-apiserver', 'calico-csi', 'calico-node', 'chronyd', 'controller', 'csi-node-driver-registrar', 'custom-statistics-exporter', 'custom-statistics-exporter-rs', 'dnsmasq', 'etcd-snapshotter', 'etcd-snapshotter-cleaner', 'etcd-snapshotter-distribution', 'flexvol-driver', 'host-sync', 'hostpath-init', 'identity-enforcer', 'idrac-exporter', 'install-cni', 'ironic-static', 'kube-ovn-tolerations-webhook', 'mdatp-sync', 'nc-toolbox-deploy', 'nfs', 'nfs-server', 'nginx', 'node', 'node-driver-registrar', 'node-problem-detector', 'nodedata-exporter', 'proxy', 'rp-filter', 'syslog', 'toolbox', 'virt-handler', 'virt-launcher', 'volume-migrator', 'vulnerability-operator-health-check', 'vulnerability-server', 'xfs-repair')
            excludedImages     = @('mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*', 'mcr.microsoft.com/oss/v2/aquasecurity/trivy:*')
        }
    }

    PolicyDefinition @{
        Id          = '50c83470-d2f0-4dda-a716-1938a4825f62'
        ReferenceId = 'AuthorizedImagePullPolicies'
        Version     = '3.*.*'
        Parameters  = [ordered]@{
            effect         = (Param Effect)
            excludedImages = @('mcr.microsoft.com/azurelinux/base/cluster-api-provider-kubevirt:*', 'mcr.microsoft.com/networkcloud/cluster-api-provider-kubevirt/cluster-api-provider-kubevirt:*', 'mcr.microsoft.com/networkcloud/nc-common-charts/credactor:*')
        }
    }

    PolicyDefinition @{
        Id          = '1c6e92c9-99f0-4e55-9cf2-0c234dc48f99'
        ReferenceId = 'NoPrivilegeEscalation'
        Version     = '8.*.*'
        Parameters  = [ordered]@{
            effect             = (Param Effect)
            excludedContainers = @('apply', 'calico-csi', 'calico-node', 'chronyd', 'controller', 'credactor', 'csi-node-driver-registrar', 'dnsmasq', 'etcd-snapshotter', 'etcd-snapshotter-cleaner', 'etcd-snapshotter-distribution', 'flexvol-driver', 'hostpath-init', 'install-cni', 'kube-ovn-controller', 'kube-ovn-monitor', 'migrate-sts', 'mise-sidecar', 'nfs', 'nfs-server', 'node', 'node-exporter', 'openvswitch', 'otel-collector', 'otel-pipeline', 'ovn-central', 'pinger', 'process-exporter', 'proxy', 'pure-storage-exporter', 'reloader', 'sa-alerts-exporter', 'sa-metrics-exporter', 'scaleup', 'syslog', 'toolbox', 'vulnerability-server')
            excludedImages     = @('mcr.microsoft.com/networkcloud/nc-platform-operator/afo-action-command:*')
        }
    }

    PolicyDefinition @{
        Id          = '16697877-1118-4fb1-9b65-9898ec2509ec'
        ReferenceId = 'AuthorizedVolumeTypes'
        Version     = '5.*.*'
        Parameters  = [ordered]@{
            effect             = (Param Effect)
            allowedVolumeTypes = @('configMap', 'downwardAPI', 'emptyDir', 'hostPath', 'persistentVolumeClaim', 'projected', 'secret')
        }
    }

    PolicyDefinition -Id 'd46c275d-1680-448d-b2ec-e495a3b6cc89' -ReferenceId 'NoExternalIPs' -Version '5.*.*' -Parameters @{
        effect = (Param Effect)
    }
}

Members (13)

Source: built-in-policies/policySetDefinitions/Nexus/ComputeClusterBaseline.json in Azure/azure-policy, under the MIT licence.