GitLab pipeline verify labels exist
Type: Rule
ID: gitlab-pipeline-verify-labels-exist
Source: v2/rules/gitlab/pipeline/verify-labels-exist.yaml
Rego Source: verify-labels-exist.rego
Labels: Gitlab, Pipeline
Verify the pipeline has all required label keys and values.
note
This rule requires Discovery Evidence. See here for more details.
tip
Signed Evidence for this rule IS NOT required by default but is recommended.
warning
Rule requires evaluation with a target. Without one, it will be disabled unless the --all-evidence
flag is provided.
Usage example
uses: gitlab/pipeline/verify-labels-exist@v2
with:
labels:
- "app.kubernetes.io/instance"
Mitigation
Ensure that all required labels exist in the pipeline to reduce the risk of misconfiguration.
Description
This rule ensures that the pipeline has all required label keys and values. It performs the following steps:
- Checks the settings of the GitLab pipeline.
- Verifies that all required labels exist in the pipeline.
Evidence Requirements:
- Evidence must be provided by the Scribe Platform's CLI tool through scanning GitLab pipeline resources.
Evidence Requirements
Field | Value |
---|---|
signed | False |
content_body_type | generic |
target_type | data |
predicate_type | http://scribesecurity.com/evidence/discovery/v0.1 |
labels | - asset_type=pipeline |
Input Definitions
Parameter | Type | Required | Description |
---|---|---|---|
labels | array | True | List of labels to verify exist in the pipeline. |