> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/g/gitlab.md).

# Gitlab

GitLab is a DevSecOps platform for source code management, CI/CD and security scanning. OctoXLabs reads the user accounts of a GitLab instance and adds them to the user inventory.

## Use cases

* List all GitLab user accounts.

```
Adapters = gitlab
```

* Find GitLab users with no sign-in for 90 days.

```
Adapters = gitlab AND NOT LastLogOnTime last now-90d/d
```

## Before you begin

### Network

| Source              | Destination | Port                        | Protocol                           |
| ------------------- | ----------- | --------------------------- | ---------------------------------- |
| OctoXLabs connector | GitLab host | 443 (default, configurable) | HTTPS (HTTP when Is secure is off) |

### Required permissions

| Scope or role                          | Permission | Needed for    |
| -------------------------------------- | ---------- | ------------- |
| Personal access token scope `read_api` | Read       | Listing users |

The user who owns the token may need to be an administrator to see all users and their email addresses. This is Not verified.

## Create credentials in GitLab

{% stepper %}
{% step %}

### Open the access tokens page

Select **Edit Profile** from your avatar icon, then open the **Access Token** page.
{% endstep %}

{% step %}

### Create the token

Click **Add New Token**, give it the **read\_api** scope and create it. Copy the token.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter             | Required | Type             | Default | Description                              |
| --------------------- | -------- | ---------------- | ------- | ---------------------------------------- |
| Ip                    | Yes      | Text             | None    | IP address or domain of the GitLab host. |
| Port                  | No       | Integer          | 443     | Port number.                             |
| Personal access token | Yes      | Text (sensitive) | None    | The token.                               |
| Is secure             | No       | Boolean          | True    | Use SSL.                                 |
| Timeout               | No       | Integer          | 30      | Seconds to wait for API responses.       |

## Troubleshooting

| Error message | Cause                                        | Fix                                                        |
| ------------- | -------------------------------------------- | ---------------------------------------------------------- |
| Not verified  | The code has no adapter-specific error text. | Check the log for `Status Code`, `URL` and `Method` lines. |

## Change history
