# an available choice for the specs control
name:
  NetworkPolicy
description:
  deny network request
multiselect:
  specs
replacements: # if user select this choice, the template variable names and values to use
  standards: |
    NIST-CSF
  categories: |
    PR.AC Identity Management and Access Control
  controls: |
    PR.AC-5 Network Integrity
  policyTemplates: |
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: {{name}}-deny-from-other-namespaces
        spec:
          remediationAction: inform # will be overridden by remediationAction in parent policy
          severity: high
          namespaceSelector:
            exclude: ["kube-*"]
            include: ["default"]
          object-templates:
            - complianceType: musthave
              objectDefinition:
                kind: NetworkPolicy # deny network request
                apiVersion: networking.k8s.io/v1
                metadata:
                  name: deny-from-other-namespaces
                spec:
                  podSelector:
                    matchLabels:
                  ingress:
                  - from:
                    - podSelector: {} # accept ingress from all pods within this namespace only