This script interacts with the Snyk API to retrieve and update the Snyk Code (SAST) settings for multiple organizations. The script checks the current SAST settings, asks whether to update them, and provides an option to disable Snyk Code (SAST) settings for organizations where it is enabled.
- Python 3.6 or higher
- requests - Python library
- Snyk API Token (SNYK_TOKEN)
- Clone the repository
git clone https://github.com/esabou/get-orgs-with-sast.git
- Install dependencies
pip install -r requirements.txt
- Get a Snyk API Token
- Set Environment Variable
export SNYK_TOKEN=your_snyk_token
Running the script locally
- Ensure that you have set your SNYK_TOKEN environment variable
- Run the script:
python get-orgs-with-sast.py
- Provide the Group ID when prompted
- The script will identify all Organisations under that Group and their current SAST setting
- List all organizations
- Display the current SAST settings for each organization
- Ask if you want to disable Snyk Code (SAST) for organizations with SAST enabled