Skip to content

GitLab

Varman reads the groups and projects your token can see and runs four checks. Each group or project gets its own pass or finding.

Check Passes when Evidence task
2FA Enforcement Every group the token’s user owns requires two-factor authentication 2FA
Branch Protection Enabled Each project’s default branch matches a protected branch rule (wildcard rules count) Code Changes
Merge Request Approvals Required Each project requires at least one approval before merging Code Changes
SAST / Dependency Scanning Enabled Each project’s .gitlab-ci.yml on the default branch includes SAST, dependency scanning or secret detection Secure Code

The scanning check looks for GitLab’s managed templates (for example Jobs/SAST.gitlab-ci.yml or Jobs/Dependency-Scanning.gitlab-ci.yml), sast: or dependency_scanning: jobs, Semgrep, or gitlab-advanced-sast in the pipeline file.

  • A GitLab.com user who is a member of the projects you want checked. Use an account with at least Maintainer access, otherwise GitLab hides protected branch and approval settings and the checks report Cannot verify ....
  • To evaluate 2FA, the user must own the groups. Groups the user does not own are not checked.

Create a personal access token with these scopes:

  • read_api
  • read_user
  • read_repository

Varman sends the token as Authorization: Bearer <token>. It only reads.

  1. In GitLab, open User Settings > Access Tokens and create a personal access token with the scopes above. See GitLab’s guide: Personal access tokens.

  2. Copy the token. GitLab shows it only once.

  3. In Varman, open Integrations, find GitLab and click Set up.

  4. Paste the token into Personal Access Token and click Connect account.

Varman stores only check results. The checks list the token user’s projects (most recently active first, up to 500) and owned groups (up to 500), and read each project’s protected branches, approval settings and .gitlab-ci.yml. Checks run on the daily schedule described in the overview, or when you click Run now.

Open Integrations > GitLab, click Settings, then Disconnect. Then revoke the token in GitLab under User Settings > Access Tokens. See Disconnecting for what Varman keeps.

  • No GitLab projects found. The user is not a member of any project, or the token is missing read_api (and read_repository for the scanning check).

  • Could not verify 2FA enforcement. Varman could not list owned groups. Check that the token is active and has read_api.

  • No owned GitLab groups to evaluate. This is a pass: the user owns no groups, so there is no group 2FA policy to check. Connect with a group owner’s token to evaluate 2FA.

  • Cannot verify branch protection for <project> or Cannot verify merge approvals for <project>. GitLab returned a permission error. Reconnect with an account that has at least Maintainer access to the project.

  • Cannot verify security scanning for <project>. The token cannot read the repository. Add the read_repository scope and project access.

  • No CI pipeline in <project> or No security scanning in <project>. Add GitLab’s managed security templates to .gitlab-ci.yml:

    include:
    - template: Jobs/SAST.gitlab-ci.yml
    - template: Jobs/Dependency-Scanning.gitlab-ci.yml

    See Static application security testing.

  • Default branch not protected in <project>. Add a rule under the project’s Settings > Repository > Protected branches. See Protected branches.

  • No merge approvals required in <project>. Set Approvals required to at least 1 under Settings > Merge requests. See Merge request approvals.