> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/content-collections/application-security/get-started/connect-code-and-build-providers/code-repositories/add-gitlab.md).

# GitLab

Integrate Prisma Cloud with your GitLab version control system (VCS) to gain visibility into, and monitor the systems, technologies, configurations, and pipelines that make up the GitLab platform.

This integration enables security scans to identify Infrastructure-as-Code (IaC) misconfigurations, Software Composition Analysis (SCA) vulnerabilities, exposed secrets, license mis-compliance and CI/CD pipeline risks in your GitLab environment, allowing you to understand and fix issues as soon as they are detected, resulting in an enhanced security posture for your organization.

The GitLab integration creates a webhook that triggers periodic scans of your code. These scans run on all pull requests (PRs), and their results are displayed in both the PR comments and reports.

Refer to [Subscribed Events](#subscribed-events) below for a list of subscribed events for which the integration is subscribed to.

1. Before you begin.
   1. Grant the Prisma Cloud user the necessary permissions for integrating Prisma Cloud with your GitLab VCS, as specified in [User Permissions](#user-permissions) below.
   2. Add the Prisma Cloud IP addresses and hostname for Application Security to an [allow list](/content-collections/get-started/console-prerequisites.md) to enable access to the Prisma Cloud Console.
2. On the Prisma Cloud Application Security console.
   1. In Application Security, select **Home** > **Settings** > **Connect Provider** > **Code & Build Providers**.

      <figure><img src="/files/XKnsAzR4JSx7Q1BGkVMp" alt="connect provider menu"><figcaption></figcaption></figure>
   2. Select **GitLab** (under Code Repositories) in the catalog that is displayed.

      <figure><img src="/files/LSFiWuVPnPC2pbtFdyTL" alt="connect provider"><figcaption></figcaption></figure>
   3. Select **Authorize** in the **Configure Account** step of the integration wizard that is displayed.

      You are redirected to GitLab to authorize Prisma Cloud access.

      <figure><img src="/files/ZIfIJdIj3HF3ROCSd1g8" alt="gitlab auth1.1"><figcaption></figcaption></figure>
3. On GitLab, review the requested permissions > **Authorize**.

   You are redirected to the **Select Repositories** step of the installation wizard on the Prisma Cloud console.

   <figure><img src="/files/A6d6YTEz2jJkGv5wOpZO" alt="gitlab select repos"><figcaption></figcaption></figure>
4. Select which repositories will be scanned:
   * **Permit all existing repositories**
   * **Permit all existing and future repositories**

     This is the recommended option to ensure complete coverage and successful operation of all features.
   * **Choose from repository list** > select repositories
5. Select **Next** > **Done** in the **Status** step of the wizard to complete the integration.
6. Verify integration.
   1. In **Application Security**, select **Home** > **Settings** > **Code & Build Providers**.
   2. Confirm that the status of the integrated **GitLab** repositories displays **Connected** under **Status**.

      It may take up to 3 minutes for the integration status to be updated.
7. Next step: Monitor and manage scan results.
   * View your selected GitLab repositories on the **Repositories** page. The next GitLab scan will include these repositories
   * To view scan results and resolve issues, in **Application Security** select **Home** > **Projects**. See [Monitor and Manage Code Build Issues](https://github.com/PaloAltoNetworks/pc-docs-md/tree/main/enterprise-edition/content-collections/application-security/risk-management/monitor-and-manage-code-build/monitor-and-manage-code-build.md) for more information

## Support for Multiple Integrations

Prisma Cloud supports multiple integrations for GitLab. After the initial integration with Prisma Cloud, you can continue to add additional organizations and workspaces using a different or a same user or team token.

Multiple integrations from a single Prisma Cloud account enables you to:

* View a list of integrations on a single console
* Add additional integrations
* Delete an existing integration

Selecting a repository for a specific integration will restrict you from selecting the same repository in another integration.

1. In Application Security, select **Home** > **Settings** > **Connect Provider** > **Code & Build Providers** > **GitLab** (under Code Repositories).
2. Select **Add Integration** in the wizard.
3. Execute the GitLab installation process above.
4. Next step: Monitor and manage scan results - see above.

## Manage Integrations

Manage integrations from the integration wizard.

1. Access the GitLab integration wizard on Prisma Cloud console - see the integration process above > select the menu under **Actions**.
2. From *Actions* you can:
   * Add or remove repositories from **Reselect repositories**
   * Delete integrations

## User Permissions

Authorize the user integrating Prisma Cloud with your GitLab instance with the following permissions.

* **Maintainer** permissions. Grants sufficient permissions to configure external integrations, manage repository access, and adjust CI/CD settings
* **api**: Grants full **read** and **write** access to the API, including all groups and projects, as well as permissions to interact with the container registry, the dependency proxy, and the package registry
* **Administrator repository permissions**: In order to scan pull requests (PRs), the user performing the integration must have administrative privileges for the repositories. This enables Prisma Cloud to set up subscription webhooks for the selected repositories

A repository can only be integrated with a single integration at a time. The first integration that connects with the repository will be the one it is assigned to. This means that if multiple integrations attempt to connect to the same repository, only the first integration to establish the connection will be associated with that repository.

## Subscribed Events

Below is a comprehensive list of events to which Prisma Cloud is subscribed. These events encompass various actions and changes occurring within your GitLab environment that trigger notifications and integrations with Prisma Cloud:

**Projects**:

* **merge\_requests\_events**: This event is triggered when merge or pull requests are created, updated, merged, closed, or have changes made to them
* **push\_events**: This event occurs whenever code changes are pushed to a repository, indicating new commits being added to the version control history
* **tag\_push\_events**: This event is triggered when new tags are pushed to a repository
* **note\_events**: This event is generated when comments or notes are added to various objects within GitLab, such as issues, merge requests, or commits
* **confidential\_note\_events**: Similar to `note_events`, but specifically for confidential comments or notes that are restricted to certain users or groups
* **issues\_events**: This event is triggered when issues are created, updated, closed, or have changes made to them
* **confidential\_issues\_events**: Similar to `issues_events`, but specifically for confidential issues that are restricted to certain users or groups
* **job\_events**: This event occurs when jobs defined in CI/CD pipelines are created, updated, started, finished, or have changes made to them
* **pipeline\_events**: This event is generated when pipelines are created, updated, started, finished, or have changes made to them
* **wiki\_page\_events**: This event occurs when changes are made to wiki pages within GitLab, including creation, updates, and deletions
* **deployment\_events**: This event is triggered when deployments are created, updated, started, finished, or have changes made to them
* **releases\_events**: This event occurs when releases are created, updated, published, or have changes made to them

**Groups**:

* **subgroup\_events**: This event is specific to GitLab groups and occurs when changes are made to subgroups within a group hierarchy


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/content-collections/application-security/get-started/connect-code-and-build-providers/code-repositories/add-gitlab.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
