Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 47 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- main
schedule:
- cron: "23 7 * * 1"
- cron: "23 7 * * *"
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -113,6 +113,7 @@ jobs:
PROVENANCE_FILE: provenance-${{ matrix.architecture }}.json
GRYPE_SARIF: grype-${{ matrix.architecture }}.sarif
GRYPE_ALL: grype-all-${{ matrix.architecture }}.json
TRIVY_ALL: trivy-all-${{ matrix.architecture }}.json
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -217,14 +218,15 @@ jobs:
' > "crypto-inventory-${{ matrix.architecture }}.txt"
test -s "crypto-inventory-${{ matrix.architecture }}.txt"

- name: Scan image with Trivy
- name: Record all Trivy findings
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: ${{ env.TEST_IMAGE }}
format: table
exit-code: "1"
ignore-unfixed: true
severity: CRITICAL,HIGH
format: json
output: ${{ env.TRIVY_ALL }}
exit-code: "0"
ignore-unfixed: false
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL

- name: Generate SPDX SBOM with Syft
uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
Expand All @@ -242,15 +244,15 @@ jobs:
'download[.]postgresql[.]org|dnf-srpms[.]postgresql[.]org|cdn-ubi[.]redhat[.]com|security[.]access[.]redhat[.]com|RPM-GPG-KEY|[.]artifact-bundle|/tmp/artifacts'
"${SBOM_FILE}" || true)"

- name: Scan Syft SBOM with Grype
- name: Record Grype SARIF
uses: anchore/scan-action@27805bf3b4e84b4a5c980df22ed233c00390a439 # v7.4.2
with:
sbom: ${{ env.SBOM_FILE }}
output-format: sarif
output-file: ${{ env.GRYPE_SARIF }}
severity-cutoff: high
only-fixed: true
fail-build: true
fail-build: false
cache-db: true
grype-version: v0.118.0

Expand All @@ -267,6 +269,12 @@ jobs:
cache-db: true
grype-version: v0.118.0

- name: Gate on fixes installable from pinned UBI repositories
if: ${{ always() }}
env:
ARCHITECTURE: ${{ matrix.architecture }}
run: bash scripts/gate-vulnerabilities.sh

- name: Retain image security artifacts
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand All @@ -277,6 +285,8 @@ jobs:
${{ env.PROVENANCE_FILE }}
${{ env.GRYPE_SARIF }}
${{ env.GRYPE_ALL }}
${{ env.TRIVY_ALL }}
vulnerability-gate-${{ matrix.architecture }}/
crypto-inventory-${{ matrix.architecture }}.txt
if-no-files-found: warn
retention-days: 14
Expand All @@ -299,3 +309,32 @@ jobs:
env:
MATRIX_RESULT: ${{ needs.image.result }}
run: test "${MATRIX_RESULT}" = success

track-vulnerabilities:
name: track UBI fix availability
needs: image
if: >-
always() && github.ref == 'refs/heads/main' &&
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- name: Check out trusted monitoring code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Download native reports, including failed gates
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: image-security-${{ github.sha }}-*
path: native-reports

- name: Update one tracking issue and notify on state changes
if: ${{ always() }}
env:
GH_TOKEN: ${{ github.token }}
run: python3 scripts/track_vulnerabilities.py --reports native-reports
42 changes: 20 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,6 @@ jobs:
upload-artifact: false
upload-release-assets: false

- name: Enforce Trivy release gate
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
input: ${{ env.OCI_ARCHIVE }}
format: table
exit-code: "1"
ignore-unfixed: true
severity: CRITICAL,HIGH

- name: Record every Trivy finding
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
Expand All @@ -185,15 +176,15 @@ jobs:
ignore-unfixed: false
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL

- name: Enforce Grype release gate
- name: Record Grype release SARIF
uses: anchore/scan-action@27805bf3b4e84b4a5c980df22ed233c00390a439 # v7.4.2
with:
sbom: ${{ env.SBOM_FILE }}
output-format: sarif
output-file: grype-${{ matrix.architecture }}.sarif
severity-cutoff: high
only-fixed: true
fail-build: true
fail-build: false
cache-db: true
grype-version: v0.118.0

Expand All @@ -209,6 +200,10 @@ jobs:
cache-db: true
grype-version: v0.118.0

- name: Gate on fixes installable from pinned UBI repositories
if: ${{ always() }}
run: bash scripts/gate-vulnerabilities.sh

- name: Record OCI descriptor and image configuration
run: |
tar -xOf "${OCI_ARCHIVE}" index.json > "manifest-${ARCHITECTURE}.json"
Expand All @@ -234,6 +229,7 @@ jobs:
${{ env.PROVENANCE_FILE }}
${{ env.TRIVY_ALL }}
${{ env.GRYPE_ALL }}
vulnerability-gate-${{ matrix.architecture }}/
grype-${{ matrix.architecture }}.sarif
manifest-${{ matrix.architecture }}.json
image-config-${{ matrix.architecture }}.json
Expand Down Expand Up @@ -337,15 +333,6 @@ jobs:
| sort == ["amd64", "arm64"]
' manifest.json

- name: Enforce published-digest Trivy gate
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: ${{ env.IMAGE }}@${{ needs.publish.outputs.digest }}
format: table
exit-code: "1"
ignore-unfixed: true
severity: CRITICAL,HIGH

- name: Record every published-digest Trivy finding
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
Expand All @@ -366,15 +353,15 @@ jobs:
upload-artifact: false
upload-release-assets: false

- name: Enforce published-digest Grype gate
- name: Record published-digest Grype SARIF
uses: anchore/scan-action@27805bf3b4e84b4a5c980df22ed233c00390a439 # v7.4.2
with:
sbom: image.spdx.json
output-format: sarif
output-file: grype-index.sarif
severity-cutoff: high
only-fixed: true
fail-build: true
fail-build: false
cache-db: true
grype-version: v0.118.0

Expand All @@ -390,13 +377,23 @@ jobs:
cache-db: true
grype-version: v0.118.0

- name: Gate published digest using the native UBI repositories
if: ${{ always() }}
env:
ARCHITECTURE: amd64
run: |
cp trivy-index-all.json trivy-all-amd64.json
cp grype-index-all.json grype-all-amd64.json
bash scripts/gate-vulnerabilities.sh

- name: Upload code-scanning evidence
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: grype-index.sarif
category: grype-release-image

- name: Retain manifest evidence
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-evidence-${{ github.sha }}-manifest
Expand All @@ -406,6 +403,7 @@ jobs:
trivy-index-all.json
grype-index.sarif
grype-index-all.json
vulnerability-gate-amd64/
if-no-files-found: error
retention-days: 90

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ but container releases use the upstream-derived format documented in

### Fixed

- Regenerated both native RPM/source locks and refreshed the selected UBI base
digests. Updated the util-linux family to 2.37.4-28.el9_9.1, expat to
2.5.0-9.el9_9.4, and libxml2 to 2.9.13-18.el9_9.1, retaining PostgreSQL 18.6
and the installable-fix gate.

- Gate vendor-fixed High/Critical UBI RPM findings on native repository
availability using the pinned builder configuration and RPM version ordering.
Fail closed on uncertainty and retain ordinary blocking for non-UBI findings.
Report unavailable fixes in CI/release evidence and a daily tracking issue
that notifies subscribers when availability or findings change.

- Regenerated the CI tool requirements with complete version pins and wheel
hashes, including virtualenv's packaging dependency, while retaining
filelock 3.x. Added inputs and commands for repeatable regeneration.
Expand Down
4 changes: 2 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.7

ARG UBI_MINIMAL_IMAGE="registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:4b79c93106c14ad1c234907f83441ff0e4f8d24e78426a36e159098e9f7e6fa5"
ARG UBI_MICRO_IMAGE="registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:6d9eff186ce3ccf399c1835265e7fd3f83bd112cc3422da2d39fd44e234aab59"
ARG UBI_MINIMAL_IMAGE="registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:f26ef64172ea61f5ac5ba4be8c5c738bf8760b22b3e5148ce7b40f7308ab32db"
ARG UBI_MICRO_IMAGE="registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:d3499a0896e2d6a1642f922615831bc5c2fd513bbb34f3446cabba530d9d54a2"

FROM ${UBI_MICRO_IMAGE} AS runtime-base

Expand Down
36 changes: 36 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,39 @@ evidence-retention rules are in
[Maintenance and ownership](docs/MAINTENANCE.md). Never disclose credentials,
private keys, database contents, personal data, or internal environment details
in a public issue or public evidence record.

## Installable-fix vulnerability gate

CI and releases block High/Critical findings when a vendor fix can be installed
from the UBI repositories used to resolve this image's locked RPM closure. For
each vendor-fixed UBI RPM finding, a native query uses the repository files and
DNF configuration copied from that architecture's digest-pinned builder image
before installing query tooling. It refreshes every enabled UBI repository,
uses the resolver's release version and architecture, excludes installed
builder packages, and compares available versions with the vendor fixed
version using RPM epoch/version/release ordering. Any available version at or
above a vendor fixed version blocks the gate.

Only a successful query proving that no such version is available defers a
finding. Deferred findings remain vulnerabilities: the job summary and retained
JSON include the scanner, finding, package, architecture, vendor fixed version,
query result, and decision. They are not exemptions or approvals. Findings
without a vendor fix remain reported as unfixed, separately from deferrals.
There are no CVE, package, or date exceptions in this rule.

Query errors, deadlines, missing repositories, invalid versions, missing or
malformed scanner reports, and ambiguous package identities fail closed.
Only RPMs matching a locked UBI origin can be deferred; fixable PGDG or other
supplier RPMs and non-RPM findings (including application dependencies) keep
the ordinary blocking behavior. High/Critical secret findings also block.
The availability check never changes the runtime, locks, or repository sources.

Daily native CI rechecks current scanner data and UBI publication. On scheduled
runs (and manual runs on main), one **UBI vulnerability fix availability** issue
records both architectures and comments when findings, vendor versions, gate
decisions, or query errors change. When UBI publishes a fix, the next successful
query blocks and the tracking job still runs after the failed image job to
notify issue subscribers. Missing architecture evidence is reported as a
failure, never as resolution. Pull requests cannot write this issue. The
scheduled workflow becomes active after the change reaches main; this PR does
not change repository settings, secrets, or branch protection.
4 changes: 2 additions & 2 deletions artifacts/lock-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"postgresql_rpm_version": "18.6-1PGDG.rhel9.8",
"ubi_release": "9.8",
"base_images": {
"builder": "registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:4b79c93106c14ad1c234907f83441ff0e4f8d24e78426a36e159098e9f7e6fa5",
"runtime": "registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:6d9eff186ce3ccf399c1835265e7fd3f83bd112cc3422da2d39fd44e234aab59"
"builder": "registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:f26ef64172ea61f5ac5ba4be8c5c738bf8760b22b3e5148ce7b40f7308ab32db",
"runtime": "registry.access.redhat.com/ubi9/ubi-micro:9.8@sha256:d3499a0896e2d6a1642f922615831bc5c2fd513bbb34f3446cabba530d9d54a2"
},
"architectures": {
"amd64": {
Expand Down
Loading
Loading