Published on: October 29, 2024
3 min read
GitLab's gitlabcis scanner determines level of compliance for GitLab projects. Learn how to install and use the tool with this tutorial, as well as what's on the roadmap.
GitLab's CIS Benchmark scanner, gitlabcis, is open source and available. The Python CLI tool audits a GitLab project against the Center for Internet Security (CIS) GitLab Benchmark, and delivers recommendations as code formatted in YAML.
In April, we introduced the CIS GitLab Benchmark to improve security and offer hardening recommendations to GitLab's customers. The benchmark is available for download from the CIS website.
In this article, you'll learn:
You can download and install the scanner using pip via pypi, or download the source code from our releases page.
pip install gitlabcis
The scanner takes one positional argument (URL
) and then options. The format is: gitlabcis URL OPTIONS
# example: generate a json report
gitlabcis \
https://gitlab.example.com/path/to/project \
-o results.json \
-f json
The full command line options can be found in the documentation.
The team extracted all of the recommendation controls from the CIS GitLab Benchmark and created them in YAML to be used as controls as code.
Each control has its own dedicated function to enhance readability. This also allows an individual to observe how the control performs its audit.
Additionally, certain control functions have limitations. We have identified each of these, which can be found in our limitations document.
Currently, the tool only accepts a project URL input. It then only observes configuration at a project level. It does however support administrative controls.
Contribute to the gitlabcis scanner project.
The creation of the scanner allowed us to contribute two features back into the product with the help of the community.
We want to augment the scanner to be able to accept instances or groups as input. For example, if you host GitLab at: gitlab.example.com, this could be used as an input to check at the instance level if you are compliant against the CIS GitLab Benchmark and the same for groups.
Additionally, certain controls can be set at the instance or group level and trickle down to the project level. There is work ongoing to include this functionality into the scanner. Check out the epic for more information
One important aspect is incorporating this functionality into the GitLab product itself. The GitLab compliance team is working on incorporating the CIS GitLab Benchmark and other standards into the Compliance Adherence Report. This will allow customers real-time reviews of instances, groups, and projects across a wide set of standards, not just CIS.
Learn more about the CIS GitLab Benchmark in our public project.