For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to detect base images in SBOM

Track the deployment of your open-source components

The SBOM orchestration process extends beyond generating the SBOM. It also analyzes the artifact's metadata to determine the origin of each component within the image. These components are then labeled in the artifact view with tags such as app, base, and distro. This clear labeling pinpoints the origin of each component, offering deeper visibility into your software's composition, ultimately empowering you to effectively mitigate security risks.

  • App: components that are part of the application layer of your container image

  • Base: Image from which your application image originates.

  • Distro: The underlying operating system distribution used as the foundation for the container image. This could be a specific Linux distribution (e.g., Ubuntu, Debian, Alpine).

For easy identification, each component in the Artifact view is accompanied by a unique icon signifying its origin (app, base, distro)

The SBOM orchestration process now automatically recognizes and assigns "app" and "distro" tags to components. However, it labels components with the "base" tag solely in cases where the application’s image explicitly provides the label names for your base image and orchestrates the base image with SCS. Go to Base image identification for the details.

Base image identification

To enable the SBOM Orchestration step to accurately identify the Base image of your container, it is crucial to have the following things:

  1. The Dockerfile for your application should include the labels specifying the digest and name of your base image. For instance:

  2. Your pipeline should orchestrate the base image with SBOM orchestration step.

Incorporating these two steps allows the SBOM Orchestration step to delve deeper and effectively tag the component with the base image labels.

If you are not familiar with the details of your container's base image, or you prefer not to alter the Dockerfile, the subsequent section will guide you on how to leverage Harness CI to accomplish this for you.

Use Harness CI to build and push the image with labels in the Dockerfile

To incorporate base image labels into your Dockerfile and push the updated image, you will employ a shell script within a Docker-in-Docker (DIND) workflow. Ensure you initiate a background step utilizing the image docker:24.0.7-dind-alpine3.18.

Subsequently, add the script below into a Run step:

Remember to perform the following adjustments:

  1. Update the docker_user and docker_repo variables with your Docker Hub username and the repository name where you want to push the image.

  2. Configure your Docker registry login credentials, the build tag, and the location of the Dockerfile in the "Optional configuration" section of your run step. This ensures that the script has all the necessary information.

Following the provided instructions will enable the successful identification and tagging of the base image components. You can then view the details of your components in the Artifact view.

Last updated

Was this helpful?