-
Notifications
You must be signed in to change notification settings - Fork 0
Testing Max-Mode Attestations #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
johlju
wants to merge
35
commits into
main
Choose a base branch
from
f/scout-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
df29db4
Add GitHub Actions workflow for Docker Scout security scanning
johlju acc6605
Add max-mode SBOM and provenance support for Docker Scout in build wo…
johlju 7380dcb
Add 'sarif' and 'cves' to ignored words in cspell configuration
johlju c6da434
Fix typo in exit-on comment for vulnerability handling in Docker Scou…
johlju 38bff18
Add section for testing max-mode attestations locally in CONTRIBUTING.md
johlju acd3692
Add Docker Scout security scanning workflow for pull requests
johlju 0e19d5e
Restrict Docker build platforms to linux/amd64 for compatibility
johlju 30b9bb8
Fix typos and improve clarity in Docker Scout workflow
johlju f0307ee
Fix typo in outputs key for Docker Scout image export
johlju 95519d0
Update Docker Scout workflow to export OCI image and scan local archi…
johlju baebf4e
Refactor Docker Scout workflow to build and push images to a local re…
johlju 3a6985c
Fix Docker registry startup command and adjust build settings for loc…
johlju 6a6681f
Update Docker Scout workflow to use 127.0.0.1 for local registry and …
johlju 1bc715c
Enhance Docker Scout workflow by adding explicit login step for Docke…
johlju 3446c2a
Add organization parameter for baseline pull and refine Docker Hub lo…
johlju 48ae3d7
Refactor Docker Scout workflow to use GitHub Container Registry for l…
johlju 53c75c4
Add permission for package writing to allow pushing to GHCR
johlju d4fde12
Update Docker Scout workflow to use secrets for GHCR login credentials
johlju 21e3204
Add Docker Hub authentication to Docker Scout step
johlju cd6ec5a
Refactor Buildx setup and environment variables in Docker Scout workflow
johlju d0a9bce
Update platforms in Docker build step to support multi-architecture
johlju df46682
Update Docker Scout action to use separate fields for Docker Hub cred…
johlju 736a29a
Add Docker Hub and GHCR authentication to Docker Scout step
johlju 1bccbbc
Update Docker build-push action to v6 and remove latest tag from image
johlju 616e858
Update Docker Scout step to use secrets for GHCR user credentials
johlju 0522bd4
Update Docker Scout step to fetch PR image from GHCR and compare agai…
johlju efb680e
Refactor Docker login step to separate Docker Hub authentication from…
johlju 9fd84db
Remove commented-out Docker Hub and GHCR credentials from Docker Scou…
johlju 662715c
Add checkout step for Docker Scout policies and update policy path
johlju 60bae6f
Refactor secret injection for GH_READ_TOKEN in Docker build step
johlju 24f3db0
Refactor secret injection for GH_READ_TOKEN in Docker workflows
johlju 9c0066a
Update BuildKit instructions for Docker and Docker Compose in CONTRIB…
johlju 562b8f2
Update Docker Scout action to include recommendations in CVE command
johlju 5365050
Remove checkout step for Docker Scout policies from workflow
johlju 33a5be7
Merge branch 'main' into f/scout-workflow
johlju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: Container security (Docker Scout) | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - '**/Dockerfile' # rebuild only when something container‑related changes | ||
| - '.github/workflows/**' | ||
johlju marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| jobs: | ||
| scout: | ||
| runs-on: ubuntu-latest | ||
| permissions: # required for PR comments + Code‑scanning upload | ||
| contents: read | ||
| pull-requests: write | ||
| security-events: write | ||
| packages: write # allow pushing to GHCR | ||
|
|
||
| env: | ||
| IMAGE_NAME: ${{ github.repository }} | ||
| TAG: pr-${{ github.event.number }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Buildx | ||
| id: buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| with: | ||
| driver: docker-container | ||
| driver-opts: | | ||
| network=host | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: docker.io | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ secrets.GHCR_USERNAME }} # GitHub username | ||
| password: ${{ secrets.GHCR_TOKEN }} # PAT with packages:write scope | ||
|
|
||
| - name: Build & push PR and baseline images to GHCR | ||
| uses: docker/build-push-action@v6 | ||
| env: | ||
| GH_READ_TOKEN: ${{ secrets.GH_READ_TOKEN }} # provide token for provenance | ||
| with: | ||
| builder: ${{ steps.buildx.outputs.name }} # use configured Buildx builder | ||
| secrets: | # inject read token | ||
| ${{ env.GH_READ_TOKEN != '' && format('gh_read_token={0}', env.GH_READ_TOKEN) }} | ||
| context: . | ||
| platforms: | | ||
| linux/amd64 | ||
| linux/arm64 | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}:${{ env.TAG }} | ||
| sbom: mode=max # max-mode SBOM for Scout | ||
| provenance: mode=max # max-mode provenance for Scout | ||
| push: true # push both tags to GHCR | ||
|
|
||
|
Comment on lines
+60
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Comment/tag mismatch – clarify which tags are pushed. 🤖 Prompt for AI Agents |
||
| - name: Scan image with Docker Scout | ||
| id: scout | ||
| uses: docker/scout-action@v1 | ||
| with: | ||
| # dockerhub-user: ${{ secrets.DOCKERHUB_USERNAME }} # Docker Hub user for Scout auth | ||
| # dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }} # Docker Hub token for Scout auth | ||
| # registry-user: ${{ secrets.GHCR_USERNAME }} # GHCR user for fetching PR image | ||
| # registry-password: ${{ secrets.GHCR_TOKEN }} # GHCR token for fetching PR image | ||
| command: cves,recommendations,compare # list CVEs and compare to prod baseline | ||
| image: ghcr.io/${{ github.repository }}:${{ env.TAG }} | ||
| organization: ${{ github.repository_owner }} # namespace for baseline pull | ||
| # --- comparison baseline --------------------------------------- | ||
| to: docker.io/${{ github.repository }}:latest # pull baseline from Docker Hub | ||
| # --- what should make the step fail ----------------------------- | ||
| only-severities: critical,high # we tolerate ≤ medium | ||
| exit-code: true # fail if *any* matching CVE left | ||
| exit-on: vulnerability # fail if comparison adds new vulnerabilities | ||
| only-fixed: true # ignore unfixed issues | ||
| # --- UX helpers -------------------------------------------------- | ||
| sarif-file: scout-results.sarif # upload to Security tab | ||
| write-comment: true # nice PR comment | ||
| summary: true | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} # token for PR comment | ||
|
|
||
| - name: Upload SARIF to GitHub code-scanning | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: scout-results.sarif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,9 @@ | |
| "sarif", | ||
| "shellcheck", | ||
| "viscalyx", | ||
| "viscalyxbot" | ||
| "viscalyxbot", | ||
| "sarif", | ||
| "cves", | ||
| "buildkit" | ||
| ] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.