Giter Club home page Giter Club logo

cyclonedx-bitbucket-pipe's Introduction

Bitbucket Pipelines Pipe: CycloneDX Cdxgen sBOM Generator

A lightweight wrapper acount the popular @cyclonedx/cdxgen tool which will allow you to generates a CycloneDX compliant Software Bill of Materials directely from a Bitbucket Pipe. In order to keep the image size reasonalble, only node/npm, java, python and go is currently supported. To request new support be added file an issue in GitHub. Other languages/frameworks may work but they have not been formally tested.

The official copy this project is hosted on [Bitbucket] (https://bitbucket.org/ccideas1/cyclonedx-pipe/src/main/). In order to reach a diverse audience a copy of the repo also exists in [GitHub] (https://github.com/ccideas/cyclonedx-cdxgen-bitbucket-pipe). Pull Requests and issues should be opened in the GitHub copy and they will be synced back to Bitbucket.

YAML Definition

The following is an example of a bitbucket pipeline which installs npm dependencies and caches those dependencies in one step then uses those cached depdencies in the next step to build a CycloneDX sBOM. The following code snip would need to be added to the bitbucket-pipelines.yml file

pipelines:
  default:
    - step:
        name: Build and Test
        caches:
          - node
        script:
          - npm install
          - npm test
    - step:
        name: Gen CycloneDX sBom
        caches:
          - node
        script:
          - pipe: docker://ccideas/cyclonedx-bitbucket-pipe:1.0.0
            variables:
              CDXGEN_PROJECT_TYPE: 'node'
              CDXGEN_PATH_TO_SCAN: 'samples/node'
              CDXGEN_SPEC_VERSION: '1.4'
              CDXGEN_PRINT_AS_TABLE: 'true'
              CDXGEN_DEBUG_MODE: 'debug'
              DEBUG_BASH: 'false'
              OUTPUT_DIRECTORY: 'build'
        artifacts:
          - build/*

Another example without specifying the project type or a directory to scan. This will just recursively scan your directory, identify components and write them to the sBOM

pipelines:
  default:
    - step:
        name: Gen CycloneDX sBom
        script:
          - pipe: docker://ccideas/cyclonedx-cdxgen-bitbucket-pipe:1.0.0
            variables:
              CDXGEN_PATH_TO_SCAN: '.'
              CDXGEN_SPEC_VERSION: '1.4'
              CDXGEN_PRINT_AS_TABLE: 'true'
              CDXGEN_DEBUG_MODE: 'debug'
              DEBUG_BASH: 'false'
              OUTPUT_DIRECTORY: 'build'
        artifacts:
          - build/*

In both examples above the sBOM is written to the build directory. This directory will be archived.

Variables

Variable Usage Options Default
CDXGEN_SPEC_VERSION CycloneDX Specification version to use 1.4, 1.5 1.5
CDXGEN_PROJECT_TYPE Used to specify the project type See Docs none
CDXGEN_PATH_TO_SCAN Used to specify the path to scan none
CDXGEN_PRINT_AS_TABLE Print the SBOM as a table with tree true, false false
CDXGEN_DEBUG_MODE Set to debug to enable debug messages debug none
DEBUG_BASH Set to true to enable debug mode in bash true, false false
OUTPUT_DIRECTORY Used to specify the directory to place all output in build
SBOM_FILENAME Used to specify the name of the sbom file ${bitbucket-repo-name-sbom

Details

Generates a CycloneDX compliant Software Bill of Materials for a various project types. The generated sBOM will be created in the build directory and be named ${BITBUCKET_REPO_SLUG}-sbom.json

Example

A working pipeline for the popular auditjs tool has been created as an example. The pipeline in this fork of the auditjs tool will install the required dependencies then generate a CycloneDX sBOM containing all the ingredients which make up the product.

Support

If you'd like help with this pipe, or you have an issue, or a feature request, let us know.

If you are reporting an issue, please include:

the version of the pipe relevant logs and error messages steps to reproduce

Credits

This Bitbucket pipe is a collection and integration of the following open source tools

A big thank-you to the teams and volunteers who make these amazing tools available

cyclonedx-bitbucket-pipe's People

Contributors

ccyhm86 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.