Snyk Code
Snyk Code
Overview
The Snyk Code integration connects the Praetorian Guard Platform (PGP) with your Snyk environment, importing SAST (Static Application Security Testing) findings to track application security vulnerabilities. PGP queries the Snyk REST API to discover organizations and projects within a Snyk Group, retrieves code analysis issues, and maps them as risks against their associated repository assets.
This integration is read-only — PGP never modifies projects, issues, or configurations in Snyk.
What the Integration Does
Organization discovery — PGP enumerates all organizations within your Snyk Group using the
/rest/groups/{groupID}/orgsendpoint.Project enumeration — For each organization, PGP fetches SAST projects (type
sast) via/rest/orgs/{orgID}/projects.Issue import — Code analysis issues are retrieved per project from
/rest/orgs/{orgID}/issuesand mapped to PGP risks with severity, CWE classifications, file paths, and line numbers.Asset creation — Each project's source repository is imported as a repository asset in PGP, serving as the container for all associated findings.
Severity Mapping
Filtering
The following issues are automatically excluded from import:
Issues marked as ignored in Snyk
Issues with status resolved
Prerequisites
A Snyk account with Snyk Code enabled
A Snyk API token (service account or personal)
Your Snyk Group ID
Required Permissions
The integration requires the following Snyk permissions:
Service account: Must be added as an Org Collaborator in each organization you want to scan
Normal user account: Must have Group Viewer permissions at the Group level
Creating an API Token
Log in to the Snyk Web UI
Click your account avatar in the bottom-left corner and select Account Settings
Under the General tab, locate the Auth Token section
Click Generate Token (or copy your existing token)
Copy the token — it is displayed only once
For service accounts, create the token via Settings → Service Accounts in your Snyk organization.
Finding Your Group ID
In the Snyk Web UI, navigate to your Group Settings
The Group ID is displayed in the General section, or visible in the URL:
https://app.snyk.io/group/{groupID}/...
Setup
In PGP, navigate to Integrations and locate Snyk Code under the Secure Code Scanning category.
Click Integrate.
Enter the following fields and click Connect.
PGP validates credentials by making a test call to GET /rest/groups/{groupID}/issues?type=code&limit=1.
What Data Is Synced
Issues to PGP Risks
SAST findings are imported as risks with CWE classifications, severity, file path, and line number
Each risk includes a definition with vulnerability description, remediation guidance, and CWE references
A proof file with source location details is attached for evidence and traceability
Issues marked as ignored or resolved are automatically excluded
Projects to PGP Assets
Each Snyk project's Git repository URL is imported as a repository asset
Repository URLs are resolved from the project origin (GitHub, GitLab, Bitbucket, Azure Repos)
Snyk API Endpoints Used
Base URL: https://api.snyk.io/rest
All requests are authenticated using an Authorization: token {api_token} header over HTTPS.
Troubleshooting
Security and Data Handling
Read-only access — PGP never creates, modifies, or deletes projects, issues, or configurations in Snyk
Credential handling — Your Snyk API token is stored as an encrypted credential within PGP and is never exposed in logs or the UI after initial entry
Authentication — Token-based authentication over HTTPS for every request
No source code access — Only issue metadata and project information are imported; no source code is accessed or stored
Integration category: Secure Code Scanning. Data direction: Read-only (Snyk to PGP). Authentication: Token-based.
Need help? Contact our support team for assistance.