{
  "id": 20964563,
  "title": "Kyverno CLI and conftest in CI vs Kyverno at admission",
  "url": "https://urgent.news/2026/11/20/kyverno-cli-and-conftest-in-ci-vs-kyverno-at-admission",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-20T23:19:48.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kadet-hub/kyverno-cli-and-conftest-in-ci-vs-kyverno-at-admission-3ag9"
  },
  "original_language": "en",
  "account": "The Kyverno CLI and conftest are both used in CI pipelines to check policies against compiled YAML files generated by Kapitan. The Kyverno CLI checks policy compliance on the compiled objects, while conftest runs Rego rules against those objects. Both tools run on two targets: one compliant and one noncompliant.\n\nThe compliant target specifies a Deployment with a restricted security profile, including using a non-root user, a default seccomp profile, no privilege escalation, and resource requests and limits. This target passes all 18 policy checks and exits with a 0 status code.\n\nThe noncompliant target, however, specifies a Deployment with a non-compliant security profile, including using the latest image tag, no resource requests or limits, and a privileged container. This target fails all 18 policy checks, with each policy providing a failure message. The Kyverno CLI exits with a 1 status code, indicating a failure.",
  "summary": "Kapitan compiles an inventory into plain YAML under compiled/ . The registry's compile diff action shows a reviewer what a pull request changes in that YAML. It does not say whether the change is allowed. A container that runs privileged or an image on the tag latest is one line in the diff, and Kapitan compiles it without an error. Kyverno as an admission controller can reject such an object…",
  "key_points": [
    "Kyverno CLI and conftest used in CI pipelines to check policies",
    "Kyverno CLI checks policy compliance on compiled YAML files",
    "conftest runs Rego rules against objects, noncompliant target fails"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}