Overview
Note
This guide is relevant for Snyk UI integrations only, the CLI already supports yarn and npm projects with private Artifactory registries
You can add configuration to tell Snyk where your private Artifactory Node.js packages are hosted and what scope they are under.
This is the same information you would normally add in your .yarnrc
or .npmrc
Once configured, Snyk will use this information to access private dependencies when creating Pull/Merge Requests, by allowing yarn to reach those deps in order to regenerate the lockfile.
Prerequisites
- You must sign up for a Pro or Enterprise account with Snyk before you begin
JavaScript Language Settings
- Go to
Settings > Languages > JavaScript
and either the npm or yarn settings depending on your project types (yarn shown in screenshots below) - If you have not previously connected to Artifactory you will be asked to configure an integration first, see Artifactory Registry Setup.
- Select “Add registry configuration”
- Select "Artifactory" as the Package source
- If you want to configure this registry as default registry url, then leave scope blank
- If you want to configure only scoped packages to use this registry then add a scope
- If you want to add a mix of default registry url and scoped packages, add multiple configurations - one for the default and one per scope.
- Once connected, you can go back to the JavaScript Language Setting and select "Artifactory" from the Integration type drop-down and configure scope
- When you have added all the registries and scopes you want, hit Update settings.
- Now test it out - open a Pull/Merge Request on a project that contains private dependencies that are hosted in Artifactory to see a lockfile updated and included in the Snyk Fix Pull Request where previously none was generated