Repository navigation
Closed
Labels
epic:ci-hardeningHardened images, scans, compliance evidence, and the gaps a regulated CI team needs closed
Description
Every release should be scanned for vulnerabilities before anything reaches a registry, under the supply-chain group, in the pipeline chant release workflow renders, with nothing for a team to wire by hand. This applies to any chant project's release, not only the CI products.
What exists, checked at chant 3bf0df0
vuln-gate(components/verbs/vuln-gate.ts, scanners invuln-scan.ts) scans an SBOM with grype or trivy, applies VEX, and can fail on KEV and EPSS. It runs as a component step only.chant release publishstages every target, runsrelease.verify, and then reveals (publishing: resume after a failure without republishing, and all-or-nothing visibility #4048, release: pre-reveal verify step #5157). The stage, verify and reveal live inlifecycle/publish-*.ts, and nothing there scans.- The stage is not private. For an
ocitarget it pushes the layers and manifest by digest to the consumer's registry, and signing pushes the cosign and SLSA referrers during the stage (publish-oci.tsheader,publish-signing.ts). Only tags wait for the reveal. A check after the stage leaves a signed image in the registry, pullable by digest, and there is no unstage. - An
ocitarget takes any archive (publish-declaration.ts), not only onerelease.imagesbuilt. - Image builds run with
--sbom=false(release-images.ts,releaseImageBuildCommand). The SBOM a release attaches is written from the lockfile (publish-attachments.ts), so an image's SBOM lists no OS packages. A syft image backend exists (tool-sbom-generator.ts). TOOL_PINS(tool-pins.ts) holds cosign, goreleaser and nfpm, which the rendered pipeline installs by checksum. It holds no scanner.- A team can call a scanner from
release.verifywith$CHANT_STAGED_IMAGES, but that runs after the stage, every project writes it by hand, and the result goes into no record.
What it should be
release.scan, on by default undersupply-chain, runs before the stage and before signing.- For each
ocitarget, and each helm target'soci, it scans the local OCI archive, whichchant release imageshas already digest-checked. The scan uses an SBOM made from the image layers with the syft backend, not the lockfile SBOM. - That layer SBOM becomes the SBOM the image is published with, as its referrer, in place of the lockfile one.
- Every other SBOM the publish attaches (npm packages, forge assets, goreleaser and nfpm artifacts) is scanned by the same gate.
- The gate is the same one components use:
failOnseverity,failOnKev, EPSS thresholds and a VEX file. A failure stops the publish withpublish-scan-failedbefore anything is pushed. - The findings and the scanner's database version are appended to
_releases/publishes.jsonl, and attached as a referrer beside the SBOM, so a reader of the release can see what was known when it shipped. - The scanner and syft get
TOOL_PINSrows. A release-steps feature installs them in the rendered pipeline whensupply-chainis on and the release has anything to scan, the waycosignSetupinstalls cosign, on GitHub, GitLab and Forgejo. chant release doctorreports a missing scanner on a workstation before a cut.- The scanner's database download needs network.
network-egress.mdxgets a row, and an offline database path is allowed.
This is the scan FedRAMP's container guidance asks of images before they reach a registry consumers pull from (RA-5), and it matters more once images can change base (#5445). Other scanners plug in through the gate's scanner interface; the Wiz adapter (wizcli docker scan) is built in #5451, and this issue ships grype or trivy.
Today nothing in release-init.ts sets a security group, so a new release starts with none of this; see the decision below.
Done when
- A release with an image that has a known critical CVE stops at the scan, and nothing is pushed: no layers, manifest or referrer.
- The same holds for an npm package with a critical CVE in its lockfile.
- The rendered pipeline on all three forges installs the pinned scanner with no
release.workflowentry. - The published image's SBOM lists its OS packages.
- The record and the referrer hold the findings.
SECURITY_FEATURES(workspace/security.ts) has a row, which the security features reference is tested against.- The same holds for a train's release workflow (
release-train-workflow.ts,chant workspace train publish), which behold releases with. Today it receives onlyreleaseSetupStepsand theidTokensslot (release-workflow.ts, the train context), so job steps added here must reach it too. - The tests use fakes: a local registry fake and a scanner fixture DB. Nothing reaches a real registry.
Pull requests, in order
- 1. The gate before the stage: scan the local OCI archive and every attached SBOM,
publish-scan-failed,TOOL_PINSrows and the install step on github, gitlab and forgejo, and the train. - 2. The layer SBOM from syft replaces the lockfile SBOM as the image's SBOM referrer.
- 3. The record in
_releases/publishes.jsonl, the findings referrer,release doctor,SECURITY_FEATURESand the docs. - Decision, recorded here before 1 merges: whether
chant release initturns onsupply-chainfor a new project. Recommended: yes for new projects, no change for existing ones.
Metadata
Metadata
Assignees
Labels
epic:ci-hardeningHardened images, scans, compliance evidence, and the gaps a regulated CI team needs closed
Activity
[-]release publish: scan staged images before reveal under supply-chain[/-][+]release publish: scan every artifact before the stage, with a pinned scanner, under supply-chain[/+]lex00 commentedon Nov 22, 2026
Decision on
chant release initandsupply-chain, made from the code at 3bf0df0: init does not turn the group on, for new projects or existing ones. It prints a note that names the group and what it adds (the scan before the stage, the SBOM refusal, Sigstore signing,--require-provenance), so a team turns it on with one line inchant.workspace.json.Why not the recommended "yes for new projects":
securityGroupsIninworkspace/security.ts). For a single release, init writeschant.config.tsand the workflow and nochant.workspace.json(cli/handlers/release-init.ts); only a train gets one. Turning the group on for a single release would mean init starts writing a declaration it does not write today, and the two shapes would differ in their defaults.supply-chainan npm target refuses a package that carries no SBOM at its root (packageSbom(..., ctx.requireSbom === true)inpublish-npm.ts,publish-sbom-missing). Init plans npm targets with nosbomand adds no step that writes one into the package, so most new npm projects and every new npm train would fail their first publish.--require-provenanceto the rendered publish and refuses a workstation publish once signing is on. Init's workflow grants the OIDC token, so that part would work, but a first publish run by hand from a laptop would not.The scan in this issue follows the group:
release.scanis on undersupply-chainand can be turned on alone withrelease.scaninchant.config.ts, asrelease.signingis for signing. If init later writes the SBOM step for npm packages, turning the group on for new trains can be revisited in its own issue.lex00 commentedon Nov 22, 2026
Corrections from building it:
ocipushes a chart archive as an OCI artifact, not an image built byrelease.images, so there is no local image archive to scan there. The scan covers eachocitarget's image, the SBOM eachforgetarget attaches, and the SBOM each npm package carries (or, with none, one written from the member's lockfile). The images a chart deploys are scanned through their ownocitargets.vulnPolicyinchant.config.ts(failSeverity,fixableOnly,failOnKev, EPSS thresholds,vexSources), so there is no second set of gate settings underrelease.scan.release.scanistrue,false, or{ db }for an offline database directory.scan.json) goes on images only. Forge assets and npm packages have their findings in thescannedorscan-failedline of_releases/publishes.jsonl.lex00 commentedon Nov 22, 2026
Decision on development dependencies in the npm target's scan, after the first releases with
supply-chainwere refused fortinypool 1.1.1(GHSA-5gmw-xhrv-c9v3, GHSA-85c8-ppgw-ccpr), which only vitest brings in.For an npm package that carries no SBOM,
scanSubjectsinpublish-npm.tswrites one throughmemberSbomfrom the nearestpackage-lock.json, andparseNpmPackageLockputs every entry of that lockfile in it. In a workspace that is the whole repository: every member's dependencies and every development dependency, all under the subject<package>@<version>and reported as "the lockfile of" that package. That was not a choice made for scanning. The parser ignores thedevflag and the package's place in the lockfile because it was written forgenerate-sbomover a source tree.The docs describe the lockfile SBOM as listing the declared dependencies of what is published (reference/publish-targets, guide/security-supply-chain), and the document names one package as its subject. A consumer who installs that package never installs its development dependencies or the other members' dependencies, so the release gate was blocking on code the artifact does not contain. Keeping the current behaviour would need the docs to say the SBOM lists the workspace and the policy to grow a scope, and the SBOM would still mislabel its subject.
So the npm target's lockfile SBOM will list what the package brings to a consumer: the package's
dependencies,optionalDependenciesand requiredpeerDependencies, resolved through the lockfile from the package's own entry as npm resolves them, transitively, with linked workspace members followed. Development dependencies, and packages only other members need, are left out. The scan then blocks on exactly that list, with the default policy unchanged. A package that carries its own SBOM is still scanned as it is, and the docs will tell such packages to write it withnpm sbom --omit dev. Scanning build-time dependencies stays available outside the release gate, through a component'sgenerate-sbomandvuln-gatesteps over the repository. The OCI and forge targets are unchanged: an image is scanned from its layers, and their lockfile SBOM does not name a single npm package.lex00 commentedon Nov 22, 2026
Decision on scanning at the cut, after the first two releases with
supply-chainon (plywood 0.4.1, sql-yodeler 0.15.0) were refused by the publish job's scan withpublish-scan-failedonce the cut job had already pushed the release tag and the cut line. Each left a tag with nothing published behind it, and the next attempt needed a new version. Made from the code at 1f19ae3.Where things happen today.
cutRelease(lifecycle/release-cut.ts) builds therelease.imagesarchives and therelease.artifactsfiles inprepare, runsrelease.check, compiles, builds component artifacts, makes the release, runs the npm target's image check (#4941), signs, and then writes the release file and the cut line to the localchant/lifecyclebranch. The handler (runReleaseCutin cli/handlers/release.ts) then pusheschant/lifecycleand makes the tag; the release workflow's cut job pushes the tag after that. A train runschant release cut <label> --at <commit> --yesin each member, so each member's cut pushes its own cut line, and the train pushes every member's tag andrelease-train/<env>/<id>in one atomic push at the end. Aci serve --releasehost runs the rendered dispatch shape'scutjob, which runs the samechant release cut.What changes:
release.publishtargets, once the release is made (so the image archives, the files and the component artifacts are all known) and before it is signed, written tochant/lifecycle, pushed or tagged. It scans whatscanBeforeStagescans: eachocitarget's archive through an SBOM of its layers, the SBOM eachforgetarget attaches, and the SBOM each npm package carries or the one written from the lockfile. SamevulnPolicy, same VEX files, same scanner (grype or trivy, with the Wiz image scanner wrapper from ci hooks: Sonar, Mend and Wiz presets, with findings in the plan note and scan gate #5451 whenrelease.scan.imageScanneriswiz), and the same database age bound fromrelease.scan.dbMaxAgeHoursor a security profile.preparePublishand the cut call, so the two cannot drift.chant release cut <label>without--yessays so before the label is spent.--no-scan.release.scan: falsestays the one switch, and it turns off both.Refusal codes. The cut keeps the publish's codes:
publish-scan-failedfor a finding the policy blocks,publish-scan-db-stale,publish-scan-tool-missing,publish-scan-tool-failedandpublish-scan-vex-missing. That is the convention the cut already follows when it runs a publish target's own check early, so the label is not spent on a release the publish would refuse:publish-npm-carries-image(#4941),publish-npm-never-published(#5230) andpublish-forge-notes-missing(#5319). It also keeps the control mapping in workspace/security-controls.ts, which namespublish-scan-db-stale, true for both places. A cut-specificrelease-scan-*code would collide with therelease-scan-*codeschant release scanalready uses, whererelease-scan-db-stalemeans a rescan that is recorded and not a pass. The message starts with "no release was cut:", lists every blocking finding the way the publish does, and says nothing was recorded, tagged or pushed. The stamped files are put back as on any other refusal.A train. A member whose scan refuses fails its cut, so the train stops with no tag pushed: the tags go out together at the end. Members cut before it have pushed their cut lines, as with any other member failure, and a run of the train again at the same commit takes them as they are. A refused train at a commit that is then fixed is a new commit, and those members' labels are floored past, which is the train's existing rule for a member that fails; nothing was published under them.
Workflows. The rendered
cutjob already installs the pinned grype and syft on GitHub, GitLab and Forgejo, for a single release and for a train (the scan feature's setup goes to every job that runs chant release), and the host installs them for the cut job too. So no rendered workflow changes; a test will hold the cut job's installs. A workstation cut undersupply-chainnow needs grype and syft, aschant release doctoralready reports. chant's own train does not scan, so itspublish.ymldoes not change.A product repository gets this with the next chant release and nothing else: its cut job already has the scanner.