GitLab Integration Guide

What the Integration Does

The integration uses a dedicated GitLab access token to read data from your GitLab instance. All access is read-only. No data is written, updated, or deleted in your GitLab instance.

Data is extracted incrementally based on timestamps, so only new or modified records are pulled after the initial sync.


Step 1: Choose an Access Token Type

GitLab supports several token types. Choose the one that best fits your organization's security policy:

Token TypeScopeBest For
Group Access TokenAll projects within a group and its subgroupsMost deployments — scoped to a group hierarchy
Project Access TokenA single projectNarrow access to one repository
Personal Access TokenAll projects the user has access toQuick setup, but tied to an individual account

Recommendation: Use a Group Access Token scoped to the top-level group that contains the projects DevGrid needs to access. This keeps the token scoped appropriately and not tied to any individual's account.


Step 2: Create the Access Token

Option A: Group Access Token (Recommended)

  1. Navigate to your group in GitLab
  2. Go to Settings > Access Tokens
  3. Click Add new token
  4. Fill in:
    • Token name: DevGrid Integration (or your preferred name)
    • Expiration date: Set per your security policy (recommended: 1 year, with a calendar reminder to rotate)
    • Role: Reporter
    • Scopes: See the table in Step 3
  5. Click Create group access token
  6. Copy the token immediately — it will not be shown again

Option B: Project Access Token

  1. Navigate to the project in GitLab
  2. Go to Settings > Access Tokens
  3. Follow the same configuration as above, with role Reporter

Option C: Personal Access Token

  1. Navigate to User Settings > Access Tokens (or Preferences > Access Tokens in newer versions)
  2. Follow the same configuration as above
  3. The token inherits the user's project access, so ensure the user has at least Reporter access to the relevant projects

Note for self-managed GitLab: Group and project access tokens require a GitLab Premium or Ultimate license. If you are on GitLab Free (self-managed), use a Personal Access Token attached to a dedicated service account user.


Step 3: Required Token Scopes

The following scopes are required:

ScopeRequiredWhy
read_apiYesRead access to all API endpoints (projects, issues, merge requests, pipelines, jobs, groups, users, vulnerabilities, security findings)
read_repositoryYesRead access to repository commits and file contents
read_userRecommendedRead access to user profile and group membership information

At minimum, read_api and read_repository are required. Without read_repository, commit, file-level, and dependency discovery data will not be available.


Step 4: Required Role Permissions

The token (or the user behind it) needs at least Reporter access to the groups and projects that DevGrid will sync. Here's what each data type requires:

DataMinimum RoleGitLab API Used
GroupsReporterGET /groups
ProjectsReporterGET /projects
IssuesReporterGET /projects/:id/issues
Merge RequestsReporterGET /projects/:id/merge_requests
MR CommentsReporterGET /projects/:id/merge_requests/:iid/notes
MR File DiffsReporterGET /projects/:id/merge_requests/:iid/diffs
MR CommitsReporterGET /projects/:id/merge_requests/:iid/commits
PipelinesReporterGET /projects/:id/pipelines
JobsReporterGET /projects/:id/jobs
CommitsReporterGET /projects/:id/repository/commits
Commit File DiffsReporterGET /projects/:id/repository/commits/:sha/diff
Users / MembersReporterGET /groups/:id/members/all
Dependencies (SBOM)ReporterGET /projects/:id/dependencies
VulnerabilitiesDeveloperGET /projects/:id/vulnerabilities
Vulnerability FindingsDeveloperGET /projects/:id/vulnerability_findings
Secret Detection ResultsDeveloperGET /projects/:id/vulnerability_findings?scanner=secret_detection

Note on Security Features: Vulnerability, secret detection, and SAST/DAST findings require GitLab Ultimate with the relevant scanners enabled. If unavailable, the integration gracefully skips these tables — no errors will occur.

Note on Dependencies: The dependency list endpoint requires Dependency Scanning or Container Scanning to be enabled. If unavailable, it is also skipped gracefully.


Step 5: Data We Collect

The integration reads from the following 13 GitLab resources. All access is read-only.

Groups, Projects & Users

ResourceDescription
GroupsGroup hierarchy and metadata
ProjectsProject metadata (non-archived, membership-scoped)
UsersUser accounts visible via group membership

Issues & Merge Requests

ResourceDescription
IssuesProject issues
Merge RequestsMerge request metadata and status
MR CommentsReview comments and discussion notes on merge requests
MR File DiffsFile-level changes in merge requests
MR CommitsCommits included in each merge request

CI/CD

ResourceDescription
PipelinesCI/CD pipeline runs and status
JobsIndividual CI/CD job executions

Repository & Code

ResourceDescription
CommitsRepository commit history
Commit File DiffsFile-level changes per commit
Repository FilesFile contents from the default branch, including package manifest files (e.g., package.json, go.mod, requirements.txt) for dependency discovery and devgrid.yml configuration files

Security & Compliance

ResourceDescription
DependenciesSoftware dependency list / SBOM via GitLab's Dependency Scanning (requires GitLab Ultimate)
VulnerabilitiesVulnerability records from SAST, DAST, Container Scanning, and Dependency Scanning (requires GitLab Ultimate)
Vulnerability FindingsDetailed security findings including severity, location, and remediation status
Secret Detection ResultsDetected secrets and credentials in source code (requires GitLab Ultimate with Secret Detection enabled)

Step 6: Provide Credentials to DevGrid

Share the following with your DevGrid contact:

ItemExample
GitLab Instance URLhttps://gitlab.com or https://gitlab.yourcompany.com
Access Tokenglpat-xxxxxxxxxxxxxxxxxxxx
Token TypeGroup / Project / Personal
ScopeWhich group(s) or project(s) the token covers

Use a secure method to transmit the access token (password manager share, encrypted message, etc.). Never send tokens over email.


Step 7: Verify Access

Before handing off the token, verify it can access the expected resources.

Quick Test via cURL

# Test basic API access
curl -s --header "PRIVATE-TOKEN: YOUR_TOKEN" \
  "https://YOUR_GITLAB/api/v4/projects?membership=true&per_page=5" | jq '.[].name_with_namespace'

# Test group access
curl -s --header "PRIVATE-TOKEN: YOUR_TOKEN" \
  "https://YOUR_GITLAB/api/v4/groups?per_page=5" | jq '.[].full_path'

# Test commit access (replace PROJECT_ID with a real project ID)
curl -s --header "PRIVATE-TOKEN: YOUR_TOKEN" \
  "https://YOUR_GITLAB/api/v4/projects/PROJECT_ID/repository/commits?per_page=1" | jq '.[].title'

A successful response returns HTTP 200 with JSON data. If you get HTTP 401, the token is invalid. If you get HTTP 403, the token lacks permissions for that resource.


Network & Firewall Considerations

The integration connects outbound from DevGrid infrastructure to your GitLab instance over HTTPS (port 443).

  • GitLab.com: No firewall changes needed.
  • Self-managed GitLab: If your instance restricts inbound connections by IP, contact your DevGrid representative for the list of source IP addresses to allowlist.

API Usage & Rate Limiting

The integration is designed to be respectful of your GitLab instance:

  • Read-only: no writes, updates, or deletes
  • Paginated requests: fetches records in pages (up to 100 per request, GitLab's maximum)
  • Rate-limit aware: honors Retry-After and RateLimit-Remaining headers; automatically backs off when rate limits are approached
  • Incremental: after the initial sync, only new/modified records are fetched
  • Concurrent but controlled: limited parallel requests (default 3 concurrent table syncs)

For GitLab.com, the default rate limit is 2,000 requests per minute for authenticated users. The integration stays well within this limit under normal operation.


Token Rotation

When you need to rotate the access token:

  1. Create a new token following Step 2
  2. Send the new token to your DevGrid contact via a secure channel
  3. DevGrid will update the configuration (can be done with zero downtime)
  4. Revoke the old token in GitLab

Tip: Set a calendar reminder before the token's expiration date. Expired tokens will cause sync failures until replaced.


Frequently Asked Questions

Q: Does the integration write any data to our GitLab instance?
A: No. All access is strictly read-only.

Q: Can we limit which projects are synced?
A: Yes. Using a Group Access Token automatically limits scope to that group's projects. Additional filtering (by project name, path, or other criteria) can be configured on the DevGrid side.

Q: Does this work with GitLab self-managed?
A: Yes. Provide your instance URL (e.g., https://gitlab.yourcompany.com) instead of https://gitlab.com.

Q: What GitLab versions are supported?
A: The integration uses the GitLab REST API v4, which is available on GitLab 12.0 and newer. All currently supported GitLab versions are compatible.

Q: What if we don't have GitLab Ultimate?
A: The security tables (vulnerabilities, vulnerability findings, secret detection, dependencies) require GitLab Ultimate with the relevant scanners enabled. If unavailable, those tables are automatically skipped. All other tables work on any GitLab tier.


Support

If you have questions about the integration or need help configuring access, contact your DevGrid representative or reach out to [email protected].