Scan, attest and sign the published Docker images
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Read CONTRIBUTING.md first, then inspect Dockerfile, .github/workflows/docker.yaml, and deploy-prod.yaml after #203. Check the existing release build and image publication flow before reviewing the requested Trivy, attestation, digest-pinning, signing, and README verification steps. Done means PR and release images meet every acceptance criterion and the workflow is validated on a fork.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🔄 Updated for v5.0.0 (2026-10-08). Rewritten for the current CI. Since this was written, the image is built once per commit by the shared
build_push_image.ymlworkflow in pesu-dev/actions (#203, #223, #224), which setsprovenance: false. Images are multi-arch and published to GHCR, then copied to Docker Hub on release. The base images changed too, and the uv image is pulled aslatest. The four protections are still missing; where each one now goes is updated below.
Summary
Nothing checks the published Docker images for known vulnerabilities, nothing records what's inside them, and nothing proves that they were built by this repository's CI. Add the standard supply-chain protections for container images:
- Vulnerability scanning with Trivy.
- An SBOM and build provenance.
- Base images pinned by digest.
- Keyless signing with cosign.
Background
- The
Dockerfileusespython:3.14-slim-bookworm(builder and runtime) and copies uv fromghcr.io/astral-sh/uv:latest, all by tag. A tag can be moved to point at a different image at any time, andlatestmoves on every uv release. - Where images are built:
- every PR: the Build image on PR job (
pr_image_buildinci_checks.yml, sharedbuild_push_image.yml, no push), plus a localdocker buildin the Container security & smoke test job (container_checks), which runs the image and checks it runs as UID 10001; - every merge to
dev:deploy_staging.ymlbuilds and pushesghcr.io/pesu-dev/pesu-auth:<sha>forlinux/amd64andlinux/arm64, then tags itstaging; - every release:
deploy_prod.ymlbuilds the approved commit the same way, and itsreleasejob tags itvX.Y.Z,latestandprodon GHCR and copies it to Docker Hub (pesudev/pesu-auth) withdocker buildx imagetools create.
- every PR: the Build image on PR job (
- The shared workflow passes
provenance: falsetodocker/build-push-action, so no attestations are pushed today. - Render does not run these images. It builds the
Dockerfileitself from the deployed commit. Signing and SBOMs protect the published images that people pull, not what runs onpesuauth.onrender.com. Pinning base images by digest protects both. - The repo's security settings (Dependabot security updates, secret scanning) are maintainer settings, tracked in #209.
Proposed change
- Scan on every PR: in
container_checks, afterdocker build, runaquasecurity/trivy-actiononpesu-auth-testwithseverity: CRITICAL,HIGHandignore-unfixed: true, failing the job on findings. Add a.trivyignore(empty to start), with a comment saying each entry needs a reason and an expiry date. - Scan on release too, and upload the SARIF report to the Security tab (
github/codeql-action/upload-sarif). That needssecurity-events: writeon that job only. - SBOM and provenance: add inputs to
build_push_image.ymlin pesu-dev/actions to turn onsbom: trueandprovenance: mode=max(keeping today's behaviour as the default), and pass them from the two deploy workflows here. They're pushed with the image as attestations. Check that the release job'sdocker buildx imagetools create --prefer-index=falsekeeps them on thevX.Y.Z,latestandprodtags, and on Docker Hub. - Pin base images by digest:
FROM python:3.14-slim-bookworm@sha256:<digest>, and the same for the uv image, replacinglatestwith an exact version (ghcr.io/astral-sh/uv:<version>@sha256:<digest>). Keep the tag in the line for readability. #209 adds Dependabot'sdockerecosystem, which keeps digests current. Without it, pinned digests go stale and miss security fixes, so these two issues should land together or in that order. - Sign: install
sigstore/cosign-installer, thencosign sign --yes <image>@<digest>for both registries after the release tags are created, using GitHub's OIDC token (keyless). The job needsid-token: write. Document how users verify a signature in the README (cosign verify ... --certificate-identity-regexp ... --certificate-oidc-issuer https://token.actions.githubusercontent.com).
On permissions: the workflows already declare permissions: at the workflow and job level. Grant security-events: write and id-token: write only to the jobs that need them, and say so in the PR description.
House rules for workflow changes:
- Keep workflow comments to short one-liners, matching the existing files, and put the reasoning in the PR description.
- Every PR check runs from
.github/workflows/ci_checks.yml. The only required status check ondevisGreenlight - CI checks, which fails if any job itneedsfailed. Add a new job to itsneedslist and toCHECK_RESULTS, or the job won't block a merge, and don't rename the Greenlight job, or the required check never reports. - Image builds and Render deploys run through shared workflows in pesu-dev/actions (
build_push_image.ymlanddeploy_render.yml, used at@v1). A change to them is a PR to that repository, followed by moving itsv1tag. astral-sh/setup-uvpublishes no floating major tag, so pin an exact version (CI uses@v9.0.0) or a commit SHA.ci_checks.ymlruns on pull requests, so test a workflow change by opening a pull request inside your fork (from your branch to your fork'sdev), and link the green run in your PR.
Acceptance criteria
- PR builds fail on fixable CRITICAL/HIGH vulnerabilities
- Release images carry an SBOM and provenance, and are signed; the README shows how to verify
- Base images are pinned by digest (no
latest), and kept current by Dependabot (#209) - Validated on a fork with your own registry; run linked in the PR
How to contribute
- Wait until you're assigned. Comment to ask for this issue, then wait for a maintainer to assign it to you before writing any code. PRs for unassigned issues are closed without review.
- Read
CONTRIBUTING.mdfirst. It covers forking, setting up withuv, and running the tests. - Branch from
devin your fork, and open the PR againstdevwith a Conventional Commit title andCloses #207in the description. The pesu-dev/actions change is a separate PR to that repository; link the two. - Bump the minor version in
pyproject.tomland runuv lock(CI checks this).uv run pre-commit run --all-filesmust pass, and coverage must stay at 100%. - Update the README,
app/docs/and comments in the same PR as the behaviour they describe. - Never log, print, store or echo a password or token, including in tests, PR descriptions and screenshots.
- Lingua principale
- Python
- Stelle
- 23
- Fork
- 30
- Merge medio
- 1g 18h
- PR unite (30g)
- 18
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pesu-dev/auth
-
Check the README for dead links and fix the misleading Docker Hub badgeForse di nuovo libera @knownshah l’ha presa 35 giorni fa e non c’è nessuna pull request aperta. Apertadocumentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
pesu-dev/auth#220 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Bound /authenticate request size and profile field countForse già presa @jois-code l’ha presa 11 giorni fa. Apertaapi enhancement
pesu-dev/auth#257 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
bug documentation enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
I maintainer di solito rispondono entro 2 giorni
-
Commit SHA should be used instead of tag git based deployForse di nuovo libera @aditeyabaral l’ha presa 29 giorni fa e non c’è nessuna pull request aperta. Apertabug
pesu-dev/auth#236 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Private Functions in `app.py` needs to be in separate fileForse di nuovo libera @aditeyabaral l’ha presa 29 giorni fa e non c’è nessuna pull request aperta. Apertaapi enhancement
pesu-dev/auth#235 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di pesu-dev/auth
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pyfakefs#1367 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
IFEvalG exclude_word_harder misses the keyword next to punctuation, at the start or end of the text, and in other letter caseForse già presa @damienen l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
allenai/open-instruct#2151 ·
I maintainer di solito rispondono entro 1 giorno
-
feat(plan): support convertorLabels and convertorAffinity in Plan resourceForse già presa @AmenB l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
RedHatQE/openshift-python-wrapper#2849 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 25 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
libnativeapi/nativeapi#21 ·