Improved client for OWASP DependencyTrack usage in CI CD.
Project description
DTrackAuditor
DTrackAuditor is the python script to ease usage of DependencyTrack in the CI, optionally failing the build based on different parameters.
Development and Tests
- python 3.11.8
- DependencyTrack 4.10
Features
- Auto mode for project creation given project name and version. Creates new project with version if already not found.
- Auto mode useful for CI pipeline.
- Optional filename path. Default is bom.xml
- Filter based on severity type (critical, high, medium, low, unassigned) and numbers, e.g.: if number of critical is higher or equal to 10.
- Check policy violations and fail if any found.
- Return 0 or 1 exit status for Auto mode.
Recommended usage
- For the latest update use clone this repo and use it as your preference.
Quick Install
- Pypi
thinksabin@DESKTOP:~$ pip install dtrack-auditor
thinksabin@DESKTOP:~$ dtrackauditor
- Docker image
docker pull thinksabin/dtrackauditor:latest
- Git
git clone https://github.com/thinksabin/DTrackAuditor.git
Usage
Basic Usage
- As a script:
python3 dtrackauditor.py \
-u 'http://mydtrack.local:8080' \
-k 'mydtrackapikey' \
-p myweb -v 1.0.0 \
-f myweb/target/bom.xml \
-a
(.venv) PS C:\Users\dells\OneDrive\Documents\GitHub\DTrackAuditor\dtrackauditor> ..\.venv\Scripts\python.exe .\dtrackauditor.py -a -u 'http://mydtrack.local:8080' -k 'mydtrackapikey' -p ddweb -v 1.0.0 -f .\test\bom.xml --wait
If environment variable for DTRACK_SERVER
and DTRACK_API_KEY
are present then the usage can be direct:
python3 dtrackauditor.py -p myweb -v 1.0.0 -a
If your DependencyTrack server is exposed through an HTTPS listener (e.g.
using an nginx or apache web-server as a reverse proxy for the UI and API
servers), and if this setup uses self-signed certificates or those issued by
a private (corporate) Certificate Authority, you may benefit from passing
a path to PEM file with the trust chain using DTRACK_SERVER_CERTCHAIN
environment variable or the -C
/--certchain
command-line argument.
Such argument may also be none
to trust any HTTPS server blindly.
- As a Docker container:
docker run --rm -v $PWD:/tmp \
thinksabin/dtrackauditor -- \
required parameters as examples
Vulnerability Rules
Auto mode for CI/CD with support for rules.
python3 dtrackauditor.py \
-u http://mydtrack.local:8080 \
-k mydtrackapikey \
-p hello \
-v 8.0.0 \
-a \
-r critical:1:true,high:2:true,medium:10:true,low:10:false
The rules are a list of:
<severity>:<count>:<action>
Where:
- severity: Either
critical
,high
,medium
,low
, orunassigned
- count: If the count of the issues for the
severity
is greater or equal, triggeraction
- action:
true
to fail the test,false
to just display a warning (default istrue
)
Policy Violations
DtrackAuditor return with code 1 (fails the test) in case any Policy Violations detected. This feature is not configurable and cannot be disabled using command line options.
For enhancement
Please create issues for bug reports and suggestions. Thanks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dtrack_auditor-1.4.0.tar.gz
.
File metadata
- Download URL: dtrack_auditor-1.4.0.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c547df3f5525b0a94e992483a0f33b94dc649af2a59a83791ee3b6fcf3270bbe |
|
MD5 | 16a41cd2e07e6aa606ab4ec1bfa07b1b |
|
BLAKE2b-256 | 9f940c90e2dec41ce0a526f977c66dfdd6956e55dd2c3c64433d435935b391ef |
File details
Details for the file dtrack_auditor-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: dtrack_auditor-1.4.0-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b013a4c710efbdbf427068541e95b389248b6791140ba636c7087818b07fbf6d |
|
MD5 | 8189e3cfa305b4e8933b61a683fba9e4 |
|
BLAKE2b-256 | 1bcd951ac5989609a42bea6ca783dc47a11ab7f57d9738321f37a253fdd17316 |