Safeguard
Security Guides•

How do you scan images built with Cloud Native Buildpacks?

Buildpack images are ordinary OCI images, but the run image and rebase step change who fixes what. Here is how to scan and patch them in practice.

Safeguard Security Team
6 min read

Scan a buildpack-built image the same way as any OCI image, by its digest, because that is what it is. What differs is the fix path: operating system findings usually come from the run image and can be addressed with a rebase, while application findings come from your code and dependencies.

What a buildpack image is made of

The Cloud Native Buildpacks documentation describes a builder as an OCI image that holds an ordered set of buildpacks, a build-time base image, a lifecycle binary and a reference to a runtime base image. A build runs buildpacks against your source to produce a runnable OCI image. The run image is the base for the app image.

So the final image has two origins: the run image supplies the operating system layer, and the buildpacks and your source supply the runtime and application layers.

Scanning is the same, reading is different

Any scanner that reads OCI images can scan the output. There is no special mode to ask for. When reading results, sort findings by layer origin:

Finding is inLikely originUsual fix
OS packagesRun imageRebase onto an updated run image
Language runtimeA buildpackUpdate the buildpack or builder
Application librariesYour dependency filesUpdate the dependency and rebuild

What rebase does

The documentation explains that rebase lets app developers or operators rapidly update an app image when its runtime base image has changed. Instead of rebuilding from source, the tooling swaps the base layers under your application layers. That makes OS patching faster, since you do not need to run the whole build.

Rebase only changes the base layers, so scan the result afterward rather than assuming it worked. Read the rebase documentation for your platform before you automate it.

A routine that works

  1. Scan the image by digest after each build.
  2. Group OS findings and check whether a newer run image exists.
  3. If it does, rebase, then scan the new digest and confirm the findings are gone.
  4. Handle application findings through your normal dependency update flow.
  5. Rescan deployed digests on a schedule, since new CVEs appear after release.

Run image mirrors

The docs also describe run image mirrors, which are alternate locations for a run image used during build or rebase. If you use mirrors, make sure the mirror is updated at the same pace as the original, or a rebase may pull an older base than you expect. Record which run image digest each app image used.

Common mistakes

  • Assuming the builder's name tells you the patch level. Check the digest.
  • Scanning only source dependencies and missing the OS layer.
  • Rebasing without scanning afterward to confirm the fix landed.

A worked example: an OS finding and a library finding

A team builds a service with buildpacks and scans the result. The scan returns two notable findings.

FindingLayer originWho actsHow
A flaw in an operating system libraryRun imagePlatform teamMove to an updated run image and rebase
A flaw in a web framework libraryApplication dependenciesService teamUpdate the dependency and rebuild

The service team tries to fix the first by editing its own dependency file and sees no change. That is the typical confusion. The operating system library comes from the run image, so the right action is on the base, not on the app.

Because the documentation describes rebase as a way to update an app image when its runtime base image has changed, the platform team can publish an updated run image and let every service pick it up by rebase, without a full rebuild from source in each repository.

Step by step: a patch routine for buildpack images

  1. Inventory which builder and run image each service uses. Record digests.
  2. Scan every app image by digest.
  3. Split findings by origin using the table above.
  4. For OS findings, check whether a newer run image exists and whether it fixes the finding.
  5. Roll the updated run image out by rebase, service by service, starting with a low risk one.
  6. Rescan each new digest and compare with the old result.
  7. Handle library findings through your dependency update flow.
  8. Record the run image digest used for each release.

Testing a rebase before you roll it everywhere

A base update can change behavior, so test it.

  • Run your normal integration tests against the rebased image.
  • Compare the scan results of the old and new digest, and check that new findings did not appear.
  • Roll out to a canary first, then widen.
  • Keep the old digest available for quick rollback.

Questions for a vendor

  • Can you scan an OCI image from my registry with no special buildpack knowledge?
  • Do findings show which layer introduced a package, so I can tell run image from application?
  • Can you report the base image digest for each scanned image?
  • Can you compare two digests and show what changed?

Common mistakes

  • Treating all findings as the app team's job.
  • Pinning to a run image tag and never updating it.
  • Running a rebase without a rescan.
  • Using mirrors without checking that the mirror is current.

Try it yourself

Click through it at your own pace, or open it full screen.

Look at how findings split between operating system packages and application packages.

Where Safeguard fits

Safeguard scans image contents and dependencies and can open fix pull requests for application dependencies when you enable that. You can try a free scan at gold.safeguard.sh/scan.

Quick check

Do I need a special scanner for buildpack images?

No. The output is an OCI image, and standard image scanning applies.

Does rebase remove the need to scan?

No. Scan the new digest afterward to confirm findings are gone and that no new ones appeared.

Who should own the run image?

Usually a platform or base image team, so one group updates it and every service benefits. App teams own their own dependencies.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.