GitLab
Integrating GitLab with Escape's ASM provides Code-to-Cloud visibility by matching your Code Resolvers with your Cloud Resources, through API Discovery from Code. The same integration supplies repositories for whitebox and continuous AI pentesting.
Discovered Resources¶
The GitLab integration automatically discovers and inventories the following resources from your GitLab instance:
- GitLab Repositories: All repositories within the group or project scope
- API Schema Files: OpenAPI specifications and Postman collections found in repositories. GraphQL schemas are not extracted
- Extracted APIs: API endpoints and services defined in discovered schema files
The integration scans your repositories for API schema files, extracts API definitions, and automatically classifies them as Assets (APIs) in Escape's ASM. This enables Code-to-Cloud security monitoring by linking discovered APIs to their source repositories and enabling continuous testing as code changes.
Create a GitLab Personal Access Token¶
Escape accepts a legacy personal access token (glpat-…) or a fine-grained personal access token. Token scopes or permissions alone are not enough: the GitLab user behind the token must also hold the right membership role on the groups and projects Escape will use.
Membership role¶
| What you need Escape to do | Role the token user needs |
|---|---|
| ASM discovery, whitebox, continuous On a schedule or After a deploy | At least Developer on each project Escape must list, read, and clone |
| Continuous On every merge (Escape installs hooks) | Owner (or Administrator) on each root group Escape should hook. Maintainer is not enough for group webhook create |
| Continuous On every merge (you create hooks) | At least Developer to list, read, and clone; create a group Push Hook yourself (see below) |
Escape installs merge webhooks only on root groups (GitLab top-level groups — for example gitlab.com/acme, not a subgroup like gitlab.com/acme/backend). A root-group hook covers projects in that group and its subgroups. If Escape cannot create hooks (missing Owner or webhook permissions), create a Push events group webhook yourself on each root group, pointed at https://gitlab.escape.tech/webhooks/<integration-id> (use your GitLab integration id from Escape).
Legacy personal access token (glpat-…)¶
- Open Personal access tokens (Preferences → Access tokens → Personal access token).
- Create a token with the scopes below.
- Copy the token immediately — GitLab shows it only once.
| Use | Scopes |
|---|---|
| ASM discovery, whitebox, continuous schedule / after deploy | read_api, read_repository |
| Continuous On every merge | api, read_repository |
api is required for Escape to list, create, and update group Push Hooks. read_api alone cannot create hooks. When you select api, you do not also need read_api.
For a token that covers discovery, whitebox, and On every merge, use api + read_repository.
Fine-grained personal access token¶
- Open Access tokens → Fine-grained token.
- Under Group and project access, select the groups and projects Escape must reach (or all memberships).
- Add resource permissions, under "Group and project" resource permissions, grant: | Need | Fine-grained permissions | | ----------------------------------------------------- | --------------------------------------------------------------------- | | Read a group or project | Group → Read; Project → Read | | List branches and resolve the tip | Branch → Read | | Read repository files / tree over the API | Repository → Read | | Clone repositories (scanners / whitebox / continuous) | Code → Read | | Continuous On every merge | Webhook → Read, Create, and Update on the groups Escape hooks |
- Under "User" resource permissions, grant Group → Read and Project → Read. Escape lists memberships with
GET /groupsandGET /projects, which require these on the User boundary — Group/Project Read under group-and-project access alone is not enough.
Fine-grained permissions authorize the API calls. The token owner must still be Owner on each root group Escape should hook when Escape installs Push Hooks for On every merge.

For more details, see GitLab’s documentation on personal access tokens and fine-grained personal access tokens.
Connect the integration¶
- In Escape, open Integrations → GitLab and create the integration with your token.
- After save, open the integration settings and confirm the Webhook setup check succeeds when you plan to use continuous On every merge. If create or update is denied, the token is missing Webhook permissions or the user is not Owner on that group. If listing groups fails, grant User → Group → Read (fine-grained) or ensure membership.
Whitebox and continuous pentesting¶
Use the same GitLab integration when you pick repositories on an AI App Pentesting profile (whitebox) or on the continuous setup page. For each watched repository, choose the GitLab integration first, then the project and branch. See Continuous Pentesting.
Self-Hosted GitLab¶
In the integration form, enable This is a self-hosted GitLab instance and set Instance URL to your API base URL, for example https://gitlab.example.com/api/v4.
Internal Networks and Services¶
When integrating with internal networks and services, you may need to:
- Configure a Private Location
- Whitelist FQDNs
For more information, see Private Locations.