GitLab Security Dashboard Executor¶
Category: Source Code Analysis
Script: gitlab_security.py
Integration: REST API
Faraday Plugin: Raw JSON
Website: https://docs.gitlab.com/ee/user/application_security/
Description¶
Imports security findings from the GitLab Vulnerability Report (SAST, dependency scanning, container scanning, secret detection, DAST and fuzzing) into Faraday. Each GitLab project becomes a Faraday host, and each finding becomes a vulnerability with its location, scanner, CVEs, CWEs and solution.
Prerequisites¶
- A GitLab instance (GitLab.com or self-managed) with security scanning enabled on the projects to import
- A personal, project or group access token with the
read_apiscope, from a user with at least the Reporter role on the projects - Network access from the agent to the GitLab URL
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
GITLAB_HOST |
Yes | GitLab base URL (e.g., https://gitlab.com or https://gitlab.example.com) |
GITLAB_TOKEN |
Yes | GitLab access token. It is sent in the PRIVATE-TOKEN header. A value starting with Bearer is sent as an OAuth2 Authorization header instead. |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
GITLAB_PROJECT_ID |
string | No | ID or URL-encoded path (e.g., mygroup%2Fmyrepo) of a single project to import. If empty, imports every non-archived project the token is a member of. |
GITLAB_MIN_SEVERITY |
string | No | Minimum severity to import: info, low, medium, high or critical (default: info) |
GITLAB_REPORT_TYPE |
string | No | Import only one report type: sast, dependency_scanning, container_scanning, secret_detection, dast, api_fuzzing or coverage_fuzzing (default: all) |
YAML Configuration Example¶
executors:
gitlab_security:
repo_executor: gitlab_security.py
max_size: 65536
varenvs:
GITLAB_HOST: "https://gitlab.com"
GITLAB_TOKEN: "<gitlab_token>"
params:
GITLAB_PROJECT_ID:
mandatory: false
type: string
base: string
GITLAB_MIN_SEVERITY:
mandatory: false
type: string
base: string
GITLAB_REPORT_TYPE:
mandatory: false
type: string
base: string
How It Works¶
- Gets the project from
/api/v4/projects/{id}, or lists the token's projects with/api/v4/projects?membership=true - For each project, reads
/api/v4/projects/{id}/vulnerability_findings, 100 per page, filtered by report type and severity - Maps each finding to a Faraday vulnerability:
- Name: the finding name with a prefix for its report type (
[SAST],[SCA],[CONTAINER],[SECRETS],[DAST],[API-FUZZ],[COV-FUZZ]) - Severity: GitLab's severity (
unknownbecomesinfo), or the CVSS score when there is no severity - Status:
detected/confirmedbecome open,resolvedbecomes closed,dismissedand false positives become risk-accepted - Description: the location (file and line, package and version, image or URL), scanner and confidence
- References: CVEs, CWEs, GHSA and OWASP identifiers and the finding's links
- Name: the finding name with a prefix for its report type (
- Groups the findings of each project under one host and sends them to Faraday
Notes¶
- Each project becomes one host with IP
0.0.0.0and the project path (e.g.,mygroup/myrepo) as hostname. Projects without findings are not created. - A
401response stops the run. Projects that return403or404are skipped and written to the agent log. - An unrecognized
GITLAB_MIN_SEVERITYvalue falls back toinfo. An unknownGITLAB_REPORT_TYPEis sent to GitLab as is. - The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseGITLAB_MIN_SEVERITYto filter by severity.