> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/container-image-scanning/standalone-registries/gitlab-self-managed-container-registry.md).

# Gitlab Self Managed Container Registry

You can integrate your GitLab Self Managed Container Registry with Aikido to scan your containers for known vulnerabilities.

Follow the simple steps below to activate this feature:

**Step 1:** Log into your GitLab account to gather some data.

We'll have to gather your username (see screenshot)

![](https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-0af8953d661da3d27bd7aac01cc1adcd97b50a70%2Fucarecdn-7a56ad48-6f3c-4291-97c1-b36896ef0de0.png?alt=media)

**Step 2:** Copy the group ID where the container registry resides (see screenshot)

![](https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-df1cc77167c9a675613b9ae735d3408906f102b7%2Fucarecdn-9c7c898a-dc4e-4169-82c2-708df1c479f1.png?alt=media)

**Step 3:** Go to **Personal Preferences** >> **Access tokens**, and create a new personal access token for Aikido ([direct link](https://gitlab.com/-/user_settings/personal_access_tokens)). Make sure to set the correct scopes: `read_api`, `read_registry`

{% hint style="warning" %}
Make sure to create a **Personal Access Token**, and not an **Impersonation Token**.
{% endhint %}

![](https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-a1cbdb7c980480d5a2ad4f72e88c9f5f7d11dfc2%2Fucarecdn-167e7af9-436c-43f9-a585-a6bd0d693234.png?alt=media)

**Step 4:** Enter the collected data in Aikido (direct link: <https://app.aikido.dev/settings/container-image-registry/add/gitlab-self>)

![Form to connect GitLab self-hosted container image registry with required credentials.](https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-1d7d325723206eb09c82e4f65505054774ab3ecf%2Fucarecdn-1d74b1b9-dacb-49e5-840f-1d3e7e38ab6e.png?alt=media)

**Step 5:** Aikido will now find all container repositories you can access and list them.

**Step 6:** Repositories can be linked to a code repository in order to perform better deduplication of findings. This step is optional!

**Step 7:** In the action menu next to the registry, click 'scan repos in registry' to get started. Results will appear in the Feed!

## Connect a registry on an internal network (Broker)

If your GitLab instance or its container registry is not reachable from the internet, connect them through the [Aikido Broker](/miscellaneous-info/aikido-broker-for-internal-applications.md).

{% hint style="warning" %}
GitLab usually serves the container registry on a different host than the GitLab instance. Add **both** as Broker resources:

1. The GitLab instance URL, for example `https://gitlab.example.com`
2. The registry URL, for example `https://registry.example.com`

You can find the registry URL in GitLab under **Deploy > Container Registry**, or in the `registry_external_url` setting of your `gitlab.rb`.
{% endhint %}

{% stepper %}
{% step %}
**Add both resources to the Broker**

On the [Broker Clients page](https://app.aikido.dev/settings/integrations/broker/clients), add the GitLab instance URL and the registry URL as resources on your broker client.
{% endstep %}

{% step %}
**Use the GitLab instance's Broker URL**

In the Aikido registry form (Step 4), enter the Broker URL of the **GitLab instance** resource in the **Instance Url** field. You don't need to paste the registry's Broker URL anywhere.
{% endstep %}

{% step %}
**Scan the registry**

Start the scan as described in Step 7. If you see `unable to login to registry ... Client.Timeout exceeded`, the registry host is missing from your Broker resources, or the Broker can't reach it. Check the `ALLOWED_INTERNAL_SUBNETS` and `DNS_SERVERS` settings of your broker.
{% endstep %}
{% endstepper %}

***


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/container-image-scanning/standalone-registries/gitlab-self-managed-container-registry.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
