> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

Snyk

Loading version...

Port's Snyk integration allows you to model Snyk resources in your software catalog and ingest data into them.

Prerequisites

  • A Snyk enterprise account.
  • A Port organization with admin permissions.
Snyk Enterprise

The Snyk API is available for Enterprise customers only. Authentication using personal tokens from Snyk Free or Team plans is not supported. Learn More.

Setup

Choose your preferred installation method below. Not sure which to pick? See the installation methods overview.

Configuration

Port integrations use a YAML mapping block to ingest data from the third-party api into Port.

The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.

Default mapping configuration

This is the default mapping configuration for this integration:

Default mapping configuration (Click to expand)
deleteDependentEntities: true
createMissingRelatedEntities: true
enableMergeEntity: true
resources:
- kind: organization
selector:
query: 'true'
port:
entity:
mappings:
identifier: .id
title: .attributes.name
blueprint: '"snykOrganization"'
properties:
slug: .attributes.slug
url: ("https://app.snyk.io/org/" + .attributes.slug | tostring)
- kind: project
selector:
query: 'true'
attachIssuesToProject: 'false'
port:
entity:
mappings:
identifier: .id
title: .attributes.name
blueprint: '"snykProject"'
properties:
url: ("https://app.snyk.io/org/" + .__organization.slug + "/project/" + .id | tostring)
businessCriticality: .attributes.business_criticality
environment: .attributes.environment
lifeCycle: .attributes.lifecycle
highOpenVulnerabilities: .meta.latest_issue_counts.high
mediumOpenVulnerabilities: .meta.latest_issue_counts.medium
lowOpenVulnerabilities: .meta.latest_issue_counts.low
criticalOpenVulnerabilities: .meta.latest_issue_counts.critical
tags: .attributes.tags
targetOrigin: .attributes.origin
relations:
snyk_target: '.relationships.target.data.id'
- kind: target
selector:
query: 'true'
attachProjectData: true
apiQueryParams:
exclude_empty: false # set to false to include targets with no associated projects
port:
entity:
mappings:
identifier: .id
title: .attributes.display_name
blueprint: '"snykTarget"'
properties:
origin: .relationships.integration.data.attributes.integration_type
relations:
snyk_organization: '.relationships.organization.data.id'
- kind: vulnerability
selector:
query: 'true'
port:
entity:
mappings:
identifier: .id
title: .attributes.title
blueprint: '"snykVulnerability"'
properties:
score: .attributes.risk.score.value
packageNames: '[.attributes.coordinates[].representations[].dependency?.package_name | select(. != null)]'
packageVersions: '[.attributes.coordinates[].representations[].dependency?.package_version | select(. != null)]'
severity: .attributes.effective_severity_level
url: ("https://app.snyk.io/org/" + .__organization.slug + "/project/" + .relationships.scan_item.data.id + "#issue-" + .attributes.key | tostring)
publicationTime: .attributes.created_at
status: .attributes.status
type: .attributes.type
relations:
project: .relationships.scan_item.data.id

Monitoring and sync status

To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.

Mapping & selectors per resource

Use the explorer below to view sample payloads and the resulting Port entities for each resource type.

Set up live events

This integration supports live events, allowing real-time updates to your software catalog without waiting for the next scheduled sync.

Live events base URL

For integrations installed using the Hosted by Port method, you can obtain the live events base URL from the Get an integration API. The response includes liveEventsUuid and liveEventsIngestHostname in the appSpec section.

Call the endpoint with your integration's identifier:

curl -X GET \
'https://api.port.io/v1/integration/<INTEGRATION_IDENTIFIER>' \
-H 'Authorization: Bearer <PORT_ACCESS_TOKEN>'
Selecting a Port API URL by account region

The port_region, port.baseUrl, portBaseUrl, port_base_url and OCEAN__PORT__BASE_URL parameters select which Port API instance to use:

In the response, look for the following fields under spec.appSpec:

{
"spec": {
"appSpec": {
"liveEventsUuid": "abcdefghijk",
"liveEventsIngestHostname": "ingest.ocean.getport.io"
}
}
}

Combine them to build the live events base URL:

https://<liveEventsIngestHostname>/live-events/<liveEventsUuid>

For example, with the values above, the live events base URL is:

https://ingest.ocean.getport.io/live-events/abcdefghijk

This is the same URL configured for the integration.

Supported live event triggers (Click to expand)
  • Project related events
  • Target related events