Create a policy safely#

  1. Open Policies and create a named policy.
  2. Choose its scope and the matching scope identifier when required. The code supports platform, organization, workspace, environment and project scopes.
  3. Choose enforcement and a rule type. The form supports structured rules or signed Rego bundles.
  4. Enter a JSON object for the rule. An array, plain string or invalid JSON is rejected.
  5. Leave a new rule inactive while testing. Select an existing run in the simulation controls and inspect the candidate result.
  6. Activate only after the simulated behavior matches the intended requirement.
Define scope, enforcement and the rule, then select retained evidence for simulation before saving a candidate policy.
Define scope, enforcement and the rule, then select retained evidence for simulation before saving a candidate policy. View full size ↗

Enforcement and scope#

ChoiceMeaning
denyA matching blocking decision prevents progression. Resolve the cause rather than expecting an approval to override every denial.
approvalRequires the policy’s approval conditions before progression.
auditRecords policy evidence without treating this rule as an unconditional block.

Policy simulation evaluates a candidate against selected run evidence. It is not a new live cluster deployment and does not prove every future source revision will produce the same decision.

Example structured rule#

This example requires digest-pinned images, disallows pruning and asks for an independent, strongly authenticated approval. Use it as an inactive candidate first and simulate it against your intended run.

{
  "requireImageDigest": true,
  "allowPrune": false,
  "requireApproval": true,
  "minimumApprovals": 1,
  "prohibitSelfApproval": true,
  "prohibitCommitterApproval": true,
  "requireMfa": true,
  "requireReauthentication": true
}

The rule schema also supports allowed/denied target IDs, namespaces, kinds and image registries, ownership/adoption restrictions, pruning limits, approval expiry and required approver groups. A rule’s content and its enforcement/scope must be reviewed together.

Signed Rego bundles#

Signed bundles require the configured trusted signing keys and supported bundle contract. An untrusted or invalid bundle must be corrected by its owner; do not disable signature verification to make it load. If no trusted keys are configured, use the supported built-in/structured mechanisms rather than claiming Rego is enabled.

Change management#

Policy updates can invalidate earlier evidence or approval eligibility. After changing a policy, inspect newly evaluated runs. Keep the rule’s scope narrow enough that a project-specific requirement does not accidentally block unrelated projects.