> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ghostsecurity.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connections

> Connections to source code providers

Seamlessly connect your source code repositories to Ghost to automatically discover repositories for deep code analysis by the [Exorcist](/exorcist) security analysis engine.

## Providers

Ghost supports the following source code providers:

<CardGroup cols={2}>
  <Card
    title="GitHub"
    href="#github"
    icon={
  <svg viewBox="0 0 128 128" {...props}>
    <g fill="currentColor">
      <path
        fillRule="evenodd"
        d="M64 5.103c-33.347 0-60.388 27.035-60.388 60.388 0 26.682 17.303 49.317 41.297 57.303 3.017.56 4.125-1.31 4.125-2.905 0-1.44-.056-6.197-.082-11.243-16.8 3.653-20.345-7.125-20.345-7.125-2.747-6.98-6.705-8.836-6.705-8.836-5.48-3.748.413-3.67.413-3.67 6.063.425 9.257 6.223 9.257 6.223 5.386 9.23 14.127 6.562 17.573 5.02.542-3.903 2.107-6.568 3.834-8.076-13.413-1.525-27.514-6.704-27.514-29.843 0-6.593 2.36-11.98 6.223-16.21-.628-1.52-2.695-7.662.584-15.98 0 0 5.07-1.623 16.61 6.19C53.7 35 58.867 34.327 64 34.304c5.13.023 10.3.694 15.127 2.033 11.526-7.813 16.59-6.19 16.59-6.19 3.287 8.317 1.22 14.46.593 15.98 3.872 4.23 6.215 9.617 6.215 16.21 0 23.194-14.127 28.3-27.574 29.796 2.167 1.874 4.097 5.55 4.097 11.183 0 8.08-.07 14.583-.07 16.572 0 1.607 1.088 3.49 4.148 2.897 23.98-7.994 41.263-30.622 41.263-57.294C124.388 32.14 97.35 5.104 64 5.104z"
        clipRule="evenodd"
      />
      <path d="M26.484 91.806c-.133.3-.605.39-1.035.185-.44-.196-.685-.605-.543-.906.13-.31.603-.395 1.04-.188.44.197.69.61.537.91zm2.446 2.729c-.287.267-.85.143-1.232-.28-.396-.42-.47-.983-.177-1.254.298-.266.844-.14 1.24.28.394.426.472.984.17 1.255zm2.382 3.477c-.37.258-.976.017-1.35-.52-.37-.538-.37-1.183.01-1.44.373-.258.97-.025 1.35.507.368.545.368 1.19-.01 1.452zm3.261 3.361c-.33.365-1.036.267-1.552-.23-.527-.487-.674-1.18-.343-1.544.336-.366 1.045-.264 1.564.23.527.486.686 1.18.333 1.543zm4.5 1.951c-.147.473-.825.688-1.51.486-.683-.207-1.13-.76-.99-1.238.14-.477.823-.7 1.512-.485.683.206 1.13.756.988 1.237zm4.943.361c.017.498-.563.91-1.28.92-.723.017-1.308-.387-1.315-.877 0-.503.568-.91 1.29-.924.717-.013 1.306.387 1.306.88zm4.598-.782c.086.485-.413.984-1.126 1.117-.7.13-1.35-.172-1.44-.653-.086-.498.422-.997 1.122-1.126.714-.123 1.354.17 1.444.663zm0 0" />
    </g>
  </svg>
}
  />

  <Card
    title="GitLab"
    href="#gitlab"
    icon={
  <svg viewBox="0 0 128 128" {...props}>
    <path
      fill="#E24329"
      d="m124.755 51.382-.177-.452L107.47 6.282a4.459 4.459 0 0 0-1.761-2.121 4.581 4.581 0 0 0-5.236.281 4.578 4.578 0 0 0-1.518 2.304L87.404 42.088H40.629L29.077 6.746a4.492 4.492 0 0 0-1.518-2.31 4.581 4.581 0 0 0-5.236-.281 4.502 4.502 0 0 0-1.761 2.121L3.422 50.904l-.17.452c-5.059 13.219-.763 28.192 10.537 36.716l.059.046.157.111 26.061 19.516 12.893 9.758 7.854 5.93a5.283 5.283 0 0 0 6.388 0l7.854-5.93 12.893-9.758 26.218-19.634.065-.052c11.273-8.526 15.562-23.472 10.524-36.677z"
    />
    <path
      fill="#FC6D26"
      d="m124.755 51.382-.177-.452a57.79 57.79 0 0 0-23.005 10.341L64 89.682c12.795 9.68 23.934 18.09 23.934 18.09l26.218-19.634.065-.052c11.291-8.527 15.586-23.488 10.538-36.704z"
    />
    <path
      fill="#FCA326"
      d="m40.066 107.771 12.893 9.758 7.854 5.93a5.283 5.283 0 0 0 6.388 0l7.854-5.93 12.893-9.758s-11.152-8.436-23.947-18.09a18379.202 18379.202 0 0 0-23.935 18.09z"
    />
    <path
      fill="#FC6D26"
      d="M26.42 61.271A57.73 57.73 0 0 0 3.422 50.904l-.17.452c-5.059 13.219-.763 28.192 10.537 36.716l.059.046.157.111 26.061 19.516L64 89.655 26.42 61.271z"
    />
  </svg>
}
  />

  <Card
    title="Bitbucket"
    href="#bitbucket"
    icon={
  <svg viewBox="0 0 128 128" {...props}>
    <defs>
      <linearGradient
        id="a"
        x1={28.593}
        x2={16.672}
        y1={14.226}
        y2={23.532}
        gradientTransform="scale(4)"
        gradientUnits="userSpaceOnUse"
      >
        <stop offset={0.176} stopColor="#0052cc" />
        <stop offset={1} stopColor="#2684ff" />
      </linearGradient>
    </defs>
    <path
      fill="#2684ff"
      d="M19.082 20c-1.918 0-3.355 1.758-3.039 3.516l12.95 79.289c.32 2.078 2.077 3.515 4.155 3.515h62.66c1.442 0 2.72-1.12 3.04-2.558l13.109-80.086c.316-1.918-1.121-3.516-3.039-3.516zM74.07 77.227H54.09l-5.278-28.293h30.215zm0 0"
    />
    <path
      fill="url(#a)"
      d="M107.64 48.934H78.868L74.07 77.227H54.09l-23.5 27.972s1.12.961 2.719.961h62.66c1.441 0 2.719-1.12 3.039-2.558zm0 0"
    />
  </svg>
}
  />

  <Card
    title="Azure DevOps"
    href="#azure-devops"
    icon={
  <svg viewBox="0 0 128 128">
    <defs>
      <linearGradient
        id="a"
        gradientUnits="userSpaceOnUse"
        x1="9"
        y1="16.97"
        x2="9"
        y2="1.03"
        gradientTransform="scale(7.11111)"
      >
        <stop offset="0" stop-color="#0078d4"></stop>
        <stop offset=".16" stop-color="#1380da"></stop>
        <stop offset=".53" stop-color="#3c91e5"></stop>
        <stop offset=".82" stop-color="#559cec"></stop>
        <stop offset="1" stop-color="#5ea0ef"></stop>
      </linearGradient>
    </defs>
    <path
      fill="url(#a)"
      d="M120.89 28.445v69.262l-28.445 23.324-44.09-16.07v15.93L23.395 88.25l72.746 5.688V31.574ZM96.64 31.93 55.82 7.11v16.285L18.348 34.418 7.109 48.852v32.785l16.075 7.11V46.718Zm0 0"
    ></path>
  </svg>
}
  />
</CardGroup>

<Note>
  After adding a connection, Ghost will automatically discover repositories and begin collection metadata within a few
  minutes.
</Note>

### GitHub

<Warning>
  To install the Ghost GitHub app, you **must** link your GitHub account to your Ghost account first. This is a one-time
  step that can be performed in the [Settings](https://app.ghostsecurity.ai/settings) view under **Linked Accounts**.
</Warning>

To add a GitHub connection, install the [Ghost GitHub](https://github.com/apps/ghost-security) app and choose which
repositiories to grant access to the Ghost Platform.

<Icon icon="flag" iconType="regular" />  **Permissions**

The Ghost GitHub app requires the following permissions:

| Access           | Resources         |
| :--------------- | :---------------- |
| `Read`           | Code and metadata |
| `Read` + `Write` | Pull requests     |
| `Read` + `Write` | Check statuses    |
| `Read` + `Write` | Commit statuses   |

<Icon icon="link" iconType="regular" />  **Connection**

To install the Ghost GitHub app, you need to be an admin of a GitHub organization. If you are not a
GitHub organization admin, you can request the Ghost GitHub app to be installed by an organization
admin. Once the app installation is approved, the installation will complete automatically.

### GitLab

To add a GitLab connection, first create a [service account](https://docs.gitlab.com/user/profile/service_accounts/#create-a-service-account),
then create a [personal access token](https://docs.gitlab.com/user/profile/service_accounts/#create-a-personal-access-token-for-a-service-account).

<Icon icon="flag" iconType="regular" />  **Permissions**

The GitLab access token must have the role `reporter` or higher with the following scopes assigned:

| Scope             | Resources                           |
| :---------------- | :---------------------------------- |
| `read_api`        | Read access to the scoped group API |
| `read_repository` | Read access to the projects         |

<Warning>
  If you plan to enable [merge request reviews](/concepts/reviews), additional permissions are required. See the [GitLab Reviews documentation](/concepts/reviews#gitlab) for details.
</Warning>

<Icon icon="link" iconType="regular" />  **Connection**

To create the connection, go to [Connections](https://app.ghostsecurity.ai/connections) click the "New Connection" button.

Select "GitLab" and provide the following information:

* **Group path**: The path to your GitLab group. If your Gitlab URL is `https://gitlab.com/ghost/mygroup`, the group path is `ghost/mygroup`.
* **URL** (optional): The URL of your GitLab instance. Only required if your GitLab instance is not hosted at `https://gitlab.com`.
* **Personal Access Token**: The personal access token to use for the service account.

Click the "Save connection" button to create the connection.

### Bitbucket

To add a Bitbucket connection, first create a [personal access token](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/).

<Icon icon="flag" iconType="regular" />  **Permissions**

The Bitbucket personal access token must have the following scope:

| Access | Resources    |
| :----- | :----------- |
| `Read` | Projects     |
| `Read` | Repositories |

<Warning>
  If you plan to enable [pull request reviews](/concepts/reviews), additional permissions are required. See the [Bitbucket Reviews documentation](/concepts/reviews#bitbucket) for details.
</Warning>

<Icon icon="link" iconType="regular" />  **Connection**

To create the connection, go to [Connections](https://app.ghostsecurity.ai/connections) click the "New Connection" button.

Select "Bitbucket" and provide the following information:

* **Workspace ID**: The ID of your Bitbucket workspace. If your Bitbucket URL is `https://bitbucket.org/ghost/myrepo`, the workspace ID is `ghost`.
* **Access Token**: The personal access token to use for the service account.

Click the "Save connection" button to create the connection.

### Azure DevOps

To add an Azure DevOps connection, first create a [personal access token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\&tabs=preview-page).

<Icon icon="flag" iconType="regular" />  **Permissions**

The Azure DevOps personal access token must have the following scope:

| Access | Resources        |
| :----- | :--------------- |
| `Read` | Code             |
| `Read` | Project and Team |

<Warning>
  If you plan to enable [pull request reviews](/concepts/reviews), additional permissions are required. See the [Azure DevOps Reviews documentation](/concepts/reviews#azure-devops) for details.
</Warning>

<Icon icon="link" iconType="regular" />  **Connection**

To create the connection, go to [Connections](https://app.ghostsecurity.ai/connections) click the "New Connection" button.

Select "Azure DevOps" and provide the following information:

* **Organization URL**: The URL of your Azure DevOps organization. If your Azure DevOps URL is `https://dev.azure.com/ghost`, the organization URL is `https://dev.azure.com/ghost`.
* **Personal Access Token**: The personal access token to use for the service account.

Click the "Save connection" button to create the connection.

## Deleting a connection

You can delete a connection by clicking the context menu (<Icon icon="ellipsis" />) and selecting "Delete" in the [Connections](https://app.ghostsecurity.ai/connections) view.
Deleting a connection will disable automatic discovery and scanning of repos, but will not delete any existing repos or findings.
