Import Dependabot data
Dependabot is a GitHub service that provides vulnerability analysis of your software dependencies. You can import Dependabot findings into New Relic to achieve a single, unified view of vulnerabilities.
After completion of these steps, you will see new vulnerabilities detected by Dependabot in your New Relic account in real time and will be able to build out analytics dashboards and enable on newly detected issues.
Importing Dependabot data consists of two steps:
- Send newly detected vulnerabilities in realtime to New Relic with a webhook
- A one time import of previously detected vulnerabilities through a bulk import
We recommend combining your webhook with a one-time bulk import to ensure data integrity of historical vulnerabilities.
Tell us about how you want to send vulnerability data
Select how you wish to send vulnerablity data to New Relic.
Do you want to send new or previously detected vulnerabilities?
Upload new vulnerabilities through the Dependabot Webhook Integration
Prerequisites
- A New Relic license key for the account you want to report data to.
- Organization/Repository administration access to your GitHub account(s)
- Organization webhooks are strongly recommended. It’s much easier to administer a single webhook per org than to create separate rules for each repository.
Create the webhook
To create the webhook:
- From your GitHub organization or repository main page, select Settings then select Webhooks in the left nav and finally Add webhook in the top right of the page.
- Set the following options:
- Set Payload URL to
https://security-ingest-processor.service.newrelic.com/v1/security/webhooks/dependabot?Api-Key=<NewRelicIngestKey>
- Set Content Type to
application/json
- Leave Secret blank
- Set Which events would you like to trigger this webhook? To ‘Let me select individual events`.
- Set Payload URL to
- Select Repository vulnerability alerts in the list of events.
- Click Add webhook
Confirm you see a green check mark by the new webhook.
Whenever Dependabot finds a new vulnerability, it will forward it to New Relic through the new webhook. You can find your new data in Logs, the vulnerability management views, and by querying your data.
Bulk import previously detected vulnerabilitie (Optional)
Once you've created your webhook, we recommend importing previously detected vulnerabilities from your security tools to ensure data integrity.
Bulk import is initiated with an HTTP POST request. Your GitHub PAT is stored in-memory during import and then discarded. It is never persisted to non-volatile storage.
Cuidado
Running bulk import more than once is not recommended. New Relic will remove duplicate imported data in our vulnerability management UI, but queries to the underlying log data will show duplicate data.
A bulk import HTTP POST request consists of the following. Replace <NewRelicIngestKey>
, <GithubPAT>
, and <OrganizationName>
with the appropriate values:
Post:
https://security-ingest-processor.service.newrelic.com/v1/security/import/dependabot
HEADERS
Api-Key
: your New Relic license key
Content-Type
: application/json
BODY:
{ "serviceApiKey": "<GithubPAT>", "serviceParams": { "orgName": "<OrganizationName>", "repositories": ["<RepositoryName1","RepositoryName2"] \\ optional }}
Example CURL command:
$curl --location --request POST 'https://security-ingest-processor.service.newrelic.com/v1/security/import/dependabot' \> --header 'Api-Key: <NewRelicIngestKey>' \> --header 'Content-Type: application/json' \> --data-raw '{$ "serviceApiKey": "<GithubPAT>",$ "serviceParams": {$ "orgName":"<OrganizationName>"$ }$}'
Confirming bulk import activity
When you POST to the v1/security/import/dependabot
endpoint, the HTTP response will include a request UUID. For example:
{ "success": true, "errorMessage": null, "uuid": "4740e3c8-dbc4-46e6-a4b2-a7fb6f918d20"}
The request GUID is included in all Log
data written to NRDB from the import job. These events are written in real time as the import job runs. To view the status and output of an import as it runs, use this NRQL query (replacing YOUR_UUID
with the UUID returned from your HTTP POST):
FROM Log SELECT * WHERE source = 'GitHub Dependabot' AND requestId = 'YOUR_UUID'
GitHub monitors the health of webhook integrations. If you do not see a green checkmark next to the webhook in the GitHub Webhook UI, investigate the source of the error.
To confirm the integration is running, use this NRQL query to view operational events:
FROM Log SELECT * WHERE source = 'GitHub Dependabot' AND issueType IS NULL SINCE 1 day ago