Artifactory Repository - install and configure using Docker

Follow the instructions on this page to set up Artifactory Repository with Snyk Broker. This integration is useful to ensure a secure connection with your on-premise Artifactory Repository deployment.

Feature availability Integration with Artifactory Repository is available with Enterprise plans. See pricing plans for more details.

Prerequisites Ask your Snyk account team to provide you with a Broker token or generate it from the Snyk Web UI.

You need Docker or a way to run Docker Linux containers.

Some Docker deployments for Windows run only Windows containers. Ensure that your deployment is capable of running Linux containers.

For information about non-brokered integration with Artifactory Repository see Artifactory Repository setup.

For information about brokered integration with Artifactory Container Registry see Snyk Broker -Container Registry Agent.

Obtain Broker token for Artifactory Repository setup

  1. Go to settings > Integrations > Package Repositories > Artifactory.

  2. Enter the URL of your Artifactory instance, this must end with /artifactory.

  3. Enter your username and password.

  4. Select Save.

Artifactory integration setup
Artifactoryrepository setup

If you do not see the Snyk Broker on/off switch, you do not have the necessary permissions and can only add a publicly accessible instance.

Submit a request to Snyk Support if you want to add a private registry.

When you have permissions to add a private registry, continue with the instructions to generate a Broker token from the Web UI.

Generate a Broker token from the Web UI

  1. In the Artifactory integration settings, move the Snyk Broker on/off switch to on to display a form for generating a Broker token.

  2. Select Generate and Save.

  3. Copy the token that was generated to use when you set up the Broker Client.

Configure Broker to be used for Artifactory Registry

To use the Broker client with an Artifactory Registry deployment, run docker pull snyk/broker:artifactory. Refer to Artifactory Repository - environment variables for Snyk Broker for definitions of the environment variables.

Docker run commands to set up a Broker Client for Artifactory Repository

Copy the following command to set up a fully configured Broker Client to use with Artifactory Registry. You can run the Docker container by providing the relevant configuration:

docker run --restart=always \
           -p 8000:8000 \
           -e BROKER_TOKEN=secret-broker-token \
           -e ARTIFACTORY_URL=<yourdomain>.artifactory.com/artifactory \
       snyk/broker:artifactory

For an npm or Yarn integration, use the following command.

docker run --restart=always \
  -p 8000:8000 \
  -e BROKER_TOKEN=secret-broker-token \
  -e ARTIFACTORY_URL=acme.com/artifactory \
  -e RES_BODY_URL_SUB=http://acme.com/artifactory \ 
  snyk/broker:artifactory

As an alternative to using the Docker run command, you can use a derived Docker image to set up the Broker Client integration. See Derived Docker images for the environment variables to override for the Artifactory integration.

Start the Broker Client container and verify the connection with Artifactory Repository

Paste the Broker Client configuration to start the Broker Client container.

You can check the status of the connection by refreshing the Artifactory Integration Settings page. When the connection is set up correctly, there is no connection error.

Last updated

Was this helpful?

#4707: More info: Update pricing plans page

Change request updated