Set a policy rule to prevent secrets in Containers.

Procedure

  1. On the left navigation pane, click Enforce > K8s Policies.
  2. Click the Hardening Policies tab.
  3. Select or create a policy to which to add the secret prevention rule.
    To edit an existing policy, see Edit a Kubernetes Hardening Policy. To create a new policy, see Create a Kubernetes Hardening Policy.
  4. On the Available rules page, scroll down to the Secret found rule in the Container Images category. This rule prevents the deployment of images that have secrets. Select Alert or Block and click the arrow Arrow (>) icon icon at the right of the rule.
    The rule is added to the policy.
  5. Click Next.
    Newly added Secret found rule in policy
  6. Click Next.
  7. If you are creating a new policy, click Enable Policy or Save as Draft. If you are editing an existing policy, click Save.