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
severityis greater or equal, triggeraction - action:
trueto fail the test,falseto 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.
Metadata
Release files for dtrack-auditor 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dtrack_auditor-1.5.0.tar.gz | 30.7 kB | Without provenance | Details for dtrack_auditor-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtrack_auditor-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for dtrack_auditor-1.5.0-py3-none-any.whl |
Total release size: 61.2 kB
Release files / dtrack_auditor-1.5.0.tar.gz
| Download URL | dtrack_auditor-1.5.0.tar.gz |
|---|---|
| Size | 30.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33bc43c83a47043c96df2d329137b8faabcecb491ffaee377a3cc8c55091987f
|
|
BLAKE2b-256 checksum How to use checksums |
c70fbd0bc6ecf77b002c5af174c82d74c2d6b1adb19f883399f2cbf6576bd582
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Release files / dtrack_auditor-1.5.0-py3-none-any.whl
| Download URL | dtrack_auditor-1.5.0-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f46604d63ab0ff06d0b3778988cf60313512f05602509d7b61ba656f42c09275
|
|
BLAKE2b-256 checksum How to use checksums |
b30f9fffcb3fd5dc22532244ccacb8e3b51bfabf4d480c1acd58932e2fe4e91a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Security for dtrack-auditor 1.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.