Skip to content
ES EN

GitLab CI

Prerequisites

Add the following variables in Settings → CI/CD → Variables of your project:

VariableProtectedDescription
GERION_API_URLYesGerion API Gateway URL
GERION_API_KEYYes (masked)M2M API key for your organization

Pipelines

Results are sent to the Gerion dashboard. Copy this content into your .gitlab-ci.yml:

stages:
- security
gerion-scan:
stage: security
image: ghcr.io/gerion-appsec/gerion-cli:latest
needs: []
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- gerion scan-all .

Reusable template (include)

Instead of copying the YAML into every repository, you can include Gerion’s official template and extend it with your own variables:

include:
- project: 'gerion-appsec/gerion-cicd-configs'
file: '/gitlab-ci/gerion-include.yml'
ref: main
gerion-scan:
extends: .gerion-scan # inherits the full base config
variables:
GERION_SCAN_TYPE: "secrets" # overrides only the scan type

Available template variables

VariableDefaultDescription
GERION_SCAN_TYPEallall | secrets | sca | iac | sast
GERION_OUTPUT_FORMAT""json | markdown | sarif | empty
GERION_OUTPUT_FILE""Output file path
GERION_LOG_LEVELinfodebug | info | warning | error
GERION_TIMEOUT180Timeout per scanner in seconds

For SARIF with automatically configured artifacts, extend .gerion-scan-sarif:

gerion-scan:
extends: .gerion-scan-sarif

Notes

  • Gerion CLI automatically detects GitLab CI variables (GITLAB_CI, CI_PROJECT_NAME, CI_COMMIT_REF_NAME, CI_COMMIT_SHA). No manual metadata configuration needed.
  • When using image: in the job, the CLI runs directly as the job container without needing docker run.