apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: policy-delete-secret-[TIME]
  namespace: default
  annotations:
    policy.open-cluster-management.io/categories: PR.PT Protective Technology
    policy.open-cluster-management.io/controls: PR.PT-3 Least Functionality
    policy.open-cluster-management.io/standards: NIST-CSF
spec:
  remediationAction: enforce
  disabled: false
  policy-templates:
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: policy-delete-secret-[TIME]
        spec:
          remediationAction: enforce
          severity: low
          namespaceSelector:
            exclude: ["kube-*"]
            include: ["default"]  
        object-templates:
          - complianceType: mustnothave
            objectDefinition:
              kind: Secret
              metadata:
                name: rsa-ca-sample-secret
                namespace: default
                annotations:
                  cert-manager.io/alt-names: wap-master.fyre.test.com
                  cert-manager.io/certificate-name: rsa-ca-sample-cert-[TIME]
                  cert-manager.io/common-name: wap-master.fyre.test.com
                  cert-manager.io/ip-sans: ''
                  cert-manager.io/issuer-kind: Issuer
                  cert-manager.io/issuer-name: ss-sample-issuer-[TIME]
                  cert-manager.io/uri-sans: ''
              type: kubernetes.io/tls
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
  name: binding-policy-delete-secret-[TIME]
  namespace: default
placementRef:
  name: placement-policy-delete-secret-[TIME]
  kind: PlacementRule
  apiGroup: apps.open-cluster-management.io
subjects:
- name: policy-delete-secret-[TIME]
  kind: Policy
  apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
  name: placement-policy-delete-secret-[TIME]
  namespace: default
spec:
  clusterConditions:
  - status: "True"
    type: ManagedClusterConditionAvailable
  clusterSelector:
    matchExpressions:
      []
