Skip to content

Commit 671fc72

Browse files
committed
ci(security): gate tagged releases on scans
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent fa8f6d3 commit 671fc72

5 files changed

Lines changed: 45 additions & 15 deletions

File tree

‎.github/workflows/codex-security.yml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
name: Codex Security Release Qualification
55

66
on:
7-
push:
8-
tags:
9-
- "v*.*.*-pre.*"
107
workflow_call:
118
inputs:
129
candidate_ref:

‎.github/workflows/release-tag.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- "v*.*.*"
7+
- "!v*.*.*-pre.*"
78
workflow_dispatch:
89
inputs:
910
tag:
@@ -129,6 +130,26 @@ jobs:
129130
image-tag: ${{ needs.compute-versions.outputs.source_sha }}
130131
checkout-ref: ${{ needs.compute-versions.outputs.source_sha }}
131132

133+
security:
134+
name: Security Scan
135+
needs: [compute-versions, build-images]
136+
permissions:
137+
actions: read
138+
contents: read
139+
packages: read
140+
security-events: write
141+
uses: ./.github/workflows/security-scan.yml
142+
with:
143+
candidate_ref: ${{ inputs.tag || github.ref_name }}
144+
allow-high-critical: false
145+
images: |
146+
ghcr.io/nvidia/openshell/gateway:${{ needs.compute-versions.outputs.source_sha }}
147+
ghcr.io/nvidia/openshell/sandbox:${{ needs.compute-versions.outputs.source_sha }}
148+
ghcr.io/nvidia/openshell/supervisor:${{ needs.compute-versions.outputs.source_sha }}
149+
secrets:
150+
CODEX_SECURITY_API_KEY: ${{ secrets.CODEX_SECURITY_API_KEY }}
151+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
152+
132153
prepare-integration:
133154
needs: [compute-versions, build-binaries, build-deb, build-images]
134155
permissions:
@@ -308,6 +329,7 @@ jobs:
308329
- feature-specific-integration
309330
- docker-e2e
310331
- vm-e2e
332+
- security
311333
- build-deb
312334
- build-rpm
313335
- build-snap

‎.github/workflows/security-scan.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88
inputs:
99
candidate_ref:
10-
description: Pre-release tag to scan (vMAJOR.MINOR.PATCH-pre.N)
10+
description: Release tag to scan; Codex runs only for pre-release tags
1111
required: true
1212
type: string
1313
stable_ref:
@@ -33,7 +33,7 @@ on:
3333
workflow_call:
3434
inputs:
3535
candidate_ref:
36-
description: Pre-release tag to scan (vMAJOR.MINOR.PATCH-pre.N)
36+
description: Release tag to scan; Codex runs only for pre-release tags
3737
required: true
3838
type: string
3939
stable_ref:
@@ -69,6 +69,7 @@ permissions:
6969
jobs:
7070
codex:
7171
name: Codex Security
72+
if: contains(inputs.candidate_ref, '-pre.')
7273
uses: ./.github/workflows/codex-security.yml
7374
permissions:
7475
actions: read

‎CI.md‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ nix develop --command zizmor --offline --persona=regular --min-severity=high --n
8989

9090
## Run the security scans together
9191

92-
`Security Scan` (`.github/workflows/security-scan.yml`) calls Codex Security,
93-
CodeQL, Trivy, Cargo Deny, and Workflow Security Reports (Actionlint/Zizmor) in
94-
parallel. Run it manually from Actions or call it from another workflow. All
95-
children scan `candidate_ref`, which must be an existing `vX.Y.Z-pre.N` tag
96-
because Codex qualifies pre-releases. Codex compares it with the previous stable;
97-
the other scanners analyze the candidate snapshot. Cargo Deny uses its existing
98-
NVIDIA self-hosted runner and CI container.
92+
`Security Scan` (`.github/workflows/security-scan.yml`) calls CodeQL, Trivy,
93+
Cargo Deny, and Workflow Security Reports (Actionlint/Zizmor) in parallel for a
94+
release tag. It additionally calls Codex Security for `vX.Y.Z-pre.N` tags, which
95+
Codex compares with the previous stable release. Run the parent manually from
96+
Actions or call it from another workflow. All applicable children analyze the
97+
candidate snapshot. Cargo Deny uses its existing NVIDIA self-hosted runner and
98+
CI container.
9999

100100
```shell
101101
gh workflow run security-scan.yml --ref main \
@@ -132,6 +132,8 @@ jobs:
132132
```
133133
134134
Set `needs: security` on a downstream promotion job to require successful scans.
135+
The tagged release workflow does this after publishing its commit-addressed OCI
136+
images, so failed scans or High/Critical findings block release publication.
135137

136138
`CODEX_SECURITY_API_KEY` is required; `CACHIX_AUTH_TOKEN` is optional. The parent
137139
publishes SARIF, including Codex results for manual parent runs. Codex keeps its
@@ -375,7 +377,7 @@ These workflows run after merge to publish dev/tagged artifacts and verify them.
375377
| File | Role |
376378
|---|---|
377379
| `.github/workflows/release-dev.yml` | Publishes the rolling `dev` build on every push to `main`. Builds gateway, sandbox, and supervisor images and binaries, packages, wheels, and pushes the Helm chart as `oci://ghcr.io/nvidia/openshell/helm-chart:0.0.0-dev` (plus an immutable `0.0.0-dev.<sha>` pin). Also dispatchable manually. |
378-
| `.github/workflows/release-tag.yml` | Publishes a tagged stable release. Its automatic tag trigger excludes `-pre.*`; manual dispatch remains maintainer-controlled. |
380+
| `.github/workflows/release-tag.yml` | Publishes tagged stable releases and manually dispatched pre-releases. Its automatic tag trigger excludes `-pre.*`. Security Scan gates release publication. |
379381
| `.github/workflows/release-canary.yml` | Smoke-tests published dev artifacts on `macos`, `ubuntu`, `fedora`, and `kubernetes` (kind + Helm) runners. Each job reaches its gateway and creates, exercises, and deletes a sandbox. It runs automatically after `Release Dev` succeeds and supports manual dispatch (`gh workflow run release-canary.yml --ref <branch>`). See the `test-release-canary` skill for the playbook and local kind reproduction. |
380382

381383
## Required status contexts

‎architecture/build.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,9 @@ Triggers differ by workflow: `.github/workflows/workflow-security.yml` runs on
368368
`merge_group` only, because it needs a base and head commit to compare;
369369
`.github/workflows/codeql.yml` runs nightly on the default branch (`main`) via
370370
`schedule`, with `workflow_dispatch` kept for manual diagnostics; and
371-
`.github/workflows/codex-security.yml` runs on pushed `v*.*.*-pre.*` tags, and is
372-
also callable through `workflow_call` and `workflow_dispatch`. CodeQL does
371+
`.github/workflows/codex-security.yml` is called by the aggregate release scan
372+
for pre-release tags and is also callable through `workflow_call` and
373+
`workflow_dispatch`. CodeQL does
373374
not run on `pull_request`, `merge_group`, or pushes to `main`, so it reports
374375
repository-level Code Scanning state on the default branch instead of per-PR
375376
results, and its four-language matrix stays off the per-change critical path.
@@ -480,6 +481,13 @@ workflow only reports on candidates that already exist. Gating stable promotion
480481
on qualification results remains proposed in
481482
[RFC 0014](../rfc/0014-release-stability/release-qualification.md).
482483

484+
The tagged release workflow calls the aggregate Security Scan after publishing
485+
the candidate's commit-addressed gateway, sandbox, and supervisor images. CodeQL,
486+
Trivy, Cargo Deny, and Actionlint/Zizmor run for every release tag; Codex Security
487+
also runs for pre-release tags. The release job depends on the aggregate result,
488+
which fails on scanner errors, Cargo Deny advisories, and unexcepted High or
489+
Critical findings.
490+
483491
`release-auto-tag.yml` runs at 14:00 Europe/Zurich on weekdays (including daylight
484492
saving time changes) and supports manual dispatch. Maintainers start weekday
485493
pre-release publishing by tagging the initial `vX.Y.Z-pre.1` release candidate.

0 commit comments

Comments
 (0)