Ce contenu n'est pas disponible dans la langue sélectionnée.
Configuring Azure Pipelines
Learn how to configure Azure CI for secure CI/CD workflows.
Abstract
Preface Copier lienLien copié sur presse-papiers!
If you’re using Azure Pipelines for your application, pipeline runs may fail due to missing secrets and environment variables. Without them, integrations with Quay, JFrog Artifactory, and Red Hat Advanced Cluster Security (ACS) won’t work, breaking security tasks like vulnerability scanning, image signing, and SBOM generation for compliance.
To prevent this, you need to securely store secrets and environment variables in Azure. This guide walks you through the process, ensuring your pipelines run smoothly and securely.
Chapter 1. Adding secrets and variables to Azure Pipelines for integration with external tools Copier lienLien copié sur presse-papiers!
This procedure explains how to add secrets and environment variables to Azure Pipelines and also lists which variables are required. All listed variables must be added to ensure that Azure Pipelines works correctly with RHTAP and related Red Hat products.
Prerequisites
Before you configure Azure Pipelines, ensure you have the following:
- Admin access to your repository in Bitbucket or GitHub.
- Admin access to your Azure DevOps project and pipeline settings.
- Container registry credentials for pulling container images from Quay.io, JFrog Artifactory, or Sonatype Nexus.
Authentication details for specific Azure Pipelines tasks:
For ACS security tasks:
- ROX Central server endpoint
- ROX API token
For SBOM and artifact signing tasks:
- Cosign signing key password, private key and public key
- Trustification API and issuer URL, client ID, client secret, and supported CycloneDX version
NoteThe credentials and other details are already Base64-encoded, so you do not need to encode them again. You can find these credentials in your
private.envfile, which you created during RHTAP installation.
Procedure
- Log in to https://dev.azure.com and open your Azure DevOps project.
- In the left navigation panel, select Pipelines, then select Library.
- Select Variable group to create a new variable group.
-
Enter a name for the variable group, for example,
rhtap. In the variable group editor:
- Select Add to add a new variable.
-
In the Name field, enter the key. For example,
GITOPS_AUTH_PASSWORD. - In the Value field, enter the value used to authenticate with the GitOps repository for pushing updated image information.
- Select the Keep this value secret checkbox to mask the value in the UI and logs.
Repeat step 5 to add all required secrets:
Expand Table 1.1. Image registry and GitOps secrets Variable Description IMAGE_REGISTRY_PASSWORDPassword for accessing your container image registry.
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.
Now add regular environment variables and don’t mask their values. In the variable group editor:
- Select Add.
-
In the Name field, enter the key. For example,
IMAGE_REGISTRY_USER. - In the Value field, enter the value. In our example: a username for accessing your container image registry.
- Do not select the Keep this value secret checkbox.
Repeat step 6 to add all required environment variables:
Expand Table 1.3. Image registry and GitOps variables Variable Description IMAGE_REGISTRY_USERUsername for accessing your container image registry.
GITOPS_AUTH_USERNAME(optional)Your OpenShift GitOps username. This variable is required for Azure to work with Bitbucket. By default, lines with this variable are commented in the
azure-pipelines.ymlfile. To start using Bitbucket, uncomment all 5 instances of the line# GITOPS_AUTH_USERNAME: $(GITOPS_AUTH_USERNAME).Expand Table 1.4. Variables required for ACS and SBOM tasks Variable Description ROX_CENTRAL_ENDPOINTEndpoint for the ROX Central server.
COSIGN_PUBLIC_KEYPublic key for Cosign.
TRUSTIFICATION_BOMBASTIC_API_URLURL for Trustification Bombastic API used in SBOM generation.
TRUSTIFICATION_OIDC_ISSUER_URLOIDC issuer URL used for authentication when interacting with the Trustification Bombastic API.
TRUSTIFICATION_OIDC_CLIENT_IDClient ID for authenticating to the Trustification Bombastic API using OIDC.
TRUSTIFICATION_SUPPORTED_CYCLONEDX_VERSIONSpecifies the CycloneDX SBOM version that is supported and generated by the system.
Optional: Set the Rekor and TUF variables if your CI provider runners do not run on the same cluster as the RHTAP instance.
Expand Table 1.5. Rekor and TUF variables Variable Description REKOR_HOSTURL of your Rekor server.
TUF_MIRRORURL of your TUF service.
- Select Save.
To authorize pipelines to use this variable group:
- Select the Pipeline permissions tab.
- Select Add pipeline.
- Select the pipelines that require access to this variable group and select Authorize selected pipelines.
Optional: If you use a different name for the variable group other than
rhtap, you must update the variable group name in theazure-pipelines.ymlfile.variables: - group: <my-variable-group>variables: - group: <my-variable-group>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
- Rerun the latest pipeline. If the secrets are applied correctly, the pipeline will complete successfully. After a successful run, verify that tasks such as RHACS or SBOM display the expected details.
Revised on 2025-04-30 03:55:38 UTC