Caution
We have moved here https://github.com/NashTech-Global/dtrack-analyzer
This script fetches project and component details from Dependency-Track, analyzes vulnerabilities, and generates a CSV report.
- Python 3.x installed
pipinstalledvirtualenvinstalled (optional but recommended)- Dependency-Track API access
git clone https://github.com/nashtech-garage/dtrack-analyzer
cd dtrack-analyzerCreate a virtual environment to isolate the project dependencies. You can do this using venv:
python3 -m venv venvActivate the virtual environment:
- On macOS/Linux:
source venv/bin/activate- On Windows:
venv\Scripts\activateInstall the required Python packages using pip:
pip install -r requirements.txtCreate a .env file in the root directory of your project with the following content:
DTRACK_URL=https://your-dependency-track-url.com/api
API_KEY=your_api_key_here
REPORT_FILE_NAME=report.csvReplace the placeholder values with your actual API URL, API key, and desired CSV file name.
Run the Python script to generate the CSV report:
python main.pyUpon successful execution, the application will generate a CSV file with the specified name containing the report data.
-
Environment Variables Not Loaded: Ensure that the
.envfile is present in the same directory asmain.pyand that it contains the correct variable names and values. -
HTTP Errors: If you encounter HTTP errors, verify that your
DTRACK_URLis correct and that your API key has the necessary permissions. -
Dependencies: If you experience issues related to missing modules, ensure that you have activated your virtual environment and that all packages are installed via
pip install -r requirements.txt.