Policy gates
Vetrix's policy subsystem has two layers:
.vetrix/tooling.ymlpolicy:block — a declarative severity gate authored in the Configure wizard. This page covers it.- Instance-level Rego — operators override defaults across the
whole instance via
/admin/security/policy. That page ships with the OPA backend.
Shape
policy:
merge:
block_on:
- category: secret
verified: true
- category: sca
severity: critical
direct: true
deploy:
require:
- sbom
- image-signed
block_on:
- category: any
severity: critical
baseline: false
Each block_on entry is an AND of its fields. Multiple entries
compose with OR — any match is a block.
Merge gate rules
The merge gate is evaluated when a PR is updated. It receives:
- The set of findings on the PR head commit.
- The set of findings on the target branch at merge-base.
- The baseline file (if any).
- The SBOM for the PR head commit (if emitted).
- The verification attestations attached to the run.
block_on keys:
| Key | Semantics |
|---|---|
category |
secret, sca, sast, iac, standards, any |
severity |
critical, high, medium, low, info — floor, not exact |
verified |
only match findings with properties.verified=true |
direct |
SCA only: only match direct dependencies |
baseline |
false matches only non-baselined; true matches only baselined |
new_only |
match only findings absent from the target branch |
Deploy gate rules
Deploy gate runs when a workflow run attempts to deploy to a protected environment. In addition to the merge-gate keys, it accepts:
| Key | Semantics |
|---|---|
require: sbom |
deploy blocked if no CycloneDX SBOM is attached |
require: image-signed |
deploy blocked if the image has no signature attestation |
Evaluation order
- Instance-default Rego (when OPA backend is wired).
- Per-repo
.vetrix/security.rego(composed with — not replacing — the instance default). .vetrix/tooling.ymlpolicy:block.
A block at any layer stops the gate. The page renders the blocking rule in the PR status so reviewers can resolve it.
Writing clean rules
- Start with
warnenforcement; promote toblockonce the policy is producing the right shape. - Reserve
category: anyfor the deploy path — on merge it over-fires. - Use
baseline: falseto let grandfathered debt through without disabling the gate entirely. - Pair
verified: trueonsecretwithblock— unverified secrets are by definition noisy, and blocking them trains reviewers to ignore the gate.