mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
97 lines
4.2 KiB
Plaintext
97 lines
4.2 KiB
Plaintext
---
|
|
title: "GitHub Secret Scanning"
|
|
sidebarTitle: "GitHub"
|
|
description: "Learn how to configure secret scanning for GitHub."
|
|
---
|
|
|
|
## Prerequisites
|
|
|
|
- Create a [GitHub Radar Connection](/integrations/app-connections/github-radar)
|
|
|
|
## Create a GitHub 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 **GitHub** option.
|
|

|
|
|
|
3. Select the **GitHub Radar Connection** to use and configure which repositories you would like to scan. Then click **Next**.
|
|

|
|
|
|
- **GitHub Radar Connection** - the connection that has access to the repositories you want to scan.
|
|
- **Scan Repositories** - 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 **GitHub 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 GitHub Data Source, make an API request to the [Create GitHub Data Source](/api-reference/endpoints/secret-scanning/data-sources/github/create) API endpoint.
|
|
|
|
### Sample request
|
|
|
|
```bash Request
|
|
curl --request POST \
|
|
--url https://us.infisical.com/api/v2/secret-scanning/data-sources/github \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{
|
|
"name": "my-github-source",
|
|
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
|
"description": "my github data source",
|
|
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
|
"isAutoScanEnabled": true,
|
|
"config": {
|
|
"includeRepos": ["*"]
|
|
}
|
|
}'
|
|
```
|
|
|
|
### Sample response
|
|
|
|
```bash Response
|
|
{
|
|
"dataSource": {
|
|
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
|
"externalId": "1234567890",
|
|
"name": "my-github-source",
|
|
"description": "my github data source",
|
|
"isAutoScanEnabled": true,
|
|
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
|
"createdAt": "2023-11-07T05:31:56Z",
|
|
"updatedAt": "2023-11-07T05:31:56Z",
|
|
"type": "github",
|
|
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
|
|
"connection": {
|
|
"app": "github-radar",
|
|
"name": "my-radar-app",
|
|
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
|
|
},
|
|
"config": {
|
|
"includeRepos": ["*"]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
</Tabs>
|