GitLab CI/CD
GitLab is an open source code repository and complete DevOps platform. It offers a location for online code storage and capabilities for issue tracking and CI/CD.
This how-to will provide a basic understanding of how to add the Relyance Source Code Inspector (SCI) into a typical build job.
Prerequisites:
- A source code repository needs to be available.
- The
relyance.yamlfile needs to be in the source code root directory. - Follow Set up SCI to create an OAuth credential and copy the Docker command from Step 2. Save the credential as a masked CI/CD variable named
API_KEYand make it available to the scan job. For the examples on this page, setSCI_IMAGEin the scan environment to the full image reference shown at the end of that command.
See more info about the SCI commands here.
Steps:

- Log in to your GitLab account.
- Select your project from the front page.
- Create a pipeline if necessary by going to the left-hand menu and selecting Build -> Pipelines, or edit an existing one by going to the left-hand menu and selecting Build -> Pipeline editor.
- Using the template below, update the pipeline:
relyance-scan-job:
image: docker:latest
services:
- docker:dind
stage: test
script:
- echo "Running the Relyance Scan"
- docker run --pull=always --rm --env API_KEY --volume "$PWD:/repo:ro" "$SCI_IMAGE"Note: This will run the Relyance scan during the test phase of each job. It is recommended to create a scheduled job instead. 5. To ensure this job is run on a schedule, add the following values:
relyance-scan-job:
image: docker:latest
services:
- docker:dind
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $relyance_scan == "true"
stage: test
script:
- echo "Running the Relyance Scan"
- docker run --pull=always --rm --env API_KEY --volume "$PWD:/repo:ro" "$SCI_IMAGE"- You will also need to set up the schedule frequency. In the left-hand navigation menu, select Build -> Pipeline schedules.
- Click the New schedule button.
- Fill out the form with these values: Description: Provide a meaningful name (e.g. Relyance Scan) Interval Pattern: Specify the scan frequency Cron Timezone: Specify your timezone Target branch or Tag: It is suggested to scan against the production branch Variables: Create a variable to ensure this job runs specific to this scheduled job.
relyance_scan = true- Save the schedule.
- Test the newly created job by clicking the play button next to it in the Pipeline schedules list.
- To see your job progress by going to the left-hand menu and selecting Build -> Jobs.
- If there are no errors, you should start to see SCI results in your Relyance tenant.

Appendix:
Run the command from the repository root with the scan job's API_KEY environment variable and the image from Step 2.
docker run --pull=always --rm --env API_KEY --volume "$PWD:/repo:ro" "$SCI_IMAGE"
If the connection reports Connected but returns nothing
These are the ways this integration comes back empty without reporting an error. Generated from the integration catalog, so it tracks what the connection actually asks for.
- Authorised, then empty. The connection carries an authorisation, not a password: it stops returning data if the account that granted it loses access, its own permissions narrow, or the grant is revoked at the vendor. None of that reports an error here -- the connection keeps its last status until the next scan.
- A credential rotated at the vendor is not picked up here. Client Secret is stored when you save the connection, so regenerating the value at the vendor breaks the next scan until it is re-pasted here. Recording the expiry on the connection means Relyance warns you before it lapses.
Authentication methods and fields
Pick one of these under Authentication Method on the connection wizard's Authentication step. This table is generated from the integration catalog, so it always matches what the form actually asks for.
| Method | Required | Optional |
|---|---|---|
| Oauth2 / App Token | Client ID, Client Secret (secret) |
— |
Manage this integration with Terraform
Connections for this integration can be managed as code with the Relyance Terraform provider. Non-secret fields go in auth.params; secret fields go in auth.secrets_wo, which is write-only — never stored in Terraform state. Rotate secrets by bumping auth.secrets_wo_version.
The OAuth (browser authorization) method uses a browser authorization flow, so the connection is created in the Relyance app. Manage it in Terraform afterwards by importing it (terraform import relyance_integration_connection.example gitlab/<connection_id>) or reading it with the relyance_integration_connection data source.