A Jupyter Notebook to learn how to use the GitGuardian API 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 an individual file - Note: For this use case, you would be better off with ggshield or py-gitguardian.
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 an Owner or Manager role.
- The Python code requires installing the
requests
library.
- Clone this repo
cd
to the project 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.