Import Projects
How to import Projects into Snyk using an SCM integration or the Snyk CLI with CI/CD
Depending on the integrations you have configured, and the languages and package managers in your tech stack, you can import Projects into Snyk using:
A source control integration with your Git repositories
The Snyk CLI with CI/CD
The best import route varies based on the languages and package managers in your tech stack.
Complete Configure integrations before you import, and use an account with the Add Project permission for your Organization, such as Org Admin or Org Collaborator.
The following key points help you determine the best starting point.
Depending on your needs, Snyk offers various integration methods.
SCM integration
For details, visit SCM integrations.
Connect your repositories for automatic scanning.
For a small number of applications, typically fewer than 100:
In the Snyk Web UI, navigate to Settings > Integrations > All integrations and connect to your Git repositories.
In the integration settings:
Disable the automatic fixes and PR and MR checks when you first onboard Projects.
Enable them after you reach a steady state and want blocking.
From the Projects page, add the Projects.
Monitor results in Git code repositories.
The import succeeds when the repositories you added appear as Projects on the Projects page and Snyk reports their issues.
For hundreds or thousands of repositories:
At scale, Snyk recommends using the API. APIs are available with the Snyk Enterprise plan.
Use the Snyk API to import your Projects. This uses an existing source control integration, and you can use it to automate processes.
The API-import tool uses the API to manage onboarding at scale for large enterprises and is the recommended tool at scale. The source control structure needs to be mirrored.
Snyk CLI
For details, visit Snyk CLI.
Use the CLI for granular scanning of individual Projects.
To use the Snyk CLI:
Install the CLI using one of the appropriate methods as part of the build script.
Authenticate to use the CLI by using the
snyk authcommand or an environment variable.In the script, navigate to the Project folder.
Run the appropriate
snyk testorsnyk monitorcommands and options for the type of scan you want to run. Where to implement testing in your scripts is generally flexible, but it is most common before deployment. Use themonitorcommand alone for Snyk Open Source and Snyk Container to report passively. When you use gating through thetestcommand, the purpose is to break the build if Snyk finds issues that meet particular criteria, such as--severity-threshold, or any number of options in the CLI or thesnyk-filterplugin. In general, run Snyk Open Source withtest,monitor, or both after the dependencies are installed on the build system. Typical commands look as follows:Code:
snyk code test --org=[org-id]Open source:
snyk test --all-projects --org=[org-id]snyk monitor --all-projects --org=[org-id]Replace[org-id]with the ID of your Organization.
For container and IaC scans, the commands vary based on the type being scanned. For details, visit Container and Infrastructure as Code.
Review results either locally when running
snyk test, or in the Snyk Web UI when usingmonitoror report.
The CLI is working when snyk test returns its results in the terminal and, after snyk monitor, the Project appears on the Projects page.
For demonstrations of various pipeline integrations, visit Snyk Labs CI/CD integration examples.
Last updated
Was this helpful?

