Some Semgrep features require additional levels of code access. You can grant these permissions to Semgrep by assigning additional scopes to the access token that facilitates communication between Semgrep and the source code manager (SCM). The following table shows the minimum scope needed to enable the required code access level.Documentation Index
Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
Use this file to discover all available pages before exploring further.
Required SCM code access scopes
| SCM | Read access scope | Write access scope |
|---|---|---|
| Azure DevOps | code:read | code:write |
| Bitbucket Cloud | repository:readpullrequest:read | repository:writepullrequest:write |
| Bitbucket Data Center | repository:read | repository:write |
| GitHub.com and Github Enterprise | contents:read | contents:write |
| GitLab and Gitlab Self-Managed | read_repository | write_repository |
Grant code access to Semgrep with a private GitHub app
If you already have a private Semgrep GitHub app set up and configured for your deployment that doesn’t have code access enabled, follow these steps to update the app and grant code access to Semgrep.Navigate to the GitHub Application permissions and events page. GitHub Enterprise users must replace the
i. For organization accounts, go to
ii. For user accounts, go to
https://github.com base URL with the base URL of the GitHub Enterprise instance.i. For organization accounts, go to
https://github.com/organizations/ORGANIZATION_NAME/settings/apps/APP_SLUG/permissions.ii. For user accounts, go to
https://github.com/settings/apps/APP_SLUG/permissionsUnder Contents, change the access level to Read and write. If you don’t want to grant write permissions, change the access level to Read.
Grant code access to Semgrep with an access token
If you onboarded your repositories using an access token, then you can follow these steps to grant code access to Semgrep.- Azure DevOps Cloud
- Bitbucket Cloud
- Bitbucket Data Center
- GitHub
- GitLab
Navigate to the Azure DevDps access token settings page:
https://dev.azure.com/ORGANIZATION_NAME/_usersSettings/tokens.Click New token to launch the Create a new personal access token dialog. Ensure that you assign the
Code: Read and Code: Write scopes to the token, in addition to any other scopes you may need for other features you’ve enabled for your Semgrep deployment. Create the token, and copy its value.Return to Semgrep AppSec Platform, and go to Settings > Source code managers.