GitLab does not support OAuth2 client credentials flow. Instead, we use a two-token approach for least-privilege access:
| Token | Purpose | Permissions |
|---|---|---|
| Pipeline Trigger Token | Trigger pipelines | Trigger only (no API access) |
| Project Access Token | Poll pipeline status | read_api scope, Guest role |
- Create a new project named
scan-test-runner-gitlab-ciin your GitLab group - Add the pipeline configuration at
.gitlab-ci.yml - Ensure CI/CD pipelines are enabled for the project
-
Navigate to your project: Project → Settings → CI/CD → Pipeline trigger tokens
Or:
https://gitlab.com/{GROUP}/{PROJECT}/-/settings/ci_cd#js-pipeline-triggers -
Click Add new token
-
Enter a description:
Scanner Registry Test Orchestrator -
Click Create pipeline trigger token
-
Copy the trigger token - it's only shown once!
-
Ensure the ** CI/CD > Variables > Minimum role to use pipeline variables ** is set to Developer
-
Navigate to your project: Project → Settings → Access tokens
Or:
https://gitlab.com/{GROUP}/{PROJECT}/-/settings/access_tokens -
Click Add new token
-
Configure the token:
Field Value Token name Scanner Registry Status PollerExpiration date Set to 1 year (maximum), add rotation reminder Role Guest (minimal) Scopes ✅ read_apionly -
Click Create project access token
-
Copy the token - it's only shown once!
Navigate to the scanner registry repository (GitHub): Settings → Secrets and variables → Actions → New repository secret
| Secret Name | Value |
|---|---|
BOOST_SCAN_RUNNER_GITLAB_TRIGGER_TOKEN |
Pipeline trigger token from step 2 |
BOOST_SCAN_RUNNER_GITLAB_READ_TOKEN |
Project access token from step 3 |
- name: Run test-action
run: |
use "${{ secrets.BOOST_SCAN_RUNNER_GITLAB_TRIGGER_TOKEN }}" \
use "${{ secrets.BOOST_SCAN_RUNNER_GITLAB_READ_TOKEN }}"| Token | Lifetime | Scope | Rotation |
|---|---|---|---|
| Trigger Token | No expiration | Trigger pipelines only | Manual (revoke if compromised) |
| Read Token | 1 year max | read_api (read-only) |
Annual rotation required |
- Trigger token can only start pipelines - cannot read data or modify anything
- Read token has Guest role with
read_api- cannot trigger or modify anything - Neither token can access code, settings, or other projects
- Separation ensures compromise of one token limits blast radius