You can use Snyk to test your code in multiple ways.
- Manually; using the Snyk CLI, the Snyk app, and the Snyk API.
- Snyk can also run tests automatically; on a recurring basis, or when a relevant repo change is made.
With our CLI: you can use the following commands:
- Scan open-source code with snyk test.
- Scan container images with snyk container test.
- Scan Infrastructure as Code (IaC) files with snyk iac test.
See Getting started with the CLI for details.
A test is run when you add a new project or click the re-test button.
See Getting started with Snyk products for details.
Tests are counted when calls are made to the https://snyk.io/api/v1/test endpoint.
See API documentation for details.
Snyk provides automatic scanning functions with recurring tests, allowing you to catch new vulnerabilities automatically. After you import a project, Snyk automatically runs periodic checks to see if your code is affected by newly disclosed vulnerabilities.
snyk monitor CLI command to create a snapshot of a project on the Snyk website that will be continuously monitored for new vulnerabilities.
See Monitor your projects at regular intervals for details.
Automatically testing PRs / MRs
By default, Snyk scans every pull request submitted on your monitored repositories, showing the results and recommendations grouped together in a single security check and a single license check.
See Enable Snyk test on PRs for more details.