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
10 changes: 3 additions & 7 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
# a release are reported: the findings that have a fix are uploaded to code
# scanning, and a full report (findings without a fix included) is uploaded as
# the workflow artifact `trivy-report-release-image-<image>` (JSON and table).
# Accepted findings are listed in `.trivyignore.yaml`. Doesn't fail on
# findings until the first release of `release.yml`: until then, `latest` is
# the image that the old tag workflows published for v0.10.6. Drop
# `fail: "false"` once a release has published `latest`, so that it fails on
# critical and high vulnerabilities that have a fix (fixed by a new release),
# as CI, `release.yml` and tesk-api do. Scheduled runs use this workflow (with
# Accepted findings are listed in `.trivyignore.yaml`. Fails on critical and
# high vulnerabilities that have a fix (fixed by a new release), as CI,
# `release.yml` and tesk-api do. Scheduled runs use this workflow (with
# its pin of the shared action `elixir-cloud-aai/.github/actions/scan-image`)
# and `.trivyignore.yaml` as on the default branch, and file their findings
# under it. The images are public, so no Docker Hub secrets are needed; their
Expand Down Expand Up @@ -51,4 +48,3 @@ jobs:
image: docker.io/${{ vars.DOCKERHUB_ORG || 'elixircloud' }}/tesk-core-${{ matrix.image }}:latest
category: release-image-${{ matrix.image }}
report: "true"
fail: "false"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Scheduled scan fails on stale image

When a scheduled or manually dispatched scan overlaps a release retag, and the old image has a fixable critical or high finding cleared by that release, a matrix job can pull the old :latest digest just before the release retags it, then fail on a fixable critical or high finding even though the release has scanned the new digest and is publishing it. The scheduled run reports a failure for a vulnerability no longer present in the released image.

Retry or defer enforcement when latest changes during a scan, so the job evaluates the currently published digest.

Prompt for AI agents
In `.github/workflows/scan.yml` at line 54:

**Scheduled scan fails on stale image**

When a scheduled or manually dispatched scan overlaps a release retag, and the old image has a fixable critical or high finding cleared by that release, a matrix job can pull the old `:latest` digest just before the release retags it, then fail on a fixable critical or high finding even though the release has scanned the new digest and is publishing it. The scheduled run reports a failure for a vulnerability no longer present in the released image.

Retry or defer enforcement when `latest` changes during a scan, so the job evaluates the currently published digest.

10 changes: 3 additions & 7 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ Hub organization if it sets the variable `DOCKERHUB_ORG`.

The workflow `Scan` (`.github/workflows/scan.yml`) scans the `latest` images
weekly, so that vulnerabilities found after a release are reported to code
scanning, with a full report as a workflow artifact. Until the first release
of the release workflow below, `latest` is still the image of v0.10.6 from
the old tag workflows, and the scan only reports; after that release, it
fails on critical and high vulnerabilities that have a fix.
scanning, with a full report as a workflow artifact. It fails on critical
and high vulnerabilities that have a fix (except those accepted in
`.trivyignore.yaml`): release a new version to fix them.

## Versioning and releases

Expand Down Expand Up @@ -222,9 +221,6 @@ are released at once, GitHub can cancel a waiting run of the job: re-run it
the same way. Releases are never edited afterwards: fix mistakes in the notes of
the next release.

After the first release of this workflow, drop `fail: "false"` in
`.github/workflows/scan.yml`, and the note on it above.

## Dependencies and metadata

Dependabot (`.github/dependabot.yml`) opens grouped pull requests to `dev`
Expand Down
Loading