Add a Snyk Integration
- In the OpsLevel app, Click Integrations in the left sidebar.
- Click on the + New Integration button.
- Click the Snyk tile to add the integration.
Create a Check
- Navigate to the Rubrics sub menu under the Service Health menu in OpsLevel
- Hover over the cell that corresponds to the level and category you want your check to live in and click the + Add Check button.
- Create a Custom Event check
- Select the Snyk integration you created from the Integration dropdown
Choose one of the Check Templates from the dropdown.
Here is what each template is for:
- No Critical Vulnerabilities: Any service that has critical vulnerabilities in its package manifest file will fail this check.
- No High Vulnerabilities: Any service that has high vulnerabilities in its package manifest file will fail this check.
- Less than 3 Medium Vulnerabilities: Any service with 3 or more medium vulnerabilities in its package manifest file will fail this check.
- Less than 5 Low Vulnerabilities: Any service with 5 or more low vulnerabilities in its package manifest file will fail this check.
- We will populate the Service Specifier field, which we use to determine what service to run the check for, and the Success Condition field, which we use to determine if the check should pass or fail. We also provide a sample payload to test the check.
Send payload to OpsLevel
snyk test --prune-repeated-subdependencies --json | curl -X POST http://app.opslevel.local:5000/integrations/custom_event/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \ -H 'content-type: application/json' --data-binary @-
This will send all the vulnerabilities for the service to OpsLevel and we will execute the check that was created in the previous step.
You will need to substitute the endpoint URL from the Snyk Integration you created in place of
To learn more about the Snyk CLI, you can read their docs.