apiVersion: policy.open-cluster-management.io/v1 kind: Policy metadata: name: policy-networkpolicy-allow-3306-mariadb namespace: rhacm-policies annotations: policy.open-cluster-management.io/standards: NIST SP 800-53 policy.open-cluster-management.io/categories: SC System and Communications Protection policy.open-cluster-management.io/controls: SC-7 Boundary Protection spec: remediationAction: enforce disabled: false policy-templates: - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: policy-networkpolicy-allow-3306--mariadb spec: remediationAction: enforce # the policy-template spec.remediationAction is overridden by the preceding parameter value for spec.remediationAction. severity: medium namespaceSelector: include: ["mariadb"] object-templates: - complianceType: musthave objectDefinition: kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: allow-3306 spec: podSelector: matchLabels: app: mariadb ingress: - from: - namespaceSelector: matchLabels: project: client - ports: - protocol: TCP port: 3306 --- apiVersion: policy.open-cluster-management.io/v1 kind: PlacementBinding metadata: name: binding-policy-networkpolicy-allow-3306-mariadb namespace: rhacm-policies placementRef: name: dev-clusters kind: PlacementRule apiGroup: apps.open-cluster-management.io subjects: - name: policy-networkpolicy-allow-3306-mariadb kind: Policy apiGroup: policy.open-cluster-management.io