# Snyk vulnerability monitoring with Coralogix

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fintegrations%2Fsecurity%2Fsnyk-vulnerability-monitoring-with-coralogix.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fintegrations%2Fsecurity%2Fsnyk-vulnerability-monitoring-with-coralogix.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

Export your [Snyk](https://snyk.io/) security testing data to Coralogix as Prometheus metrics, so vulnerability counts sit alongside the rest of your telemetry and can be alerted on and charted like any other metric.

The open-source [Snyk exporter](https://github.com/lunarway/snyk_exporter), written in Go by the LunarTech team, scrapes [Snyk's API](https://snyk.docs.apiary.io/#) and exposes the results in Prometheus format. Coralogix ingests them through [Prometheus RemoteWrite](https://coralogix.com/docs/integrations/metrics/prometheus.md).

## What you need [​](#what-you-need- "Direct link to what-you-need-")

* An active [Snyk account](https://snyk.io/), with access to the organization you want to monitor.
* A host that can run Docker and reach both the Snyk API and your Coralogix endpoint.
* A Coralogix [Send-Your-Data API key](https://coralogix.com/docs/user-guides/account-management/api-keys/send-your-data-api-key.md).

## Collect your Snyk organization ID and API key [​](#collect-your-snyk-organization-id-and-api-key- "Direct link to collect-your-snyk-organization-id-and-api-key-")

The exporter authenticates with a Snyk service account token and scrapes one organization at a time, so you need both values before you start.

1

<!-- -->

.

Open your organization's settings

In the Snyk sidebar, select your group, then your organization, then **Settings**.

2

<!-- -->

.

Copy the organization ID

Under **Organization ID**, select **Copy**.

3

<!-- -->

.

Open the service accounts page

Under **Organization API key**, select **Manage service accounts**.

[![Snyk organization settings page with the Settings menu item, Organization ID field, and Manage service accounts button marked](/docs/assets/images/Details-1024x497-348738791beefa8b4f1892742f21813b.webp)](https://coralogix.com/docs/assets/images/Details-1024x497-348738791beefa8b4f1892742f21813b.webp)

Shows where the organization ID and the service accounts entry point sit in Snyk's organization settings.

4

<!-- -->

.

Create a service account for Coralogix

Enter a **Name**, select a **Role**, then select **Create**. The role cannot be changed after creation.

5

<!-- -->

.

Copy the token

Copy the generated organization API key. Snyk shows it once.

[![Snyk create a new service account form with Name and Role fields and a Create button](/docs/assets/images/key-1024x333-6cb9d3286d845847e017abfb79317682.webp)](https://coralogix.com/docs/assets/images/key-1024x333-6cb9d3286d845847e017abfb79317682.webp)

Shows the service account form used to mint the token the exporter authenticates with.

## Run the exporter [​](#run-the-exporter- "Direct link to run-the-exporter-")

1

<!-- -->

.

Start the exporter container

Substitute your token and organization ID:

```
docker run -p9532:9532 quay.io/lunarway/snyk_exporter \

  --snyk.api-token '<API_TOKEN>' \

  --log.level="info" \

  --snyk.organization='<ORG_ID>'
```

On startup the exporter reports the organization it is scraping:

```
time="2023-04-25T18:45:37Z" level=info msg="Starting Snyk exporter for organization '62b64ba1-aab2-4409-a1cb-6f94b3f93977'" source="main.go:67"

time="2023-04-25T18:45:37Z" level=info msg="Listening on :9532" source="main.go:111"

time="2023-04-25T18:45:37Z" level=info msg="Snyk API scraper starting" source="main.go:140"

time="2023-04-25T18:45:37Z" level=info msg="Running Snyk API scraper for organizations: Financial Applications" source="main.go:174"

time="2023-04-25T18:45:37Z" level=info msg="Collecting for organization 'Financial Applications'" source="main.go:196"
```

Once a scrape completes, it reports how many results it is exposing:

```
time="2023-04-25T18:52:54Z" level=info msg="Recorded 585 results for organization 'Financial Applications'" source="main.go:205"

time="2023-04-25T18:52:54Z" level=info msg="Exposing 585 results as metrics" source="main.go:216"
```

2

<!-- -->

.

Forward the metrics to Coralogix

Add a `remote_write` block to your Prometheus configuration, following the [Prometheus integration instructions](https://coralogix.com/docs/integrations/metrics/prometheus.md):

```
remote_write:

- url: https://ingress.eu2.coralogix.com/prometheus/v1

  name: '<customer_name>'

  remote_timeout: 120s

  bearer_token: '<Send_Your_Data_private_key>'
```

| Field          | What to enter                                                                                                                          |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `url`          | The Prometheus RemoteWrite [endpoint](https://coralogix.com/docs/integrations/coralogix-endpoints.md) for your Coralogix domain.       |
| `name`         | A name for the time series.                                                                                                            |
| `bearer_token` | Your Coralogix [Send-Your-Data API key](https://coralogix.com/docs/user-guides/account-management/api-keys/send-your-data-api-key.md). |

## Validate the integration [​](#validate-the-integration- "Direct link to validate-the-integration-")

1

<!-- -->

.

Confirm the metrics arrive

In the Coralogix Grafana instance, query the `snyk_vulnerabilities_total` metric.

2

<!-- -->

.

Install the Snyk dashboard

Import the [Grafana Snyk dashboard](https://github.com/vberegov/snyk-grafana/blob/main/snyk.json) for a prebuilt overview.

[![Grafana Snyk dashboard showing total vulnerabilities per project, severity counts, issue count history, and issues by type](/docs/assets/images/json-1024x440-662fca39dda9c26cc251963462ec341a.webp)](https://coralogix.com/docs/assets/images/json-1024x440-662fca39dda9c26cc251963462ec341a.webp)

Shows vulnerability totals per project alongside severity breakdowns and issue history.

## Related resources[​](#related-resources "Direct link to Related resources")

[Prometheus integration](https://coralogix.com/docs/integrations/metrics/prometheus.md)[Coralogix endpoints](https://coralogix.com/docs/integrations/coralogix-endpoints.md)[Send-Your-Data API key](https://coralogix.com/docs/user-guides/account-management/api-keys/send-your-data-api-key.md)
