# GitLab

## Prepare for SCM Integration Setup

* Within Threat Center, navigate to Admin-> Settings->Integrations->SCM Integrations.
* Take note of your Redirect URL as you'll need it in the next step.&#x20;

## Create Instance or Group GitLab OAuth Application

Login to GitLab with a user that has permission to create an application

1. Login to GitLab with a user that has permission to create an application
   1. This should be a service account.
2. Navigate to the group for which you wish to add the application
3. On the left menu, select Select Settings -> Applications
4. Click "Add new application"
5. Enter Name "Threatrix"
6. Enter the `Redirect URIfrom the Threatrix dashboard`
7. &#x20;Select the following permissons:
   * api (Access the authenticated user's API)
   * read\_user (Read the authenticated user's personal information)
   * read\_repository (Allows read-only access to the repository)
   * write\_repository (Allows read-write access to the repository)
8. Click "Save application"

Copy your application ID and Secret as you'll need them for the next step.&#x20;

<figure><img src="https://3093892275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbsieSiu0D66DBFP4uh%2Fuploads%2FF5Q7C2PtP3MjKKh5DPNE%2Fimage.png?alt=media&#x26;token=9a3f6923-6464-4598-a87f-782e71b6eee2" alt=""><figcaption></figcaption></figure>

## Complete SCM Integration

In Threat Center, SCM Integration,  complete the following fields&#x20;

* Name: Use a unique name that employees will recognize, like your team, group or division. If necessary, add the SCM type if there are more than one in the same group.
* Provider Type: Select GITLAB from the&#x20;
* Base URL: This is the URL of your SCM server
* Token URL: The Token URL of your server
* Authorization URL: The authorization URL of your server
* Client ID / Application ID: This is the Application ID or Client ID provided to you when you created your application in your SCM
* Client Secret / Secret: This is the secret provided to you when you created your application in your SCM.

<figure><img src="https://3093892275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbsieSiu0D66DBFP4uh%2Fuploads%2FRLYHBBOHwjr2i1wYWIg9%2Fimage.png?alt=media&#x26;token=a74f00bd-805f-48c0-a3fd-fe780394115f" alt=""><figcaption></figcaption></figure>
