OtherGitLab ComponentsDependency Risk Identification

Dependency Risk Identification

This workflow identifies potential security vulnerabilities in a project's dependencies. It requires a Software Bill of Materials (SBOM) as input to analyze and ensure that all dependencies are secure and up to date.

The dependency-risk-identification accepts the following inputs:

NameDescriptionRequiredDefault Value
api_urlThe DevGuard API URLNohttps://api.main.devguard.org
asset_nameName of the asset to scanYes
tokenAPI token for authenticating with DevGuardYes
scan_stageThe stage where the scan is runNotest
runner_tagsThe runner tags used to select appropriate CI runners.No""
sbom_fileThe SBOM file to use for the scanNotest
needsThe jobs that this job depends onNo""
dependenciesSpecifies the jobs whose artifacts this job relies onNo""

Usage Examples:

if you have the sbom in the repository:

include:
  - remote: "https://gitlab.com/l3montree/devguard/-/raw/main/templates/dependency-risk-identification@main"
      asset_name: "myOrgnaization/projects/myProject/assets/myAsset"
      token: "$DEVGUARD_TOKEN_TEST"
      sbom_file: "./sbom.json"
 

if you have the sbom in an artifact from a previous job:

trivy-sbom:
  stage: build
  image:
    name: aquasec/trivy:0.50.1
    entrypoint: [""]
  dependencies: []
  needs: []
  script: trivy sbom --format cyclonedx --output sbom.json $CI_PROJECT_DIR
  artifacts:
    paths:
      - sbom.json
 
include:
  - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/code-risk-identification@$CI_COMMIT_SHA
    inputs:
      asset_name: "myOrgnaization/projects/myProject/assets/myAsset"
      token: "$DEVGUARD_TOKEN_TEST"
      sbom_file: "./sbom.json"
      needs: "trivy-sbom:"
      dependencies: "trivy-sbom:"