Skip to content

docs: add provenance flags to CI/CD workflow example in DHI scan page#24326

Open
ajeetraina wants to merge 12 commits intodocker:mainfrom
ajeetraina:improve/scanguide
Open

docs: add provenance flags to CI/CD workflow example in DHI scan page#24326
ajeetraina wants to merge 12 commits intodocker:mainfrom
ajeetraina:improve/scanguide

Conversation

@ajeetraina
Copy link
Contributor

Description

Updated the "Build Docker image" step in the GitHub Actions workflow example under "Automate DHI scanning in CI/CD with Docker Scout" to include --provenance=mode=max, --sbom=true, and --push flags.

Related issues or tickets

Reviews

  • Technical review
  • Editorial review
  • Product review

ajeetraina and others added 8 commits March 6, 2026 17:43
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 8d5c64e
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/69b00a9447ca72000851d6c5
😎 Deploy Preview https://deploy-preview-24326--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ajeetraina ajeetraina marked this pull request as ready for review March 10, 2026 10:14
>
> The `--provenance=mode=max` and `--sbom=true` flags are required so that
> Docker Scout can trace the DHI base image lineage and correctly apply its
> VEX statements. The `--push` flag is also required, as attestations can
Copy link
Contributor

Choose a reason for hiding this comment

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

if the --push option is mandatory, I would prefer to have the same reasoning mentioned here to be consistent.

However, if there is a way we could avoid --push, I would prefer that approach as the usual flow in CI would be to push the image to the registry only if the CVE scan passes their requirements. Having to to push the image and attestations before the CVE scan, might be a problem in most workflows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fazlan-nazeem Great point. I investigated into this and tested two approaches on GHA. https://github.com/ajeetraina/dhi-containerd-test/actions/runs/22900957211

The --push flag can be avoided by enabling the containerd image store, which allows attestations to be stored locally without pushing to a registry first. This enables the correct CI order: build → scan → push only if clean.

Without the containerd image store, Docker Engine rejects the build entirely with:

Attestation is not supported for the docker driver.
Switch to a different driver, or turn on the containerd image store, and try again.

I've validated this with a two-job GitHub Actions workflow (test run here):

  • test-with-containerd - build → scan → push succeeded
  • test-without-containerd - build failed immediately with the above error

I'll update the PR to use docker/setup-docker-action with the containerd image store enabled, remove --push from the build step, and gate the push behind if: success() after the scan. This gives users the security-correct workflow they'd expect.

@fazlan-nazeem
Copy link
Contributor

@craig-osterhout would you be able to review and merge this, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants