Basic steps to install and configure Universal Broker
Follow these steps to install and configure your Universal Broker using the snyk-broker-config
CLI tool. The tool guides you through the steps and indicates important points in the workflows.
Install the snyk-broker-config CLI tool
To install the tool, use npm i -g snyk-broker-config
or download the binary from the GitHub repository.
Create your first connection
After you install, start the Universal Broker Create Connection worklow.
Type your Snyk token and press Enter.
Type N and press Enter.
Paste the Snyk Broker Admin Organization ID created in the prerequisites and press Enter.
The tool displays the credentials for the Broker App just installed. Be sure to store these safely like any other credentials. This is the only time the client secret will be displayed. If you lose these credentials, you must either delete and recreate the Snyk Broker Admin Organization and start over, or use the API to reinstall Universal Broker manually.
When you have saved your credentials, type Y and press Enter.
After you have created your first deployment in the next step, set the install ID as an environment variable to make the tool easier to use.:
- export INSTALL_ID=xxxx (Linux/Mac)
- set INSTALL_ID=xxxx (Windows)
Create your first deployment
In response to the prompt, type Y and press Enter.
Select the connection type you want to create.
This example shows creating a GitHub connection. Creating all the other types of connection follows the same process. Each deployment is limited to 25 connections.
Enter a connection name to help you identify the connection, for example, github-connection-for-team-x.
Enter your Broker_client_url. Snyk recommends using the default value. You can enter a different value, which is required for container integrations.
Create the credential reference (not the actual credential value). Enter the name of the environment variable which will contain the actual credential value when the Broker client is running, for example, MY_GITHUB_TOKEN.
Optionally, you can enter a comment to help you keep track of this connection.
When you run the Broker client container in a subsequent step, you must add the -e MY_GITHUB_TOKEN=<SECRET_TOKEN_VALUE>
. In a production setup, these values are mounted from the secrets vault.
The connection is now created.
Snyk recommends that you add SNYK_TOKEN and INSTALL_ID in your terminal session environment variables now, using the following commands: - export INSTALL_ID=xxxx (Linux/Mac) - export SNYK_TOKEN=yyyy (Linux/Mac) - set INSTALL_ID=xxxx (Windows) - set SNYK_TOKEN=yyyy (Windows)
If you are prompted about the Broker app being installed, enter Y and then paste the install ID you saved previously. Exporting the INSTALL_ID avoids this step in your terminal session in the future.
Details of the connection follow: connection ID
; connection type (broker_connection)
; attributes: deployment_id, identifier, name, and secrets-primary and secondary
, each with the status
, encrypted
, expires_at
, and nonce
; configuration required: broker-client-url
and github_token values
; type: github.
Integrate your connection with an Organization that will use the Universal Broker
Enter the ID of the Organization where you want to use the newly created Broker connection.
Your Organization is now integrated with your new Broker connection.
Run the Broker client
When the Broker client has started, the connection is ready to use, in this case, to import repositories.
To verify that your connection is configured, check that the integration tile on your Organization Settings > Integrations page is marked Configured.
Integrate your connection with more Organizations
To integrate your connection with another Organization so it will use the same connection, run the command again and enter the ID of the new Organization to integrate. You can repeat this step as often as needed to integrate with Organizations.
Repeat the step for any Organization in your Tenant as needed, for as many integrations as you need.
Last updated
Was this helpful?