Snyk SCM Integrations
You can integrate Snyk with your Git repository to quickly and easily gain visibility across all the Snyk Projects that you add to your Projects list.
This page contains information about the following Snyk SCM integration aspects:
Overview
When you want to add new integrations to your Snyk account you must first decide the level type at which you want to install the integration. Snyk supports different SCM integrations on different levels of the Snyk hierarchy:
Group level - Group level integrations only support Snyk AppRisk Essentials or Snyk AppRisk Pro.
Organization level - Organization level integrations support all other Snyk products. Snyk does not support Snyk AppRisk Essentials or Snyk AppRisk Pro integrations at the Organization level.
If you added the GitHub integration at Organizational and/or Group levels and you have configured SAML SSO for it, then you must authorize your GitHub PAT. Navigate to the How to authorize your Personal Access Token and enable SSO page for more details.
Group level - Snyk AppRisk SCM integrations
At the Group level, you can set up and customize your Snyk AppRisk integrations from the Integrations Hub where the following SCMs are available:
Snyk AppRisk Group-level SCM integrations provide broader visibility into all the application assets for a given customer and pull in the additional application context and, or metadata, for example, information on developers, commits, and so on.
If your SCM instance is not publicly accessible, you must connect using Snyk Broker. For details, see Snyk Broker - AppRisk.
The Integrations page at the Group level shows all active integrations, including any data automatically synced from your existing Snyk Organizations, and provides access to the Integration Hub.
The SCM integrations use an incremental approach to retrieve repositories. This means that when a sync is initiated, it checks the last update time of the repository and only transfers the repositories that have been modified since then.
If there have been changes to the scope of the user or PAT used for the integration, any repositories that are newly within scope will only be identified after either a change to trigger the incremental collection or a change to the integration configuration itself.
The following supported Snyk data are automatically synced:
Snyk Open Source
Snyk Code
Snyk IaC
Snyk Container
Each connected integration enables you to:
Pause data syncing
Modify integration profiles and configurations
Delete the integration
Check when the integration was last synced and when the next sync is scheduled.
Wildcard SCM integration
The wildcard integration allows you to use a special character to detect and integrate multiple SCM organizations simultaneously.
The wildcard integration applies to the GitHub and Azure DevOps integrations and offers support when you set them up using Snyk Broker.
You can use the wildcards while setting up your integration using the Integration Hub:
Open the Integration Hub menu.
Select the SCM tag and search for GitHub or Azure DevOps.
Click the Add button.
In the Organizations field, add the Organization details by using the
*
symbol. For example, using*snyk
integrates all SCM Organizations that have Snyk in their name.All the Organizations that match with the wildcard,
*
symbol will be added.
The wildcard, *
symbol is considered a living command and will be applied every time you are rescanning your repositories.
Snyk AppRisk integrations ecosystem
You can refer to the table below to verify the availability and compatibility of all integrations for Snyk AppRisk. The integrations are categorized by type, listed by name, and indicated as available or not for both Snyk AppRisk Essentials and Snyk AppRisk Pro.
Integration type | Integration name | Snyk AppRisk Essentials | Snyk AppRisk Pro |
---|---|---|---|
SCM | ✔️ | ✔️ | |
Dev portals and Service catalogs | ✔️ | ✔️ | |
Risk management collaboration | ✔️ | ✔️ | |
AST | ✖️ | ✔️ | |
Runtime security and observability | ✖️ | ✔️ |
Using the Integration Hub
Use the Integration Hub page to onboard integrations and populate Snyk AppRisk with data from SCM tools.
See the Snyk Web UI page for step-by-step instructions on how to set up an integration.
After the integration is validated, a card is displayed on the Integrations page, allowing you to enable or disable the connection, edit the settings, or remove the connection from your configuration.
If you modify the permissions and scopes after the initial configuration, it is essential to either initiate an import or implement a change within the repository. This action allows Snyk to acknowledge and incorporate the updates effectively.
Using Snyk Broker
If your SCM instance is not publicly accessible, you need Snyk Broker. You can install and configure your Snyk Broker using Docker or Helm. For more information about Snyk Broker, see the Snyk Broker documentation, including Snyk Broker - AppRisk.
Enable the Snyk AppRisk flag in your Snyk Broker deployment environment before running the commands.
You can find on GitHub all the updated .json
files that include the allowed list of accessible endpoints for the integrations.
Organization level - Snyk SCM integrations
Snyk provides seamless integrations with various source control management systems such as GitHub, GitLab, Bitbucket, and Azure Repos at the Organizational level. These integrations enable you to automatically scan for vulnerabilities and receive actionable insights to enhance the security of your repositories. By integrating at this level, you can ensure comprehensive protection for all your Projects within the Organization.
Snyk Source Control Manager (SCM) integrations allow you to:
Continuously perform security scanning across all integrated repositories
Detect vulnerabilities in your open-source components
Provide automated fixes
Snyk can integrate with the following SCMs to help you track, monitor, and fix the issues and vulnerabilities in your code:
Workspaces for SCM integrations
This feature is available for GitHub, GitHub Enterprise, GitLab, Bitbucket Server, Bitbucket Cloud App, Bitbucket Cloud (Legacy), and Azure Repos (TFS) integrations.
The Workspaces feature enables Snyk to ingest a temporary snapshot of repository contents, and all commit metadata through your configured SCM integrations.
For detailed information on this feature, including enablement steps, see Workspaces for SCM integrations.
Deployment order recommendations
If you try to implement all the SCM integration features at the same time, you risk causing friction in your software development life cycle (SDLC), which in turn leads to a poor developer experience.
To ensure a smooth rollout of Snyk across your organization, Snyk provides a suggested deployment timeline consisting of deployment stages, configuration steps, and the desired outcome for each stage.
For detailed steps, see Deployment recommendations for SCM integrations.
User permissions and access scope requirements
Snyk SCM integrations may require different permission requirements based on the connection method.
See the following for detailed permission requirements:
Personal Access Token (PAT) scopes and repository permission requirements for SCMs
For information about token permissions in a brokered integration, see GitHub - prerequisites and steps to install and configure Broker and Integrated SCM tokens for Snyk Broker.
The Snyk GitHub Enterprise integration is bound to a single user, preferably a GitHub service account. The level of access for the integration is defined by the combination of the user's permissions in GitHub and the access defined for the Personal Access Token (PAT) on that user's account. If the PAT is defined with more permission than the user's GitHub account, the integration will not be able to use that permission.
The following table details the access scopes required in GitHub and GitHub Enterprise for Personal Access Tokens (PAT) and the scopes required for Snyk to perform the required operations on monitored repositories, such as reading manifest files on a frequent basis and opening fix or upgrade PRs. GitHub custom roles are not supported.
Action and purpose | PAT scopes | Repository scopes |
---|---|---|
Daily/weekly tests: Read manifest files in private repositories. |
| ≥ |
Manual fix pull requests: Create fix PRs in monitored repositories. |
| |
Automatic fix and upgrade pull requests: Create fix or upgrade PRs in monitored repositories. |
| ≥ |
Snyk tests on pull requests: Send PR status checks whenever a new PR is created, or an existing PR is updated. |
| ≥ |
Initial configuration of Snyk tests on pull requests: Used to add SCM webhooks to the imported repo |
|
|
Import new Projects to Snyk: Present a list of all the available repos in the GitHub org in the Add Projects screen. |
|
A fine-grained PAT requires additional repository access scopes:
Administration: Read-only
Commit Status: Read and write
Content: Read and write
Metadata: Read-only
Pull requests: Read and write
Webhooks: Read and write
Members access: Read-only (Organization access scope)
The Administration: Read-only
permission on the PAT is crucial for Snyk to identify and list the user's accessible GitHub organizations, a prerequisite for importing a new Project.
Snyk uses PRs to tell GitHub Enterprise that a merge is to occur. To do this, change content is pushed into a branch, which requires the content: write
scope. A separate call is then made to create the fix PR, which requires the pull request: write
scope. GitHub Enterprise is then instructed to create a PR, merging the change branch into the default branch.
Snyk uses SCM webhooks to:
Track the state of Snyk pull requests when PRs are created, updated triggered, merged, and so on.
Send push events to trigger PR checks.
GitHub Cloud App permission requirements
The Snyk GitHub Cloud App integration uses role-based access control, meaning access control is not dependent on individual users or their role, it is instead tied to the app entity.
To set up the GitHub Cloud app integration you must be a:
Snyk Organization Admin.
GitHub Organization Admin.
GitHub Repository Admin (if installing through the GitHub UI).
While some permissions may be optional from GitHub’s perspective, they are necessary to support Snyk functions. These permissions cannot be customized for your individual needs because the app is registered under the Snyk Organization.
The following table states the required GitHub App permissions and scopes: