Step 7 - Generating a SBOM

- Thomas Jungbauer Thomas Jungbauer ( Lastmod: 2024-07-02 ) - 3 min read

A software bill of materials (SBOM) offers an insight into the makeup of an application developed using third-party commercial tools and open-source software. It is a machine-readable, formally structured list of all components. This list is important to gain visibility into what risks might exist in a package and their potential impact. It allows to prioritize the risks and define a remediation path. The teams can use the SBOM to monitor all components that are used across an application.

We will create a Task that will generate a SBOM and uploads it into an SBOM repository.


The goals of this step are:

  • Install a SBOM repository.

  • Generate a SBOM and upload it to the repository.

Tool/Standard CycloneDX

OWASP CycloneDX is a full-stack Bill of Materials (BOM) standard that provides advanced supply chain capabilities for cyber risk reduction. The specification supports:

  1. Software Bill of Materials (SBOM)

  2. Software-as-a-Service Bill of Materials (SaaSBOM)

  3. Hardware Bill of Materials (HBOM)

  4. Operations Bill of Materials (OBOM)

  5. Vulnerability Disclosure Reports (VDR)

  6. Vulnerability Exploitability eXchange (VEX)

Strategic direction of the specification is managed by the CycloneDX Core Working Group, is backed by the OWASP Foundation, and is supported by the global information security community.

The CycloneDX module for Node.js creates a valid CycloneDX Software Bill-of-Materials (SBOM) containing an aggregate of all project dependencies. CycloneDX is a lightweight SBOM specification that is easily created, human and machine-readable, and simple to parse.

We will use this standard and will deploy a small Pod in our cluster to be able to upload our SBOM locally.

Install CycloneDX Repository Server

We can install a CycloneDX Repository Server, which is a simple Pod running in our cluster. You can use the following Argo CD application, which will create the Namespace (cyclonedx),Deployment, Route, and Service.

kind: Application
  name: in-cluster-install-cyclonedx
  namespace: openshift-gitops
    namespace: cyclonedx
    server: 'https://kubernetes.default.svc'
    - name: Description
      value: Install CycloneDX SBOM Repository
  project: in-cluster
    path: clusters/management-cluster/cyclonedx (1)
    repoURL: ''
    targetRevision: main
1Path and URL to the Git repository.

In Argo CD the following Application will be created:

CycloneDX Installation
Figure 1. CycloneDX Installation

Update the Tekton Pipeline

  1. Update the TriggerBinding globex-ui and add the following:

        - name: cyclonedxHostUrl
          value: >-
    1DO NOT add a trailing slash here.
  2. Update the TriggerTemplate and add the following to the appropriate blocks:

        - description: Cyclonedx host url
          name: cyclonedxHostUrl (1)
              - name: CYCLONEDX_HOST_URL
                value: $(tt.params.cyclonedxHostUrl) (2)
    1The parameter defined in the TriggerBinding
    2The parameter as it will be provided to the Pipeline.
  3. Install the following Task

    kind: Task
      name: generate-sbom
      namespace: ci
      params: (1)
        - default: >-
          name: cyclonedxHostUrl
          type: string
        - default: 'cyclonedx/cyclonedx-node'
          name: cycloneDXnodeImage
          type: string
        - description: The url location of the generate SBOM
          name: sbomUrl
          type: string
        - image: $(params.cycloneDXnodeImage)
          name: generate-sbom
              memory: 1Gi
          script: > (2)
            apk add git curl
            npm install .
            /usr/src/cyclonedx-bom/bin/make-bom.js -o bom.xml
            curl -v -k $(params.cyclonedxHostUrl)/v1/bom -H "Content-Type:
            application/vnd.cyclonedx+xml; version=1.4" -H "Accept: */*" -d @bom.xml
            -D /tmp/header.txt
            LOCATION=$(cat /tmp/header.txt | grep location: | awk '{print $2}' | sed
            printf "%s" "$LOCATION" > "$(results.sbomUrl.path)"
            echo "SBOM URL accessible on Results of TaskRun $("
          workingDir: /workspace/repository
        - name: repository
    1Default parameters for this task. Might be overwritten, by the EventListener
    2Script to be executed. It will download a script and upload the SBOM to our CycloneDX server.
  4. Update the Pipeline object

        - name: CYCLONEDX_HOST_URL (1)
          type: string
        - name: generate-sbom (2)
            - name: cyclonedxHostUrl
              value: $(params.CYCLONEDX_HOST_URL)
            - build-sign-image (3)
            kind: Task
            name: generate-sbom
            - name: repository
              workspace: shared-data
    1Add this to the parameter section
    2The new Task to generate a SBOM
    3Run after build-sign-image (and in parallel to the ACS tasks)
Figure 2. Pipeline

Execute the Pipeline

Let’s trigger the pipeline again. If everything works well, the URL to the uploaded SBOM will be visible in the TaskRun log.

Figure 3. Pipeline

When you open this URL, you will get a huge list of components end dependencies.

For example, the following snippet shows that the angular component animations (version 13.2.6) is used.

  <component type="library" bom-ref="pkg:npm/%40angular/animations@13.2.6">
  <description>Angular - animations integration with web-animations</description>
    <reference type="website">
    <reference type="issue-tracker">
    <reference type="vcs">


This concludes our security scans for the whole build process. With the SBOM you have now a complete list of components and dependencies of your images.

During the next steps, we will work with the Kubernetes manifests and update them, perform a linting on these manifests, and try to deploy the updated image to our DEV environment.