feature: gitlab secret scanning
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Create"
|
||||
openapi: "POST /api/v2/secret-scanning/data-sources/gitlab"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Delete"
|
||||
openapi: "DELETE /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Get by ID"
|
||||
openapi: "GET /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Get by Name"
|
||||
openapi: "GET /api/v2/secret-scanning/data-sources/gitlab/data-source-name/{dataSourceName}"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "List Resources"
|
||||
openapi: "GET /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}/resources"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "List Scans"
|
||||
openapi: "GET /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}/scans"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "List"
|
||||
openapi: "GET /api/v2/secret-scanning/data-sources/gitlab"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Scan Resource"
|
||||
openapi: "POST /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}/resources/{resourceId}/scan"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Scan"
|
||||
openapi: "POST /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}/scan"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Update"
|
||||
openapi: "PATCH /api/v2/secret-scanning/data-sources/gitlab/{dataSourceId}"
|
||||
---
|
||||
@@ -220,7 +220,8 @@
|
||||
"pages": [
|
||||
"documentation/platform/secret-scanning/overview",
|
||||
"documentation/platform/secret-scanning/bitbucket",
|
||||
"documentation/platform/secret-scanning/github"
|
||||
"documentation/platform/secret-scanning/github",
|
||||
"documentation/platform/secret-scanning/gitlab"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1199,6 +1200,21 @@
|
||||
"api-reference/endpoints/secret-scanning/data-sources/github/scan",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/github/scan-resource"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "GitLab",
|
||||
"pages": [
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/list",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/get-by-id",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/get-by-name",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/list-resources",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/list-scans",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/create",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/update",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/delete",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/scan",
|
||||
"api-reference/endpoints/secret-scanning/data-sources/gitlab/scan-resource"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
103
docs/documentation/platform/secret-scanning/gitlab.mdx
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
title: "GitLab Secret Scanning"
|
||||
sidebarTitle: "GitLab"
|
||||
description: "Learn how to configure secret scanning for GitLab."
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Create a [GitLab Connection](/integrations/app-connections/gitlab) with Secret Scanning permissions
|
||||
|
||||
## Create a GitLab Data Source in Infisical
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Infisical UI">
|
||||
1. Navigate to your Secret Scanning Project's Dashboard and click the **Add Data Source** button.
|
||||

|
||||
|
||||
2. Select the **GitLab** option.
|
||||

|
||||
|
||||
3. Configure which workspace and repositories you would like to scan. Then click **Next**.
|
||||

|
||||
|
||||
- **GitLab Connection** - the connection that has access to the repositories you want to scan.
|
||||
- **Scope** - the GitLab scope to scan secrets in.
|
||||
- **Project** - scan an individual GitLab project.
|
||||
- **Group** - scan one or more projects belonging to a GitLab group.
|
||||
- **Scan Repositories** - when using **Group Scope**, select which repositories you would like to scan.
|
||||
- **All Repositories** - Infisical will scan all repositories associated with your connection.
|
||||
- **Select Repositories** - Infisical will scan the selected repositories.
|
||||
- **Auto-Scan Enabled** - whether Infisical should automatically perform a scan when a push is made to configured repositories.
|
||||
|
||||
4. Give your data source a name and description (optional). Then click **Next**.
|
||||

|
||||
|
||||
- **Name** - the name of the data source. Must be slug-friendly.
|
||||
- **Description** (optional) - a description of this data source.
|
||||
|
||||
5. Review your data source, then click **Create Data Source**.
|
||||

|
||||
|
||||
6. Your **GitLab Data Source** is now available and will begin a full scan if **Auto-Scan** is enabled.
|
||||

|
||||
|
||||
7. You can view repositories and scan results by clicking on your data source.
|
||||

|
||||
|
||||
8. In addition, you can review any findings from the **Findings Page**.
|
||||

|
||||
</Tab>
|
||||
<Tab title="API">
|
||||
To create a GitLab Data Source, make an API request to the [Create GitLab Data Source](/api-reference/endpoints/secret-scanning/data-sources/gitlab/create) API endpoint.
|
||||
|
||||
### Sample request
|
||||
|
||||
```bash Request
|
||||
curl --request POST \
|
||||
--url https://us.infisical.com/api/v2/secret-scanning/data-sources/gitlab \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"name": "my-gitlab-source",
|
||||
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||
"description": "my gitlab data source",
|
||||
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||
"isAutoScanEnabled": true,
|
||||
"config": {
|
||||
"scope": "project",
|
||||
"projectId": 123456789,
|
||||
"projectName": "my-group/my-project"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
### Sample response
|
||||
|
||||
```bash Response
|
||||
{
|
||||
"dataSource": {
|
||||
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||
"externalId": "1234567890",
|
||||
"name": "my-gitlab-source",
|
||||
"description": "my gitlab data source",
|
||||
"isAutoScanEnabled": true,
|
||||
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||
"createdAt": "2023-11-07T05:31:56Z",
|
||||
"updatedAt": "2023-11-07T05:31:56Z",
|
||||
"type": "gitlab",
|
||||
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
||||
"connection": {
|
||||
"app": "gitlab",
|
||||
"name": "my-gitlab-app",
|
||||
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
|
||||
},
|
||||
"config": {
|
||||
"scope": "project",
|
||||
"projectId": 123456789,
|
||||
"projectName": "my-group/my-project"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
Before Width: | Height: | Size: 531 KiB After Width: | Height: | Size: 531 KiB |
|
Before Width: | Height: | Size: 480 KiB After Width: | Height: | Size: 480 KiB |
|
Before Width: | Height: | Size: 426 KiB After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 464 KiB |
@@ -26,8 +26,22 @@ Infisical supports two methods for connecting to GitLab: **OAuth** and **Access
|
||||
|
||||
Create the application. As part of the form, set the **Redirect URI** to `https://your-domain.com/organization/app-connections/gitlab/oauth/callback`.
|
||||
|
||||

|
||||

|
||||
Depending on your use case, add one or more of the following scopes to your application:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Secret Sync">
|
||||
For Secret Syncs, your application will require the `api` scope:
|
||||
|
||||

|
||||

|
||||
</Tab>
|
||||
<Tab title="Secret Scanning">
|
||||
For Secret Scanning, your application will require the `api` and `read_repository` scopes:
|
||||
|
||||

|
||||

|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Tip>
|
||||
The domain you defined in the Redirect URI should be equivalent to the `SITE_URL` configured in your Infisical instance.
|
||||
@@ -96,16 +110,22 @@ Infisical supports two methods for connecting to GitLab: **OAuth** and **Access
|
||||

|
||||
</Step>
|
||||
<Step title="Configure Token">
|
||||
<Tabs>
|
||||
<Tab title="Secret Sync">
|
||||
For Secret Syncs, your token will require the ability to access the API:
|
||||
Fill in the token details:
|
||||
- **Token name**: A descriptive name for the token (e.g., "connection-token")
|
||||
- **Expiration date**: Set an appropriate expiration date
|
||||
- **Select scopes**: Choose the **api** scope for full API access
|
||||
- **Select scopes**: Depending on your use case, add one or more of the following scopes:
|
||||
|
||||

|
||||
<Tabs>
|
||||
<Tab title="Secret Sync">
|
||||
For Secret Syncs, your token will require the `api` scope:
|
||||
|
||||

|
||||
</Tab>
|
||||
<Tab title="Secret Scanning">
|
||||
For Secret Scanning, your token will require the `api` and `read_repository` scopes:
|
||||
|
||||

|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Info>
|
||||
@@ -134,17 +154,22 @@ Infisical supports two methods for connecting to GitLab: **OAuth** and **Access
|
||||

|
||||
</Step>
|
||||
<Step title="Configure Token">
|
||||
<Tabs>
|
||||
<Tab title="Secret Sync">
|
||||
For Secret Syncs, your token will require the ability to access the API and be at least an **Owner**:
|
||||
Fill in the token details:
|
||||
- **Token name**: A descriptive name for the token
|
||||
- **Expiration date**: Set an appropriate expiration date
|
||||
- **Select role**: Choose **Owner** or higher role
|
||||
- **Select scopes**: Choose the **api** scope for API access
|
||||
Fill in the token details:
|
||||
- **Token name**: A descriptive name for the token
|
||||
- **Expiration date**: Set an appropriate expiration date
|
||||
- **Select role and scopes**: Depending on your use case, add the required role and one or more of the following scopes:
|
||||
|
||||

|
||||
</Tab>
|
||||
<Tabs>
|
||||
<Tab title="Secret Sync">
|
||||
For Secret Syncs, your token will require the `api` scope and at least the **Owner** role:
|
||||
|
||||

|
||||
</Tab>
|
||||
<Tab title="Secret Scanning">
|
||||
For Secret Scanning, your token will require the `api` and `read_repository` scopes and the **Maintainer** role:
|
||||
|
||||

|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Info>
|
||||
|
||||