Chapter 1. Adding secrets to Jenkins for integration with external tools
When you select Jenkins as your CI provider while creating an application, you must add secrets to Jenkins for secure integration with external tools. This enables Jenkins to perform essential tasks, such as vulnerability scanning, image signing, and attestation generation.
Prerequisites
- You must have the necessary permissions to create and manage Jenkins jobs, variables, and CI pipelines.
- You must have the username and password for the image registry, such as Quay.io, Jfrog Artifactory, or Sonatype Nexus.
- You must have appropriate GitOps credentials.
You must have the following information for specific tasks that you want Jenkins pipeline to perform:
For ACS tasks:
- ROX Central server endpoint and token
For SBOM tasks:
- Cosign signing key password, private key, and public key
Trustification API and issuer URL, client ID, client secret, and supported CycloneDX version
NoteThe values used for these credentials are already Base64-encoded, so you do not need to convert them. You can find these credentials in your
private.envfile.
Procedure
If you have already installed Trusted Software Supply Chain (TSSC) on an OpenShift cluster you will be able to configure all the secrets and variables automatically by running the
ci-set-org-vars.shscript packaged in thetssc-cliimage.- Make sure you have an integration secret for jenkins as described in Integrating Jenkins
- Follow instruction to run the installation container described in Download the installation program image
Once inside the installation container, run the following command:
bash-5.1$ ./scripts/ci-set-org-vars.sh -b jenkins
$ bash-5.1$ ./scripts/ci-set-org-vars.sh -b jenkinsCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script creates the required jenkins credentials and environment variables with all the required variables and secrets described in the following steps.
- Open your Jenkins instance in a web browser and log in with your admin credentials.
- Select your username at the top right corner of the Jenkins dashboard.
- From the left sidebar, select Manage Jenkins.
- In the Security section select Credentials.
- Under Stores scoped to Jenkins select System.
- Choose a domain where you want to add the credentials. Typically, it’s Global credentials (unrestricted), click this domain name.
- Select Add Credentials.
- From the Kind drop-down list, select Secret text.
- Keep the default value in the Scope drop-down list as Global (Jenkins…).
- Enter information related to your secret in the UI fields.
- Select Create.
Repeat steps 7-11 to add the following credentials:
NoteFor image registries, Quay is the default option. To use JFrog Artifactory or Sonatype Nexus, uncomment lines with corresponding variables in 2 Jenkinsfiles in both the gitops-template and source-repo folders in your cloned tssc-sample-templates GitHub repository.
Expand Table 1.1. Image registry and GitOps secrets Variable Description QUAY_IO_CREDSUsername and password for accessing your Quay.io repository. This is the default option that is uncommented in Jenkinsfiles.
ARTIFACTORY_IO_CREDSUsername and password for accessing your JFrog Artifactory repository.
NEXUS_IO_CREDSUsername and password for accessing your Sonatype Nexus repository.
GITOPS_AUTH_PASSWORDThe token the system uses to update the GitOps repository for newly built images.
Expand Table 1.2. Secrets required for ACS and SBOM tasks Variable Description ROX_API_TOKENAPI token for accessing the ROX server.
COSIGN_SECRET_PASSWORDPassword for Cosign signing key.
COSIGN_SECRET_KEYPrivate key for Cosign.
TRUSTIFICATION_OIDC_CLIENT_SECRETClient secret used alongside the client ID to authenticate to the Trustification Bombastic API.
- Rerun the last pipeline run. Alternatively, switch to you application’s source repository in GitHub, make a minor change, and commit it to trigger a new pipeline run.