Enterprise Gitlab discovery

Overview

Twigs can discover all repositories in your enterprise Gitlab account as assets. This can be used for self-hosted Gitlab instances as well. The discovery of repositories works exactly like a regular git repository (“repo” mode in twigs). All options associated with the “repo” mode such as SAST checks, IaC checks, secrets scans etc. will for Gitlab discovery as well. Please refer to the documentation for repo mode for more details.

Authentication with Gitlab

Supported authentication mode is using Gitlab access tokens. These can be set up in your Gitlab enterprise account for a given user or a Gitlab “Project”. Refer to this link for creating and managing Gitlab access tokens.

The following CLI switches are important for authentication with Gitlab Enterprise:

  • --gl_access_token Refers to the personal or project access token
  • --gl_host Refers to the FQDN of your Gitlab Enterprise server if it is self hosted. Otherwise it will default to gitlab.com

Prerequisites

Requirements for this mode are the same as “repo” mode in twigs. Please refer to the documentation for repo mode for more details.

Steps

  • You can run the command as below:

twigs gitlab (--gl_access_token {access token}) [--gl_host {fqdn of gitlab server}] [other twigs options for repo mode]

After discovery is complete, you can login into ThreatWorx Console to view the newly discovered assets from your Gitlab Enterprise account.

Examples

$ twigs gitlab --gl_access_token 'rhwbrs....drhdx'

Discover repositories on public “gitlab.com” as assets in ThreatWorx.

$ twigs gitlab --gl_access_token 'gtHRce....GHyhd' --gl_host hosted_gitlab.intranet.somecompany.com

Discover repositories on self hosted gitlab instance as assets in ThreatWorx.