A command-line tool for tracking remediated vulnerabilities in Contrast Security applications
Project description
contrast-vuln-remediations
A command-line tool for tracking remediated vulnerabilities across Contrast Security applications. This tool helps identify vulnerabilities that have been fixed by comparing open vulnerabilities against those found in the latest application session.
Features
- Fast, asynchronous API querying with concurrent requests
- Progress tracking for large datasets
- CSV export for detailed analysis
- Summary statistics including remediation counts and percentages
- Configurable batch size and concurrency
- Branch-specific analysis
- Environment-based configuration
- Rich terminal output with color-coded results
- Resilient API handling with automatic retries and rate limiting
Installation
- Install:
pip install contrast-vuln-remediations
- Create a
.envfile with your Contrast Security credentials:
CONTRAST_BASE_URL=https://app.contrastsecurity.com/Contrast
CONTRAST_ORG_UUID=your-org-uuid
CONTRAST_API_KEY=your-api-key
CONTRAST_AUTH=your-auth-header
Usage
Basic usage:
contrast-vuln-remediations
With all options:
contrast-vuln-remediations \
--csv output.csv \
--concurrent-requests 20 \
--branch main \
--branch develop \
--verbose
Options
--csv: Output file path for detailed CSV results--concurrent-requests: Maximum number of concurrent API requests (default: 10)--branch: Branch name(s) to analyze (can be specified multiple times, defaults to ['main', 'master'])--verbose: Enable verbose logging
Output
The tool provides a summary of remediated vulnerabilities including:
- Total number of applications analyzed
- Number of vulnerabilities currently open
- Number of remediated vulnerabilities
- Percentage of vulnerabilities remediated
- Detailed breakdown by application
Example output:
Starting analysis...
Analyzing applications: 100% ██████████ 15/15
Vulnerability Analysis Summary
┌──────────────────────────┬────────────┐
│ Total applications │ 15 │
│ Open vulnerabilities │ 428 │
│ Remediated vulns │ 132 │
│ Remediation percentage │ 30.8% │
└──────────────────────────┴────────────┘
Detailed results have been written to: output.csv
CSV Output Format
The CSV output includes three columns:
Application: The application nameAppID: The application IDOpenVulns: Number of open vulnerabilitiesRemediatedVulns: Number of remediated vulnerabilities
Example:
Application,AppID,RemediatedVulns
My App 1,12345,25,10
My App 2,67890,18,5
Environment Variables
| Variable | Description | Example |
|---|---|---|
| CONTRAST_BASE_URL | Contrast Security API URL | https://app.contrastsecurity.com/Contrast |
| CONTRAST_ORG_UUID | Organization UUID | 12345678-90ab-cdef-1234-567890abcdef |
| CONTRAST_API_KEY | API Key | your-api-key |
| CONTRAST_AUTH | Authorization header | base64-encoded-credentials |
Development
Requirements:
- Python 3.8+
- httpx
- typer
- rich
- python-dotenv
- tqdm
License
Apache License
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run the tests
- Submit a pull request
Support
For issues, questions, or contributions, please open an issue in the GitHub repository.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contrast_vuln_remediations-0.2.0.tar.gz.
File metadata
- Download URL: contrast_vuln_remediations-0.2.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cc0953057a3f6be45debc5f1d81a025ef5333fbd0865317c9302996013baac1
|
|
| MD5 |
406af99ae75cfd1c3bb8a81a9839b408
|
|
| BLAKE2b-256 |
1801b39207178e17a764044bffd01c350444a52c4ab71a21cedd5c3b467b741a
|
File details
Details for the file contrast_vuln_remediations-0.2.0-py3-none-any.whl.
File metadata
- Download URL: contrast_vuln_remediations-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31e9b07a6d24fd58b9389eb31887c6dd8a6d185cc5e183d65f6d24199c971cb7
|
|
| MD5 |
c27cf0bafefa889276542160593592b6
|
|
| BLAKE2b-256 |
feea0abcbe6b2aa107683680afd1a73c99957a8e741be78e631dd4c0ad53a948
|