Skip to content

Contrast-Security-OSS/CSR-Helpful-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSR Helpful Scripts

A collection of Python scripts to help you interact with the Contrast Security API and automate common tasks.

🚀 Getting Started

Prerequisites

  • Python 3.x (latest version recommended)
  • Contrast Security account with API access
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/Contrast-Security-OSS/CSR-Helpful-Scripts.git
    cd CSR-Helpful-Scripts
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up your credentials

    Create a .creds file in the root directory using the provided template:

    cp template.creds .creds

    Edit .creds and fill in your Contrast Security credentials:

    CONTRAST_URL=https://your-contrast-instance.com/Contrast
    ORG_ID=your-organization-id
    USERNAME=your-username
    API_KEY=your-api-key
    SERVICE_KEY=your-service-key
    APP_ID=your-app-id
    

    ⚠️ Important: Never commit the .creds file to version control. It's already included in .gitignore.

📝 Usage

Running a Script

  1. Navigate to the script directory:

    cd script-folder-name
  2. Run the script:

    python script-name.py
  3. Enter credentials:

    • If you have a .creds file configured, simply press Enter when prompted to use the saved credentials
    • Otherwise, manually enter your credentials when prompted

📂 Available Scripts

Script Description
app-add-label Bulk add or remove tags from applications
correlate-routes-to-vulns Determine if vulnerabilities still exist on routes
distribute-parent-app-rbac-to-children Distribute parent application RBAC to child applications
get-licensed-apps Get all licensed applications and their server information
get-licensed-servers Get all licensed servers
get-scan-data Retrieve scan data for SAST projects
inventory-windows-webapps Inventory Windows web applications
policy-add-to-all-orgs Add policies to all organizations
reporting Generate various reports (languages, vulnerabilities, protect vs assess)
scan-add-label Add labels to SAST scan projects
toggle-server-protect Toggle server protect license
vulnerabilities-by-business-unit Get vulnerabilities grouped by business unit
vulns-and-prompts Get vulnerability and prompt details

📖 Each script directory contains its own README.md with detailed usage instructions.

🐛 Bug Reports & Feature Requests

If you discover any bugs or have feature requests:

  1. Open an issue in this repository with details about the bug or feature
  2. Contact your CSA (Customer Success Architect) during your weekly/biweekly calls
  3. Submit a Pull Request if you've fixed a bug or added a feature

🔒 Security

  • Never commit credentials to version control
  • Keep your .creds file secure and private
  • Regularly rotate your API keys and service keys
  • Keep your Python dependencies up to date:
    pip install --upgrade -r requirements.txt

📄 License

See the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

For support, please contact your Contrast Security Customer Success Architect.


Note: These scripts are provided as-is for use by Contrast Security customers and partners. Always test scripts in a non-production environment first.

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •