layout: home title: Overview permalink: /
Gitlab Compliance
Gitlab Compliance is a BDD compliance testing and documentation generation toolkit for GitLab CI/CD pipelines and project settings. It runs Gherkin policies against `.gitlab-ci.yml` and optional GitLab API settings. You can also generate markdown documentation for your Gitlab pipelines.
Source code - coming soon: MaturityBuilder/gitlab-compliance.
Get started
Get started{ .md-button .md-button-primary } Usage{ .md-button } BDD grammar{ .md-button }
gitlab-compliance supports two core workflows from the same pipeline YAML:
| Workflow | Command | What it does |
|---|---|---|
| Compliance | check |
Run Gherkin policies against .gitlab-ci.yml (and optional GitLab API settings) |
| Documentation | generate |
Build Markdown, swagger-markdown, or HTML reference docs from .gitlab-ci.yml |
pip install gitlab-compliance
# Validate pipeline configuration against policies
gitlab-compliance check -f policies/ -p .gitlab-ci.yml
# Generate pipeline documentation (filter and group output as needed)
gitlab-compliance generate -i .gitlab-ci.yml --format swagger-markdown -o pipeline-reference.md
gitlab-compliance generate -i .gitlab-ci.yml --exclude variables,image --group-by stage
See Usage for the full CLI (including demos) and
Generate pipeline documentation for output
formats, --exclude, and --group-by.
- compliance: Ensure pipeline YAML and project settings follow your security standards and custom policies
- behaviour driven development: Policies are readable Gherkin scenarios that developers and security teams share
- portable: Install from
pip. See Installation - pre-merge: Validate configuration before changes land on protected branches
- YAML and API: Offline checks against pipeline files; optional GitLab API checks for project settings and CI variables
- easy to integrate: Run in GitLab CI or local git hooks
- segregation of duty: Keep policy packs in a separate repository or OCI registry
- documentation: Generate Markdown or HTML reference docs from
.gitlab-ci.yml
Idea
gitlab-compliance focuses on negative
testing — catching
misconfigurations and policy violations — rather than proving that a job runs
successfully end to end.
GitLab CI pipelines are defined in YAML that composes jobs, includes, variables,
and workflow rules. What was missing is a lightweight way to assert that this
configuration follows organizational standards before merge. GitLab offers
native compliance features in higher tiers; gitlab-compliance provides an
open, portable alternative inspired by
terraform-compliance and
Conftest.
For example, a policy might require that no job uses a floating latest image
tag:
if a job defines an image, it must not use the :latest tag
translates into:
Given I have any job defined
When it has image
Then its image must not match ":latest$"
The image value comes from your pipeline YAML:
scan:
image: python:3.12
build:
image: docker:latest # violates the policy above
In CI, this scenario runs against .gitlab-ci.yml (and resolved local includes)
so merge requests cannot introduce violations.
See Examples for more sample use cases.
Supporting / Requirements
- Python: 3.12 (see Installing via pip)
- Pipeline file:
.gitlab-ci.ymlor another path passed with-p - API checks (optional): GitLab token plus
--projector--groupfor settings and CI variable policies
Full CLI options: Usage. Step grammar: BDD Reference.
How can you support the project?
Contributions are welcome — see Contributing.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitlab_compliance-2.2.0.tar.gz.
File metadata
- Download URL: gitlab_compliance-2.2.0.tar.gz
- Upload date:
- Size: 102.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66df9462ed5b2a4d13668f1e48e3d1032ec6cf9f436e8a91e651d5510b385492
|
|
| MD5 |
f95dbb9e8c866b35444f5928e9d2e9eb
|
|
| BLAKE2b-256 |
b687e5f5b5d8e8b03a827fe9ae33509408b47b577f29c43a8e2dba6e7d9abe8c
|
Provenance
The following attestation bundles were made for gitlab_compliance-2.2.0.tar.gz:
Publisher:
release.yml on MaturityBuilder/gitlab-compliance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitlab_compliance-2.2.0.tar.gz -
Subject digest:
66df9462ed5b2a4d13668f1e48e3d1032ec6cf9f436e8a91e651d5510b385492 - Sigstore transparency entry: 2268665152
- Sigstore integration time:
-
Permalink:
MaturityBuilder/gitlab-compliance@1346795c3b9e59567290c693577f1e05959687d9 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/MaturityBuilder
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1346795c3b9e59567290c693577f1e05959687d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gitlab_compliance-2.2.0-py3-none-any.whl.
File metadata
- Download URL: gitlab_compliance-2.2.0-py3-none-any.whl
- Upload date:
- Size: 133.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
741bee580e65a455cf2a4cbf941028800b3b4feab96dab6b49f97ea7d554ceaf
|
|
| MD5 |
3bd18846f5bcb386eab65a4a6802b133
|
|
| BLAKE2b-256 |
b49687ec87ec22c2324905af8be1f31877cae82c731ebd7c79e6bfc63b130eeb
|
Provenance
The following attestation bundles were made for gitlab_compliance-2.2.0-py3-none-any.whl:
Publisher:
release.yml on MaturityBuilder/gitlab-compliance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitlab_compliance-2.2.0-py3-none-any.whl -
Subject digest:
741bee580e65a455cf2a4cbf941028800b3b4feab96dab6b49f97ea7d554ceaf - Sigstore transparency entry: 2268665217
- Sigstore integration time:
-
Permalink:
MaturityBuilder/gitlab-compliance@1346795c3b9e59567290c693577f1e05959687d9 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/MaturityBuilder
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1346795c3b9e59567290c693577f1e05959687d9 -
Trigger Event:
push
-
Statement type: