A Jupyter Notebook to learn how to use the GitGuardian APIs and experiment with automation.
This project contains 2 different notebooks.
API-Remediation-Workflow.ipynb
This notebook walks through using the GitGuardian API for:
- Authentication
- Listing triggered incidents
- Assigning incidents
- Unassign incidents
- Resovling incidents
- Ignoring incidents
- Sharing incidents
- Scaning for secrets in a file
GitGuardian-API-Automation-Examples.ipynb
This notebook shows 3 examples of automating workflows with the API and a little Python logic. The automations included are
-
- Auto-assign the newest incident to a random member of the workspace.
-
- Auto-assign incident to commit author if they are a member of the workspace.
-
- Ignore an incident and mark it as a 'test credential' if all occurrences of a secret are in a /test/ directory and invalid.
Prerequisites:
- You will need to have Jupyter Notebook installed for this to run locally.
- You will need to have a GitGuardian account with Owner (preferred) or Member access.
- The Python code requires installing the
requests
library.
- Clone this repo
cd
to the projecg folder locally.- Run the command
jupyter notebook
in your terminal. - Select one of the notebooks listed. If it is your first time, choose the
API-Remediation-Workflow.ipynb
file. - Follow the instructions in the notebook.