Skip to content

Add container-storage support for Podman and Buildah - #5368

Merged
wagoodman merged 5 commits into
anchore:mainfrom
Bru456:main
Oct 5, 2026
Merged

wagoodman merged 5 commits into
anchore:mainfrom
Bru456:main

Conversation

@Bru456

@Bru456 Bru456 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Enable stereoscopes container-storage provider in Linux release builds. Allowing Syft to scan local images built with daemonless Podman or Buildah. Introduced in stereoscope PR: anchore/stereoscope#635 and released in version 0.3.3.

syft --from containers-storage localhost/myimage:latest 

Plain image references also check the local store before registry lookup. No new configuration options are introduced. MacOS and Windows release builds remain unchanged.

  • Document usage and build requirements.
  • Add unit coverage for provider selection and ordering.
  • Add separate Github-hosted Linux CI jobs for Podman and Buildah using isolated stores.
  • Verify package cataloging, automatic resolution, and explicit missing-image failure.
  • Require both new CI checks before release.

Default and tagged unit tests pass. Both builder tests passed in root and non root Linux containers (locally on my machine).

Builder Rootful Rootless
Podman 4.9.3 Pass Pass
Buildah 1.33.7 Pass Pass
Buildah 1.45.1 Pass Pass

Podman 4.9.3 and Buildah 1.33.7 installed from Ubuntu 24.04 apt repos. Buildah 1.45.1 built from source in a local go container.

Local tests including building Linux ARM64 Syft locally, copying the binaries into fresh Ubuntu Linux containers with Podman installed on one and buildah on the other. Each test built a local image used Syft to produce an SBOM and validated it with the shared test script in test/containers-storage/source-test.sh.

Rootless tests ran as UID 1001 inside privileged outer containers to permit nested user namespaces. Execution directly on GitHub-hosted runners remains to be verified in CI.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation (updates the documentation)

Checklist

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Issue references

Fixes #1664
Fixes #1173
Fixes #2107

@oss-housekeeper oss-housekeeper Bot added the needs-manual-review automated action that should be reviewed by a human label Oct 2, 2026

@oss-housekeeper oss-housekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Changes github configuration, dependencies, or agent instructions — this requires manual review from @anchore/tools

No action from the PR author is needed.

Guarded files touched in this PR:

  • .github/workflows/release.yaml (sha: d1cad71b8d1b02ffd3ad0fdf0594fa1577ca3b13)
  • .github/workflows/validations.yaml (sha: 97acdb6c83ac573439c89b499b111ee58ab3e64b)

This review disposition can be dismissed after manual review.

bc209 and others added 5 commits October 5, 2026 10:43
…ests and documentation

Signed-off-by: Bruce Clark <bruce.clark@mandg.com>
…ndle missing images

Signed-off-by: Bruce Clark <bruce.clark@mandg.com>
Install uidmap for Podman and Buildah CI jobs.
Align temporary rootful and rootless storage paths.
Clean up rootless stores within the builder's user namespace.

Signed-off-by: Bruce Clark <bruce.clark@mandg.com>
- containers-storage is no longer part of automatic image resolution; it's used only for `--from containers-storage`, the `containers-storage:` scheme, or `default-pull-source: containers-storage` (now an accepted value). Opening a store runs full graph driver init (mounts, locks, store writes), which is too invasive as a probe on every plain image reference.
- rootless stores must be read from inside the builder's user namespace (`podman unshare syft ...`), documented in the README.
- the `containers_image_openpgp` tag is now applied to unit/integration tests and lint, so dev tooling compiles the same provider that ships.
- containers-storage CI runs through `make containers-storage-test` and covers both vfs and overlay stores.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- cgo-enabled linux builds (`-race` tests, lint) compile go.podman.io's btrfs graph driver, which needs libbtrfs headers. Add `exclude_graphdriver_btrfs` alongside `containers_image_openpgp` everywhere the tag is set; release builds are `CGO_ENABLED=0` and never included it.
- the overlay driver bind-mounts its graphroot inside the rootless user namespace, so the containers-storage test unmounts it before removing the store, and cleanup no longer fails the run.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman
wagoodman merged commit 29b92a5 into anchore:main Oct 5, 2026
19 checks passed
wagoodman added a commit to Bru456/grype that referenced this pull request Oct 5, 2026
- containers-storage is meant to be used only when requested by name (`--from containers-storage`, the `containers-storage:` scheme, or `default-image-pull-source: containers-storage`). That gating lives in syft (anchore/syft#5368), so plain image references keep probing the local store until grype bumps syft.
- set `containers_image_openpgp,exclude_graphdriver_btrfs` everywhere the linux build tag applies (goreleaser, unit, integration, race smoke, golangci-lint), so Go tooling compiles the provider that ships. The btrfs exclude avoids needing libbtrfs headers on cgo builds.
- run the e2e through `make containers-storage-test BUILDER=podman|buildah`. It now covers `vfs` and `overlay` stores, runs rootless scans under `<builder> unshare`, asserts the image came out of the store, and checks that plain refs never touch it.
- README documents explicit usage and `podman unshare` for rootless stores.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman added a commit to Bru456/grype that referenced this pull request Oct 5, 2026
picks up anchore/syft#5368, which only uses the containers-storage provider when requested by name. This pins syft (and transitively stereoscope and go-rpmdb) to unreleased pseudo-versions; swap to the next syft release before merging.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman added a commit to anchore/grype that referenced this pull request Oct 5, 2026
* feat: add containers-storage support for Podman and Buildah

Enable containers-storage in Linux release builds, document usage, and add
provider routing and end-to-end Podman/Buildah validation.

Signed-off-by: Bruce Clark <bruce.clark@mandg.com>

* chore: align containers-storage support with syft

- containers-storage is meant to be used only when requested by name (`--from containers-storage`, the `containers-storage:` scheme, or `default-image-pull-source: containers-storage`). That gating lives in syft (anchore/syft#5368), so plain image references keep probing the local store until grype bumps syft.
- set `containers_image_openpgp,exclude_graphdriver_btrfs` everywhere the linux build tag applies (goreleaser, unit, integration, race smoke, golangci-lint), so Go tooling compiles the provider that ships. The btrfs exclude avoids needing libbtrfs headers on cgo builds.
- run the e2e through `make containers-storage-test BUILDER=podman|buildah`. It now covers `vfs` and `overlay` stores, runs rootless scans under `<builder> unshare`, asserts the image came out of the store, and checks that plain refs never touch it.
- README documents explicit usage and `podman unshare` for rootless stores.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* chore(deps): bump syft to main for explicit-only containers-storage

picks up anchore/syft#5368, which only uses the containers-storage provider when requested by name. This pins syft (and transitively stereoscope and go-rpmdb) to unreleased pseudo-versions; swap to the next syft release before merging.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* chore: tidy containers-storage CI and flag help

- fold the Podman and Buildah jobs into one matrix job pinned to `ubuntu-24.04`. Check names are unchanged, and the job carries the release.yaml rename note.
- list `containers-storage` in the `--from` flag help.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* test: drop provider config sources test covered by the containers-storage e2e

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* ci: reference the bootstrap action with self-repository syntax

zizmor's new `self-repository` audit flags `uses: ./...`. `uses: $/...` resolves from the workflow's own commit instead of the checked-out workspace, so a previous step can't swap the action on disk.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* ci: revert self-repository syntax, disable the zizmor rule instead

`uses: $/...` makes the runner download the repo as an action archive. Staging that archive fails because the archive omits submodules, so `test/quality/.yardstick/labels` (a symlink into the `vulnerability-match-labels` submodule) dangles. This goes back to `./...` and disables zizmor's `self-repository` audit with that reason.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Bruce Clark <bruce.clark@mandg.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Bruce Clark <bruce.clark@mandg.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-manual-review automated action that should be reviewed by a human

Projects

None yet

3 participants