This pipe is used to perform OWASP dependency checks using jeremylong/DependencyCheck
Add the following your bitbucket-pipelines.yml file:
- step:
name: "Code Standards check"
script:
- pipe: docker://ghcr.io/aligent/owasp-dependency-check-pipe
variables:
SCAN_PATH: "./composer.lock"
CVSS_FAIL_LEVEL: "1"| Variable | Usage |
|---|---|
| SCAN_PATH | Relative paths to scan. Default: repository root. |
| CVSS_FAIL_LEVEL | (Optional) If the score set between 0 and 10 the exit code from dependency-check will indicate if a vulnerability with a CVSS score equal to or higher was identified. |
| SUPPRESSION_FILE_PATH | (Optional) Path to a suppression list |
| DISABLE_OSSINDEX | (Optional) Disable OSS Index Analysis. Boolean. Default: true |
| OSSINDEX_USERNAME | (Optional) Provide OSS Index Username. Disregarded when DISABLE_OSSINDEX is set True |
| OSSINDEX_PASSWORD | (Optional) Provide OSS Index Password. Disregarded when DISABLE_OSSINDEX is set True |
| NVD_API_KEY | (Optional) Provide an API key for NVD. |
| OUTPUT_PATH | (Optional) Path to output test results. |
| UPDATE_DB | (Optional) Pass true if that database should be updated. Defaults to false |
| EXTRA_ARGS | (Optional) Extra arguments to pass to dependency-check. i.e --disableRetireJS |
package-lock.json or yarn.lock and node-modules as SCAN_PATH.
The following command with world-writable test-results directory under project root can be used to invoke the pipe locally:
docker run --rm -e OUTPUT_PATH="/tmp/test-results/" -e CVSS_FAIL_LEVEL=1 -e SCAN_PATH=./composer.lock -v $PWD:/build --workdir=/build ghcr.io/aligent/owasp-dependency-check-pipeDocker images are built and pushed to GitHub Container Registry (ghcr.io/aligent/owasp-dependency-check-pipe) via GitHub Actions. The workflow:
- Triggers on pushes to
mainbranch - Runs daily (2am UTC) to update the NVD database
- Can be manually triggered with optional cache bypass
Configure the following secrets in your GitHub repository:
| Secret | Description |
|---|---|
NVD_API_KEY |
NVD API key for faster database updates |
The workflow uses GitHub Actions cache to store Docker build layers, significantly reducing build times for subsequent builds. The scheduled daily rebuild reuses the cached NVD database layer and applies delta updates. A full, uncached database download only happens on a manual trigger with the "Force NVD database update" option enabled.