Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

docs(secret-scanning): overhaul section (#8650)

Adrian Kahali78799aa34839
diff --git a/docs/docs.json b/docs/docs.json
index 9e74f05d63..5e9034ea94 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -388,29 +388,35 @@
]
},
{
- "item": "Secrets Scanning",
+ "item": "Secret Scanning",
"icon": "radar",
"pages": [
"documentation/platform/secret-scanning/overview",
+ "documentation/platform/secret-scanning/concepts/secret-scanning",
{
- "group": "Secrets scanning",
+ "group": "Scanning locally",
"pages": [
"documentation/platform/secret-scanning/scan-locally",
- {
- "group": "Concepts",
- "pages": [
- "documentation/platform/secret-scanning/concepts/secret-scanning"
- ]
- }
+ "documentation/platform/secret-scanning/pre-commit-hook",
+ "documentation/platform/secret-scanning/ignore-findings",
+ "documentation/platform/secret-scanning/local-configuration"
]
},
{
- "group": "Product reference",
+ "group": "Scanning repositories",
"pages": [
- "documentation/platform/secret-scanning/usage",
- "documentation/platform/secret-scanning/bitbucket",
- "documentation/platform/secret-scanning/github",
- "documentation/platform/secret-scanning/gitlab"
+ "documentation/platform/secret-scanning/scan-repositories",
+ {
+ "group": "Data sources",
+ "expanded": true,
+ "pages": [
+ "documentation/platform/secret-scanning/github",
+ "documentation/platform/secret-scanning/gitlab",
+ "documentation/platform/secret-scanning/bitbucket"
+ ]
+ },
+ "documentation/platform/secret-scanning/findings",
+ "documentation/platform/secret-scanning/configuration"
]
}
]
@@ -4865,6 +4871,10 @@
}
},
"redirects": [
+ {
+ "source": "/documentation/platform/secret-scanning/usage",
+ "destination": "/documentation/platform/secret-scanning/scan-repositories"
+ },
{
"source": "/cli/scanning-overview",
"destination": "/documentation/platform/secret-scanning/scan-locally"
diff --git a/docs/documentation/getting-started/choose-a-product/secret-scanning.mdx b/docs/documentation/getting-started/choose-a-product/secret-scanning.mdx
index 0aae49573b..7e76eb2627 100644
--- a/docs/documentation/getting-started/choose-a-product/secret-scanning.mdx
+++ b/docs/documentation/getting-started/choose-a-product/secret-scanning.mdx
@@ -19,7 +19,7 @@ Infisical Secrets Scanning detects credentials that have been placed in location
<Card title="Scan locally with the CLI" icon="terminal" href="/cli/reference#scan">
Scan a working directory, Git history, or staged changes before they're pushed to a shared branch.
</Card>
- <Card title="Manage findings across scans" icon="list-checks" href="/documentation/platform/secret-scanning/overview">
+ <Card title="Manage findings across scans" icon="list-checks" href="/documentation/platform/secret-scanning/findings">
Review detected credentials with file, line, commit, and rule; resolve, ignore, or mark them as false positives.
</Card>
</CardGroup>
diff --git a/docs/documentation/platform/secret-scanning/bitbucket.mdx b/docs/documentation/platform/secret-scanning/bitbucket.mdx
index 19bd16edb2..369d8031d6 100644
--- a/docs/documentation/platform/secret-scanning/bitbucket.mdx
+++ b/docs/documentation/platform/secret-scanning/bitbucket.mdx
@@ -1,57 +1,60 @@
---
title: "Bitbucket secret scanning"
sidebarTitle: "Bitbucket"
-description: "Learn how to configure secret scanning for Bitbucket."
+icon: "/images/platform/secret-scanning/icons/bitbucket.svg"
+description: "Scan the repositories in a Bitbucket workspace."
---
+To scan your Bitbucket repositories for leaked secrets, create a Bitbucket [data source](/documentation/platform/secret-scanning/scan-repositories) in Infisical.
+
## Prerequisites
-- Create a [Bitbucket Connection](/integrations/app-connections/bitbucket) with Secret Scanning permissions
+- A [Bitbucket Connection](/integrations/app-connections/bitbucket) with secret scanning permissions
## Create a Bitbucket data source in Infisical
<Steps>
<Step>
- Navigate to your Secret Scanning Project's Dashboard and select the **Add Data Source** button.
+ Go to **Secret Scanning** > **Data Sources** and select **Add Data Source**.
![Secret Scanning Dashboard](/images/platform/secret-scanning/github/github-data-source-step-1.png)
</Step>
<Step>
- Select the **Bitbucket** option.
+ Select **Bitbucket**.
![Select Bitbucket](/images/platform/secret-scanning/bitbucket/step-2.png)
</Step>
<Step>
- Configure which workspace and repositories you would like to scan. Then select **Next**.
+ Select the connection to use, the workspace, and the repositories to scan, then select **Next**.
![Data Source Configuration](/images/platform/secret-scanning/bitbucket/step-3.png)
- - **Bitbucket Connection** - the connection that has access to the repositories you want to scan.
- - **Workspace** - the Bitbucket workspace to scan secrets in.
- - **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.
+ - **Bitbucket Connection**: The connection that can access the repositories you want to scan
+ - **Workspace**: The Bitbucket workspace that contains the repositories
+ - **Scan Repositories**: Which of the workspace's repositories Infisical scans
+ - **All Repositories**: Every repository in the workspace that the connection can access
+ - **Select Repositories**: Only the repositories you select in **Include Repositories**
+ - **Auto-Scan Enabled**: Whether Infisical scans each new push to the repositories
</Step>
<Step>
- Give your data source a name and description (optional). Then select **Next**.
+ Enter a name and, optionally, a description for the data source, then select **Next**.
![Data Source Details](/images/platform/secret-scanning/bitbucket/step-4.png)
- - **Name** - the name of the data source. Must be slug-friendly.
- - **Description** (optional) - a description of this data source.
+ - **Name**: A name that contains only lowercase letters, numbers, and hyphens
+ - **Description** (optional): A description of the data source
</Step>
<Step>
- Review your data source, then select **Create Data Source**.
+ Review the data source, then select **Create Data Source**.
![Data Source Review](/images/platform/secret-scanning/bitbucket/step-5.png)
</Step>
<Step>
- Your **Bitbucket Data Source** is now available and will begin a historical scan if **Auto-Scan** is enabled.
+ The data source appears in **Data Sources**. If auto-scan is enabled, Infisical starts a [historical scan](/documentation/platform/secret-scanning/scan-repositories#scans) of every repository.
![Data Source Created](/images/platform/secret-scanning/bitbucket/step-6.png)
</Step>
<Step>
- You can view repositories and scan results by selecting your data source.
+ To see the data source's repositories and scan history, select the data source.
![Data Source Page](/images/platform/secret-scanning/bitbucket/step-7.png)
</Step>
<Step>
- In addition, you can review any findings from the **Findings Page**.
+ To review the secrets the scans found, go to **Findings**. To learn what each finding contains and how to change its status, see [Findings](/documentation/platform/secret-scanning/findings).
![Findings Page](/images/platform/secret-scanning/bitbucket/step-8.png)
</Step>
</Steps>
diff --git a/docs/documentation/platform/secret-scanning/concepts/secret-scanning.mdx b/docs/documentation/platform/secret-scanning/concepts/secret-scanning.mdx
index 7b80d9f010..6adb498643 100644
--- a/docs/documentation/platform/secret-scanning/concepts/secret-scanning.mdx
+++ b/docs/documentation/platform/secret-scanning/concepts/secret-scanning.mdx
@@ -1,20 +1,26 @@
---
-title: "Secrets scanning"
+title: "Secret scanning"
+sidebarTitle: "Concepts"
description: "Learn what is secret scanning and why it matters for building secure systems."
---
## What is secret scanning?
-_Secret scanning_ is the process of monitoring code and related systems for exposed secrets — such as API keys, database credentials, and authentication tokens — that may have been accidentally committed or leaked.
+_Secret scanning_ is the process of checking code for secrets that were committed to version control by accident. This can include API keys, database credentials, and authentication tokens.
-As teams grow and development accelerates, it becomes easy for secrets to slip into version control, CI/CD pipelines, or shared files. Left undetected, secrets can fall into the wrong hands and give attackers direct access to production systems, third-party services, or internal APIs.
+As teams grow, it gets easy for a secret to end up in version control, a CI/CD pipeline, or a shared file. Anyone who can read that code can then use the secret to reach production systems, third-party services, or internal APIs. A secret scanner checks every change automatically, so a leaked secret is found and revoked before someone else finds it.
-A secret scanning solution helps teams proactively identify and respond to these risks before they result in compromise. Rather than relying on manual review, secret scanning automates detection through pattern matching, entropy analysis, and contextual rules that surface secrets across your infrastructure and repositories.
+## How a scanner finds secrets
-## Secret scanning in Infisical
+A scanner reads each line of code and compares it against a set of rules. Each rule describes one kind of secret, such as an AWS access key, with a pattern that the secret matches and keywords that a line must contain before the scanner checks the pattern. A rule can also require a minimum entropy, which measures how random a value is, so that a value like `password123` isn't reported as a generated key.
-Infisical Secret Scanning continuously monitors your source code and connected systems for exposed credentials. It integrates with platforms like [GitHub](/documentation/platform/secret-scanning/github), [GitLab](/documentation/platform/secret-scanning/gitlab), and [Bitbucket](/documentation/platform/secret-scanning/bitbucket) to scan codebases in real-time, detecting leaks as they happen and notifying administrators when action is needed.
+Infisical's scanner includes rules for hundreds of services. You can add your own rules, and skip values you've decided are safe, in a [configuration](/documentation/platform/secret-scanning/configuration).
-Findings are surfaced with detailed context — including file location, commit metadata, and rule match — and can be tracked through their lifecycle using status labels like `Resolved`, `False Positive`, or `Ignored`. Teams can configure rules, exclusions, and thresholds to reduce noise and tailor detection to their environment.
+## Where Infisical scans
-Infisical runs historical scans over a repository's full commit history and realtime scans over each new push, and supports local pre-commit scanning via the [Infisical CLI](/cli/reference#scan). This allows teams to prevent secret leaks before they ever reach production.
+Infisical can scan your code in two places, with the same built-in rules:
+
+- **Before you push**: The [Infisical CLI](/documentation/platform/secret-scanning/scan-locally) scans your repository, a directory, or your uncommitted changes on your machine or in a CI job, and can block a commit that contains a secret
+- **After you push**: Infisical scans the repositories in your GitHub, GitLab, and Bitbucket [data sources](/documentation/platform/secret-scanning/scan-repositories) and records each secret it finds as a [finding](/documentation/platform/secret-scanning/findings) that you can track until it's handled
+
+Scanning before you push stops a leak before it reaches a shared repository. Scanning after you push catches the secrets that get past it, such as a commit from someone who doesn't run the CLI.
diff --git a/docs/documentation/platform/secret-scanning/configuration.mdx b/docs/documentation/platform/secret-scanning/configuration.mdx
new file mode 100644
index 0000000000..2f9733b9ac
--- /dev/null
+++ b/docs/documentation/platform/secret-scanning/configuration.mdx
@@ -0,0 +1,86 @@
+---
+title: "Configure repository scans"
+sidebarTitle: "Configuration"
+description: "Add your own detection rules and skip secrets you've decided are safe."
+---
+
+import ExtendFields from "/snippets/documentation/platform/secret-scanning/extend-fields.mdx";
+import RuleFields from "/snippets/documentation/platform/secret-scanning/rule-fields.mdx";
+import IgnoreOneLine from "/snippets/documentation/platform/secret-scanning/ignore-one-line.mdx";
+import AllowlistFields from "/snippets/documentation/platform/secret-scanning/allowlist-fields.mdx";
+
+The scanning configuration sets the rules Infisical uses when it scans your [data sources](/documentation/platform/secret-scanning/scan-repositories). Without a configuration, Infisical uses the scanner's built-in rules, which cover the credential formats of hundreds of services. The configuration uses the same format as the configuration file for [local scans](/documentation/platform/secret-scanning/local-configuration).
+
+<Note>
+For repository scans, Infisical doesn't use the files that [local scans](/documentation/platform/secret-scanning/scan-locally) read, such as `.infisical-scan.toml`, `.infisicalignore`, or a [baseline report](/documentation/platform/secret-scanning/ignore-findings#ignore-existing-findings), even if they're in your repository.
+
+Enter your rules and allowlists in the [scanning configuration](#edit-the-scanning-configuration) instead.
+</Note>
+
+## Edit the scanning configuration
+
+<Steps>
+ <Step>
+ Go to **Secret Scanning** > **Settings** > **Scanning Settings**.
+ </Step>
+ <Step>
+ Enter your configuration in the text box, up to 5,000 characters.
+ </Step>
+ <Step>
+ Select **Save**.
+ </Step>
+</Steps>
+
+Infisical uses the new configuration from the next scan onward. To apply it to commits that were already scanned, [trigger a historical scan](/documentation/platform/secret-scanning/scan-repositories#run-a-historical-scan).
+
+![config](/images/platform/secret-scanning/secret-scanning-config.png)
+
+## Configuration format
+
+A configuration replaces the scanner's built-in rules unless it extends them.
+
+### Keep the built-in rules
+
+To keep the built-in rules and add yours to them, set `useDefault = true` in the `[extend]` table:
+
+```toml
+[extend]
+useDefault = true
+disabledRules = ["generic-api-key"]
+```
+
+<ExtendFields />
+
+Infisical can only read the configuration you enter, so don't use `path` in the `[extend]` table to extend another configuration file.
+
+### Add a rule
+
+Add a `[[rules]]` table for each kind of secret you want to detect:
+
+```toml
+[[rules]]
+id = "internal-api-token"
+description = "Internal API token"
+regex = '''itk_[a-z0-9]{32}'''
+keywords = ["itk_"]
+```
+
+<RuleFields />
+
+These are the fields most rules need. The scanner also accepts advanced fields, such as the ones that detect secrets made of several parts.
+
+<IgnoreOneLine />
+
+## Allowlists
+
+To ignore secrets in specific files or commits, or secrets that match a pattern, add an `[[allowlists]]` table to the configuration:
+
+```toml
+[[allowlists]]
+description = "Test fixtures and a rotated key"
+paths = ['''(^|/)testdata/''']
+commits = ["bea0ff6e05a4de73a5db625d4ae181a015b50855"]
+stopwords = ["example"]
+```
+
+<AllowlistFields />
diff --git a/docs/documentation/platform/secret-scanning/findings.mdx b/docs/documentation/platform/secret-scanning/findings.mdx
new file mode 100644
index 0000000000..c9cc7a04fd
--- /dev/null
+++ b/docs/documentation/platform/secret-scanning/findings.mdx
@@ -0,0 +1,61 @@
+---
+title: "Findings"
+description: "Review the secrets Infisical finds in your repositories."
+---
+
+A finding is a secret that a scan found in one of your [data sources](/documentation/platform/secret-scanning/scan-repositories). To see the findings from every data source, go to **Secret Scanning** > **Findings**.
+
+![findings](/images/platform/secret-scanning/secret-scanning-findings.png)
+
+## What a finding contains
+
+To see the details of a finding, select its row:
+
+- **Description**: What the matching rule detects, such as a type of API key
+- **File**: The path of the file that contains the secret
+- **Commit**, **Author**, **Email**, and **Commit Message**: The commit that added the secret, and who made it
+- **Start Line**, **End Line**, **Start Column**, and **End Column**: Where the secret is in the file
+- **Link**: A link to the file at that commit, on GitHub, GitLab, or Bitbucket
+
+If a later scan finds the same secret in the same place, Infisical keeps the existing finding and its status instead of adding a new one.
+
+## Finding statuses
+
+Every new finding starts as **Unresolved**. After you review a finding, change its status to one of the following:
+
+- **Resolved**: You've dealt with the leak, for example by revoking the secret
+- **False Positive**: The value isn't a secret
+- **Ignore**: The value is a secret, but you've decided it's safe to leave, such as a test credential
+
+The status is only a record of your review, and doesn't change how Infisical scans. To stop a value from being reported in the first place, ignore it in the [scanning configuration](/documentation/platform/secret-scanning/configuration#ignore-one-line).
+
+## Change a finding's status
+
+<Steps>
+ <Step>
+ Go to **Secret Scanning** > **Findings**.
+ </Step>
+ <Step>
+ Select the finding's row, then select **Update Status**.
+
+ To change several findings at once, select the checkbox on each finding's row, then select **Update Status** below the table.
+ </Step>
+ <Step>
+ Select a **Status**. Optionally, enter a **Comment** that explains your decision.
+ </Step>
+ <Step>
+ Select **Update Status**.
+ </Step>
+</Steps>
+
+Your comment appears as **Remarks** in the finding's details, and when you hover over the finding's status.
+
+## Notifications about new findings
+
+When a scan finds secrets, Infisical sends an email and an in-app notification to every member with the **Admin** role in Secret Scanning. The notification links to the findings from that scan. If a scan fails, the same members get a notification with the error instead.
+
+If a scan of a new push finds secrets, Infisical also notifies the author of the commit if they're a member. If the push has commits from more than one author, Infisical notifies only one of them.
+
+<Note>
+ If you self-host Infisical, scan notifications need an [email service](/self-hosting/configuration/envars#email-service) configured. Without one, Infisical doesn't send the email or the in-app notification.
+</Note>
diff --git a/docs/documentation/platform/secret-scanning/github.mdx b/docs/documentation/platform/secret-scanning/github.mdx
index 795f9703b5..4d1107f6b0 100644
--- a/docs/documentation/platform/secret-scanning/github.mdx
+++ b/docs/documentation/platform/secret-scanning/github.mdx
@@ -1,55 +1,58 @@
---
title: "GitHub secret scanning"
sidebarTitle: "GitHub"
-description: "Learn how to configure secret scanning for GitHub."
+icon: "/images/platform/secret-scanning/icons/github.svg"
+description: "Scan the repositories a GitHub Radar connection can access."
---
+To scan your GitHub repositories for leaked secrets, create a GitHub [data source](/documentation/platform/secret-scanning/scan-repositories) in Infisical.
+
## Prerequisites
-- Create a [GitHub Radar Connection](/integrations/app-connections/github-radar)
+- A [GitHub Radar Connection](/integrations/app-connections/github-radar)
## Create a GitHub data source in Infisical
<Steps>
<Step>
- Navigate to your Secret Scanning Project's Dashboard and select the **Add Data Source** button.
+ Go to **Secret Scanning** > **Data Sources** and select **Add Data Source**.
![Secret Scanning Dashboard](/images/platform/secret-scanning/github/github-data-source-step-1.png)
</Step>
<Step>
- Select the **GitHub** option.
+ Select **GitHub**.
![Select GitHub Option](/images/platform/secret-scanning/github/github-data-source-step-2.png)
</Step>
<Step>
- Select the **GitHub Radar Connection** to use and configure which repositories you would like to scan. Then select **Next**.
+ Select the connection to use and the repositories to scan, then select **Next**.
![Data Source Configuration](/images/platform/secret-scanning/github/github-data-source-step-3.png)
- - **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.
+ - **GitHub Radar Connection**: The connection that can access the repositories you want to scan
+ - **Scan Repositories**: Which repositories Infisical scans
+ - **All Repositories**: Every repository the connection can access
+ - **Select Repositories**: Only the repositories you select in **Include Repositories**
+ - **Auto-Scan Enabled**: Whether Infisical scans each new push to the repositories
</Step>
<Step>
- Give your data source a name and description (optional). Then select **Next**.
+ Enter a name and, optionally, a description for the data source, then select **Next**.
![Data Source Details](/images/platform/secret-scanning/github/github-data-source-step-4.png)
- - **Name** - the name of the data source. Must be slug-friendly.
- - **Description** (optional) - a description of this data source.
+ - **Name**: A name that contains only lowercase letters, numbers, and hyphens
+ - **Description** (optional): A description of the data source
</Step>
<Step>
- Review your data source, then select **Create Data Source**.
+ Review the data source, then select **Create Data Source**.
![Data Source Review](/images/platform/secret-scanning/github/github-data-source-step-5.png)
</Step>
<Step>
- Your **GitHub Data Source** is now available and will begin a historical scan if **Auto-Scan** is enabled.
+ The data source appears in **Data Sources**. If auto-scan is enabled, Infisical starts a [historical scan](/documentation/platform/secret-scanning/scan-repositories#scans) of every repository.
![Data Source Created](/images/platform/secret-scanning/github/github-data-source-step-6.png)
</Step>
<Step>
- You can view repositories and scan results by selecting your data source.
+ To see the data source's repositories and scan history, select the data source.
![Data Source Page](/images/platform/secret-scanning/github/github-data-source-step-7.png)
</Step>
<Step>
- In addition, you can review any findings from the **Findings Page**.
+ To review the secrets the scans found, go to **Findings**. To learn what each finding contains and how to change its status, see [Findings](/documentation/platform/secret-scanning/findings).
![Findings Page](/images/platform/secret-scanning/github/github-data-source-step-8.png)
</Step>
</Steps>
diff --git a/docs/documentation/platform/secret-scanning/gitlab.mdx b/docs/documentation/platform/secret-scanning/gitlab.mdx
index 6c67c07aa3..0749be19ce 100644
--- a/docs/documentation/platform/secret-scanning/gitlab.mdx
+++ b/docs/documentation/platform/secret-scanning/gitlab.mdx
@@ -1,58 +1,61 @@
---
title: "GitLab secret scanning"
sidebarTitle: "GitLab"
-description: "Learn how to configure secret scanning for GitLab."
+icon: "/images/platform/secret-scanning/icons/gitlab.svg"
+description: "Scan one GitLab project, or the projects in a group."
---
+To scan your GitLab projects for leaked secrets, create a GitLab [data source](/documentation/platform/secret-scanning/scan-repositories) in Infisical.
+
## Prerequisites
-- Create a [GitLab Connection](/integrations/app-connections/gitlab) with Secret Scanning permissions
+- A [GitLab Connection](/integrations/app-connections/gitlab) with secret scanning permissions
## Create a GitLab data source in Infisical
<Steps>
<Step>
- Navigate to your Secret Scanning Project's Dashboard and select the **Add Data Source** button.
+ Go to **Secret Scanning** > **Data Sources** and select **Add Data Source**.
![Secret Scanning Dashboard](/images/platform/secret-scanning/github/github-data-source-step-1.png)
</Step>
<Step>
- Select the **GitLab** option.
+ Select **GitLab**.
![Select GitLab](/images/platform/secret-scanning/gitlab/step-2.png)
</Step>
<Step>
- Configure which workspace and repositories you would like to scan. Then select **Next**.
+ Select the connection to use and the GitLab project or group to scan, then select **Next**.
![Data Source Configuration](/images/platform/secret-scanning/gitlab/step-3.png)
- - **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.
+ - **GitLab Connection**: The connection that can access the projects you want to scan
+ - **Scope**: Whether Infisical scans one GitLab project or the projects in a GitLab group
+ - **Project**: Scan the project you select in **Project**
+ - **Group**: Scan projects in the group you select in **Group**
+ - **Scan Projects**: If **Scope** is **Group**, which of the group's projects Infisical scans
+ - **All Projects**: Every project in the group
+ - **Select Projects**: Only the projects you select in **Include Projects**
+ - **Auto-Scan Enabled**: Whether Infisical scans each new push to the projects
</Step>
<Step>
- Give your data source a name and description (optional). Then select **Next**.
+ Enter a name and, optionally, a description for the data source, then select **Next**.
![Data Source Details](/images/platform/secret-scanning/gitlab/step-4.png)
- - **Name** - the name of the data source. Must be slug-friendly.
- - **Description** (optional) - a description of this data source.
+ - **Name**: A name that contains only lowercase letters, numbers, and hyphens
+ - **Description** (optional): A description of the data source
</Step>
<Step>
- Review your data source, then select **Create Data Source**.
+ Review the data source, then select **Create Data Source**.
![Data Source Review](/images/platform/secret-scanning/gitlab/step-5.png)
</Step>
<Step>
- Your **GitLab Data Source** is now available and will begin a historical scan if **Auto-Scan** is enabled.
+ The data source appears in **Data Sources**. If auto-scan is enabled, Infisical starts a [historical scan](/documentation/platform/secret-scanning/scan-repositories#scans) of every project.
![Data Source Created](/images/platform/secret-scanning/gitlab/step-6.png)
</Step>
<Step>
- You can view repositories and scan results by selecting your data source.
+ To see the data source's projects and scan history, select the data source.
![Data Source Page](/images/platform/secret-scanning/gitlab/step-7.png)
</Step>
<Step>
- In addition, you can review any findings from the **Findings Page**.
+ To review the secrets the scans found, go to **Findings**. To learn what each finding contains and how to change its status, see [Findings](/documentation/platform/secret-scanning/findings).
![Findings Page](/images/platform/secret-scanning/gitlab/step-8.png)
</Step>
</Steps>
diff --git a/docs/documentation/platform/secret-scanning/ignore-findings.mdx b/docs/documentation/platform/secret-scanning/ignore-findings.mdx
new file mode 100644
index 0000000000..a676ef2d50
--- /dev/null
+++ b/docs/documentation/platform/secret-scanning/ignore-findings.mdx
@@ -0,0 +1,49 @@
+---
+title: "Ignore findings in local scans"
+sidebarTitle: "Ignore findings"
+description: "Stop infisical scan from reporting secrets you've decided are safe to commit."
+---
+
+import IgnoreOneLine from "/snippets/documentation/platform/secret-scanning/ignore-one-line.mdx";
+
+If a scan reports a value you've decided is safe to commit, such as a test credential, you can stop the scan from reporting it.
+
+## Configuration file
+
+In your configuration file, you can add allowlists that skip secrets by file path, commit, regular expression, or word. You can also turn off built-in rules that report values you don't consider secrets.
+
+<Card title="Configuration" icon="settings" href="/documentation/platform/secret-scanning/local-configuration">
+ Add allowlists and turn off built-in rules in `.infisical-scan.toml`.
+</Card>
+
+<IgnoreOneLine />
+
+## Ignore specific findings
+
+Each finding has a fingerprint, which is in the `Fingerprint` field of a JSON report. To ignore findings, list their fingerprints in a `.infisicalignore` file, one per line. Put the file in the directory you scan, which is the `--source` directory or, by default, the current directory:
+
+```text .infisicalignore
+bea0ff6e05a4de73a5db625d4ae181a015b50855:frontend/components/utilities/attemptLogin.js:stripe-access-token:147
+backend/src/json/integrations.json:generic-api-key:5
+```
+
+A fingerprint takes one of two forms:
+
+- `<commit>:<file>:<rule>:<line>`: Ignores the finding in that commit only (what a scan of Git history reports)
+- `<file>:<rule>:<line>`: Ignores the finding in every commit (what a scan with `--no-git` reports)
+
+## Ignore existing findings
+
+If you start scanning a repository that already has a long history, you can record every current finding in a baseline and have later scans report only new ones. First, write a JSON report of the current findings:
+
+```bash
+infisical scan --report-path baseline.json
+```
+
+Then pass that report to later scans with `--baseline-path`:
+
+```bash
+infisical scan --baseline-path baseline.json --report-path findings.json
+```
+
+`findings.json` then contains only the findings that aren't in `baseline.json`. If you scan uncommitted changes with `infisical scan git-changes`, the scan doesn't use a baseline.
diff --git a/docs/documentation/platform/secret-scanning/local-configuration.mdx b/docs/documentation/platform/secret-scanning/local-configuration.mdx
new file mode 100644
index 0000000000..d87ee3f3cd
--- /dev/null
+++ b/docs/documentation/platform/secret-scanning/local-configuration.mdx
@@ -0,0 +1,79 @@
+---
+title: "Configure local scans"
+sidebarTitle: "Configuration"
+description: "Add your own detection rules to infisical scan and skip secrets you've decided are safe."
+---
+
+import ExtendFields from "/snippets/documentation/platform/secret-scanning/extend-fields.mdx";
+import RuleFields from "/snippets/documentation/platform/secret-scanning/rule-fields.mdx";
+import AllowlistFields from "/snippets/documentation/platform/secret-scanning/allowlist-fields.mdx";
+
+By default, `infisical scan` uses the scanner's built-in rules, which cover the credential formats of hundreds of services. To add your own rules or skip paths, use a configuration file. The file uses the same format as the [configuration for repository scans](/documentation/platform/secret-scanning/configuration).
+
+## Use a configuration file
+
+Create a file named `.infisical-scan.toml` in the directory you scan. To use a file with a different name or location, pass it with `--config` or set `INFISICAL_SCAN_CONFIG`.
+
+<Info>
+If more than one of these is set, the CLI uses the first one in this order:
+
+1. The `--config` flag
+2. The `INFISICAL_SCAN_CONFIG` environment variable
+3. `.infisical-scan.toml` in the directory you scan
+</Info>
+
+## Configuration format
+
+A configuration replaces the scanner's built-in rules unless it extends them.
+
+### Keep the built-in rules
+
+To keep the built-in rules and add yours to them, set `useDefault = true` in the `[extend]` table:
+
+```toml .infisical-scan.toml
+[extend]
+useDefault = true
+disabledRules = ["generic-api-key"]
+```
+
+<ExtendFields />
+
+<ResponseField name="path" type="string">
+Another configuration file to extend instead of the built-in rules, relative to the directory you run the CLI in. You can't set both `path` and `useDefault`.
+</ResponseField>
+
+### Add a rule
+
+Add a `[[rules]]` table for each kind of secret you want to detect:
+
+```toml .infisical-scan.toml
+[[rules]]
+id = "internal-api-token"
+description = "Internal API token"
+regex = '''itk_[a-z0-9]{32}'''
+keywords = ["itk_"]
+```
+
+<RuleFields />
+
+<ResponseField name="tags" type="string[]">
+Labels that appear on each finding the rule reports, in the `Tags` field of a report.
+</ResponseField>
+
+These are the fields most rules need. The scanner also accepts advanced fields, such as the ones that detect secrets made of several parts.
+
+## Allowlists
+
+To ignore secrets in specific files or commits, or secrets that match a pattern, add an `[[allowlists]]` table to the configuration file:
+
+```toml .infisical-scan.toml
+[[allowlists]]
+description = "Test fixtures and a rotated key"
+paths = ['''(^|/)testdata/''']
+commits = ["bea0ff6e05a4de73a5db625d4ae181a015b50855"]
+stopwords = ["example"]
+```
+
+<AllowlistFields />
+
+To ignore specific findings, or every finding that already exists in a repository, see [Ignore findings](/documentation/platform/secret-scanning/ignore-findings).
diff --git a/docs/documentation/platform/secret-scanning/overview.mdx b/docs/documentation/platform/secret-scanning/overview.mdx
index 6b82b86191..b2a15e3cb4 100644
--- a/docs/documentation/platform/secret-scanning/overview.mdx
+++ b/docs/documentation/platform/secret-scanning/overview.mdx
@@ -1,18 +1,58 @@
---
title: "Secret scanning"
-description: "Learn how to detect and respond to exposed secrets in code."
-sidebarTitle: "Secrets Scanning"
+description: "Find secrets that were committed to your code, either on your own machine or in your GitHub, GitLab, and Bitbucket repositories."
+sidebarTitle: "Secret Scanning"
icon: "radar"
---
-Infisical Secret Scanning helps teams detect leaked credentials — such as API keys, database passwords, and tokens — across source code and developer systems. It allows organizations to proactively catch exposed secrets before they can be exploited, and respond quickly when incidents occur.
+Infisical Secret Scanning helps you find credentials, such as API keys, database passwords, and tokens, that were committed to source code.
-Secret Scanning works across both cloud-connected repositories and local developer environments. It integrates with data sources like [GitHub](/documentation/platform/secret-scanning/github), [GitLab](/documentation/platform/secret-scanning/gitlab), and [Bitbucket](/documentation/platform/secret-scanning/bitbucket) to monitor repositories for exposed secrets in real time, and provides a CLI ([`infisical scan`](/cli/reference#scan)) for scanning local directories, Git history, or CI pipelines before changes are pushed.
+You can scan code on your own machine (or in CI) using the Infisical CLI, or connect your GitHub, GitLab, and Bitbucket repositories so that Infisical scans them and records each secret it finds.
-Core capabilities include:
+<Tip>
+To learn how Infisical scans your secrets, check out the [Concepts](/documentation/platform/secret-scanning/concepts/secret-scanning) page.
+</Tip>
-- Integrated Scanning Across Environments: Monitor secrets in real time across connected repositories like GitHub, GitLab, and Bitbucket, or scan locally using the infisical scan CLI.
-- Detection Engine: Identify potential secrets using pattern matching, entropy analysis, and custom rules tailored to your codebase and workflows.
-- Flexible Scan Modes: Run historical scans manually or configure automatic realtime scans triggered by new commits. CLI scans support Git history, file directories, or staged changes in CI pipelines.
-- Findings and Lifecycle Management: Track detected secrets with context like file path, commit hash, and scanning rule. Findings can be resolved, ignored, or marked as false positives — with full visibility into scan results over time.
-- Custom Configuration and Noise Reduction: Fine-tune scanning behavior with custom patterns, ignore rules (betterleaks:allow, .infisicalignore), entropy thresholds, and excluded paths to reduce false positives.
+## Scanning locally
+
+Scan your code with the Infisical CLI before you push it:
+
+<CardGroup cols={2}>
+ <Card title="Scan with the CLI" icon="terminal" href="/documentation/platform/secret-scanning/scan-locally">
+ Scan a Git repository's history or a directory for leaked secrets with `infisical scan`.
+ </Card>
+ <Card title="Pre-commit hook" icon="git-commit-horizontal" href="/documentation/platform/secret-scanning/pre-commit-hook">
+ Prevent secrets from getting committed with a pre-commit hook that runs `infisical scan`.
+ </Card>
+ <Card title="Ignore findings" icon="eye-off" href="/documentation/platform/secret-scanning/ignore-findings">
+ Stop `infisical scan` from reporting secrets you've decided are safe to commit.
+ </Card>
+ <Card title="Configuration" icon="settings" href="/documentation/platform/secret-scanning/local-configuration">
+ Add your own detection rules to `infisical scan` and skip secrets you've decided are safe.
+ </Card>
+</CardGroup>
+
+## Scanning repositories
+
+Connect your repositories to Infisical, review the secrets it finds, and configure the rules it scans with:
+
+<CardGroup cols={3}>
+ <Card title="GitHub" icon="/images/platform/secret-scanning/icons/github.svg" href="/documentation/platform/secret-scanning/github">
+ Scan the repositories a GitHub Radar connection can access.
+ </Card>
+ <Card title="GitLab" icon="/images/platform/secret-scanning/icons/gitlab.svg" href="/documentation/platform/secret-scanning/gitlab">
+ Scan one GitLab project, or the projects in a group.
+ </Card>
+ <Card title="Bitbucket" icon="/images/platform/secret-scanning/icons/bitbucket.svg" href="/documentation/platform/secret-scanning/bitbucket">
+ Scan the repositories in a Bitbucket workspace.
+ </Card>
+</CardGroup>
+
+<CardGroup>
+<Card title="Findings" icon="search" href="/documentation/platform/secret-scanning/findings">
+ Review the secrets Infisical finds in your repositories.
+ </Card>
+ <Card title="Configuration" icon="settings" href="/documentation/platform/secret-scanning/configuration">
+ Add your own detection rules and skip secrets you've decided are safe.
+ </Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/documentation/platform/secret-scanning/pre-commit-hook.mdx b/docs/documentation/platform/secret-scanning/pre-commit-hook.mdx
new file mode 100644
index 0000000000..7f298306f5
--- /dev/null
+++ b/docs/documentation/platform/secret-scanning/pre-commit-hook.mdx
@@ -0,0 +1,42 @@
+---
+title: "Scan changes before you commit"
+sidebarTitle: "Pre-commit hook"
+description: "Prevent secrets from getting committed with a pre-commit hook that runs infisical scan."
+---
+
+`infisical scan git-changes` scans only the changes in your working tree, so you can catch a secret before it's in a commit. A pre-commit hook runs that scan for you before every commit.
+
+## Prerequisites
+
+- The [Infisical CLI](/cli/install) installed
+- Git installed
+
+## Scan your changes
+
+To scan the changes you've staged for your next commit, run:
+
+```bash
+infisical scan git-changes --staged --verbose
+```
+
+## Install the pre-commit hook
+
+To scan your staged changes before every commit, run this command in your repository:
+
+```bash
+infisical scan install --pre-commit-hook
+```
+
+The CLI adds the hook to `.git/hooks/pre-commit`, and Git then blocks any commit the scan finds a secret in.
+
+To turn the hook off in a repository, run `git config hooks.infisical-scan false`.
+
+## Use a Git hook manager
+
+If a hook manager such as [Husky](https://typicode.github.io/husky/) runs your Git hooks, add the scan to the hook manager's pre-commit script, such as `.husky/pre-commit`, instead of running `infisical scan install`:
+
+```bash
+infisical scan git-changes --staged --verbose
+```
+
+Hook managers point Git's `core.hooksPath` setting at their own folder. The install command offers to change that setting back to `.git/hooks`, which stops the hook manager's hooks from running.
diff --git a/docs/documentation/platform/secret-scanning/scan-locally.mdx b/docs/documentation/platform/secret-scanning/scan-locally.mdx
index 6b6bffab93..4590e5e9d6 100644
--- a/docs/documentation/platform/secret-scanning/scan-locally.mdx
+++ b/docs/documentation/platform/secret-scanning/scan-locally.mdx
@@ -1,17 +1,17 @@
---
title: "Scan code locally with the CLI"
-sidebarTitle: "Scan locally with the CLI"
-description: "Scan a repository, a directory, or your uncommitted changes for leaked secrets with infisical scan."
+sidebarTitle: "Scan with the CLI"
+description: "Scan a Git repository's history or a directory for leaked secrets with infisical scan."
---
-The [Infisical CLI](/cli/overview) includes a secret scanner, `infisical scan`, that finds leaked secrets in a Git repository's history, in a directory, or in changes you haven't committed yet. It uses the same rules and configuration format as scans of [connected repositories](/documentation/platform/secret-scanning/usage), but it runs on your machine or in a CI job and doesn't need an Infisical login. Its findings stay local: the CLI prints them, or writes them to a report file if you ask for one.
+The [Infisical CLI](/cli/overview) includes a secret scanner, `infisical scan`, that finds leaked secrets in a Git repository's history, in a directory, or in [changes you haven't committed yet](/documentation/platform/secret-scanning/pre-commit-hook).
## Prerequisites
- The [Infisical CLI](/cli/install) installed
- Git installed, if you're scanning a Git repository
-## Scan a repository or a directory
+## Scan a Git repository
To scan the full history of the Git repository you're in, run:
@@ -19,117 +19,33 @@ To scan the full history of the Git repository you're in, run:
infisical scan --verbose
```
-The scan reads every commit on every branch. To scan a range of commits instead, pass [Git log](https://git-scm.com/docs/git-log) options with `--log-opts`, such as `--log-opts="--all commitA..commitB"`. To scan the current files without reading Git history, add `--no-git` and point `--source` at a directory or a file:
+The scan reads every commit on every branch. To scan a range of commits instead, pass [Git log](https://git-scm.com/docs/git-log) options with `--log-opts`, such as `--log-opts="--all commitA..commitB"`.
-```bash
-infisical scan --no-git --source ./config --verbose
-```
-
-If the scan finds a secret, the command exits with code `1`, which fails a CI job. To write the findings to a file, add `--report-path`, and pick a format with `--report-format`: `json` (the default), `csv`, `sarif`, or `junit`. The [`infisical scan` reference](/cli/reference#scan) lists every flag.
-
-## Scan changes before you commit
-
-`infisical scan git-changes` scans only the changes in your working tree, so you can catch a secret before it's in a commit. Add `--staged` to scan what your next commit will contain:
-
-```bash
-infisical scan git-changes --staged --verbose
-```
-
-### Install the pre-commit hook
-
-To run that scan before every commit, run this command in your repository:
-
-```bash
-infisical scan install --pre-commit-hook
-```
-
-The CLI adds the hook to `.git/hooks/pre-commit`, and Git then blocks any commit the scan finds a secret in. To turn the hook off in a repository, run `git config hooks.infisical-scan false`.
-
-### Use a Git hook manager
-
-If a hook manager such as [Husky](https://typicode.github.io/husky/) runs your Git hooks, don't use `infisical scan install`. Hook managers point Git's `core.hooksPath` setting at their own folder, and the install command offers to change that setting back to `.git/hooks`, which stops the hook manager's hooks from running. Instead, add the scan to the hook manager's pre-commit script, such as `.husky/pre-commit`:
-
-```bash
-infisical scan git-changes --staged --verbose
-```
-
-## Ignore findings you've already reviewed
-
-A scan can flag a value you've decided is safe to commit, such as a test credential. You can ignore one line, ignore specific findings, or ignore every finding that already exists in the repository.
-
-### Ignore one line
-
-To ignore a secret on one line of code, add a `betterleaks:allow` comment at the end of the line:
+## Scan a directory without Git history
-```js example.js
-const testKey = "8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ"; // betterleaks:allow
-```
-
-The scanner also accepts `gitleaks:allow`, so existing `gitleaks:allow` comments keep working.
-
-### Ignore specific findings
-
-Each finding has a fingerprint, which you can find in the `Fingerprint` field of a JSON report. To ignore findings, list their fingerprints in a `.infisicalignore` file, one per line, in the directory you scan (the `--source` directory, which is the current directory by default):
-
-```text .infisicalignore
-bea0ff6e05a4de73a5db625d4ae181a015b50855:frontend/components/utilities/attemptLogin.js:stripe-access-token:147
-backend/src/json/integrations.json:generic-api-key:5
-```
-
-A fingerprint from a Git scan has the form `<commit>:<file>:<rule>:<line>`, and ignores the finding in that commit only. To ignore a finding in every commit, leave out the commit and write `<file>:<rule>:<line>`, which is also the form that scans without Git history report.
-
-### Ignore every existing finding with a baseline
-
-If you start scanning a repository that already has a long history, you can record every current finding in a baseline and have later scans report only new ones. First, write a JSON report of the current findings:
-
-```bash
-infisical scan --report-path baseline.json
-```
-
-Then pass that report to later scans with `--baseline-path`:
+To scan the current files in a directory or a file without reading Git history, add `--no-git` and point `--source` at the directory or file:
```bash
-infisical scan --baseline-path baseline.json --report-path findings.json
+infisical scan --no-git --source ./config --verbose
```
-`findings.json` then contains only the findings that aren't in `baseline.json`. The baseline must be a report in the default `json` format. `infisical scan git-changes` doesn't use a baseline.
-
-## Customize the scan rules
-
-By default, the scanner uses its built-in rules, which cover the credential formats of hundreds of services. To add your own rules or skip paths, create a configuration file named `.infisical-scan.toml` in the directory you scan. To use a file with a different name or location, pass it with `--config` or set `INFISICAL_SCAN_CONFIG`.
-
-A configuration file replaces the built-in rules unless it extends them. Set `useDefault = true` in the `[extend]` table to keep the built-in rules and add yours to them:
-
-```toml .infisical-scan.toml
-title = "Scan configuration for this repository"
+## Exit codes and reports
-[extend]
-useDefault = true
-disabledRules = ["generic-api-key"]
+If the scan finds a secret, the command exits with code `1`, which fails a CI job.
-[[rules]]
-id = "internal-api-token"
-description = "Internal API token"
-regex = '''itk_[a-z0-9]{32}'''
-keywords = ["itk_"]
-
-[[allowlists]]
-description = "Test fixtures"
-paths = ['''(^|/)testdata/''']
-```
-
-- `[extend]`: `useDefault = true` keeps the built-in rules, `path` extends another configuration file instead (relative to the directory you run the CLI in), and `disabledRules` turns off built-in rules by ID
-- `[[rules]]`: a detection rule with a unique `id`, a [Go regular expression](https://pkg.go.dev/regexp/syntax) in `regex`, and `keywords` that a line must contain before the regular expression runs on it
-- `entropy` and `secretGroup` in a rule: the minimum randomness a match needs, and the regular expression group that holds the secret
-- `[[allowlists]]`: matches to skip, by file `paths`, `regexes`, `stopwords` found in the secret, or `commits`
-
-If a rule in your file has the same `id` as a built-in rule, the fields you set replace the built-in rule's fields. The built-in rules are in [the CLI's default configuration](https://github.com/Infisical/cli/blob/main/detect/config/betterleaks.toml), which is also a reference for every field a rule can use.
+To write the findings to a file, add `--report-path`, and pick a format with `--report-format`: `json` (the default), `csv`, `sarif`, or `junit`.
## Next steps
<CardGroup cols={2}>
- <Card title="Usage" icon="radar" href="/documentation/platform/secret-scanning/usage">
- Scan connected GitHub, GitLab, and Bitbucket repositories from Infisical.
+ <Card title="Pre-commit hook" icon="git-commit-horizontal" href="/documentation/platform/secret-scanning/pre-commit-hook">
+ Prevent secrets from getting committed with a pre-commit hook that runs `infisical scan`.
+ </Card>
+ <Card title="Ignore findings" icon="eye-off" href="/documentation/platform/secret-scanning/ignore-findings">
+ Stop `infisical scan` from reporting secrets you've decided are safe to commit.
+ </Card>
+ <Card title="Configuration" icon="settings" href="/documentation/platform/secret-scanning/local-configuration">
+ Add your own detection rules to `infisical scan` and skip secrets you've decided are safe.
</Card>
<Card title="infisical scan" icon="terminal" href="/cli/reference#scan">
See every flag of the scan commands.
diff --git a/docs/documentation/platform/secret-scanning/scan-repositories.mdx b/docs/documentation/platform/secret-scanning/scan-repositories.mdx
new file mode 100644
index 0000000000..42839ddb9c
--- /dev/null
+++ b/docs/documentation/platform/secret-scanning/scan-repositories.mdx
@@ -0,0 +1,67 @@
+---
+title: "Scan repositories"
+sidebarTitle: "Overview"
+description: "Scan your GitHub, GitLab, and Bitbucket repositories for leaked secrets."
+---
+
+Infisical can scan your GitHub, GitLab, and Bitbucket repositories for leaked secrets. It scans each repository's full commit history, and can also scan each new push as it arrives.
+
+Infisical records every secret it finds as a [finding](/documentation/platform/secret-scanning/findings) that you can track until it's handled, and the [scanning configuration](/documentation/platform/secret-scanning/configuration) sets the rules it scans with.
+
+<Info>
+ Scanning repositories is available under Infisical's [Enterprise](https://infisical.com/pricing) plan. If you're self-hosting Infisical, contact [email protected] to purchase an enterprise license.
+
+ You don't need a license to [scan locally using the CLI](/documentation/platform/secret-scanning/scan-locally).
+</Info>
+
+## Data sources
+
+To scan repositories, connect them to Infisical with a data source. A data source covers the repositories in a GitHub organization, a GitLab project or group, or a Bitbucket workspace, and reaches them through an [app connection](/integrations/app-connections/overview). To create one, follow the guide for your provider:
+
+<CardGroup cols={3}>
+ <Card title="GitHub" icon="/images/platform/secret-scanning/icons/github.svg" href="/documentation/platform/secret-scanning/github">
+ Scan the repositories a GitHub Radar connection can access.
+ </Card>
+ <Card title="GitLab" icon="/images/platform/secret-scanning/icons/gitlab.svg" href="/documentation/platform/secret-scanning/gitlab">
+ Scan one GitLab project, or the projects in a group.
+ </Card>
+ <Card title="Bitbucket" icon="/images/platform/secret-scanning/icons/bitbucket.svg" href="/documentation/platform/secret-scanning/bitbucket">
+ Scan the repositories in a Bitbucket workspace.
+ </Card>
+</CardGroup>
+
+To see your data sources, go to **Secret Scanning** > **Data Sources**.
+
+![data sources](/images/platform/secret-scanning/secret-scanning-data-sources.png)
+
+### Resources
+
+A resource is one repository that a data source scans, such as a GitHub repository or a GitLab project. Infisical adds resources to a data source when it scans the data source, so a new repository that the data source covers appears after the next scan.
+
+To see a data source's resources and its **Scan History**, select the data source.
+
+![resources](/images/platform/secret-scanning/secret-scanning-resources.png)
+
+## Scans
+
+Infisical runs two types of scan:
+
+- **Historical scan**: Scans every commit in a repository, from the first to the latest
+- **Realtime scan**: Scans only the commits in a new push
+
+If **Auto-Scan** is enabled on a data source, Infisical runs a historical scan of every resource when you create the data source, and a realtime scan of every new push.
+
+To turn **Auto-Scan** on or off, select the options menu on the data source's row, then select **Enable Auto-Scan** or **Disable Auto-Scan**.
+
+### Run a historical scan
+
+You can run a historical scan at any time:
+
+- **Every resource in a data source**: Select the options menu on the data source's row, then select **Trigger Scan**
+- **One resource**: Select the data source, then select the options menu on the resource's row and select **Trigger Scan**
+
+### Scan history
+
+The **Scan History** on a data source's page shows each scan's type, its status, and whether it found any secrets.
+
+![scans](/images/platform/secret-scanning/secret-scanning-scans.png)
\ No newline at end of file
diff --git a/docs/documentation/platform/secret-scanning/usage.mdx b/docs/documentation/platform/secret-scanning/usage.mdx
deleted file mode 100644
index 49bf9fe8da..0000000000
--- a/docs/documentation/platform/secret-scanning/usage.mdx
+++ /dev/null
@@ -1,236 +0,0 @@
----
-title: "Usage"
-description: "Learn what is secret scanning and why it matters for building secure systems."
----
-
-## Introduction
-
-Monitor and detect exposed secrets across your data sources, including code repositories, with Infisical Secret Scanning.
-
-For additional security, we recommend using our [CLI Secret Scanner](/documentation/platform/secret-scanning/scan-locally#install-the-pre-commit-hook) to check for exposed secrets before pushing your code changes.
-
-<Note>
- Secret Scanning is a paid feature. If you're using Infisical Cloud, then it is
- available under the **Enterprise Tier**. If you're self-hosting Infisical,
- then you should contact [email protected] to purchase an enterprise license
- to use it.
-</Note>
-
-## How secret scanning works
-
-Secret Scanning consists of several components that enable you to quickly respond to secret leaks:
-
-- **Scanner Engine**: The core component that analyzes your code and detects potential secrets using pattern matching and entropy analysis
-- **Real-time Monitoring**: Provides continuous surveillance of your repositories for immediate detection of exposed secrets
-- **Alert System**: Notifies organization admins via email when secrets are detected
-- **Risk Management**: Allows tracking and managing detected secrets with different status options
-- **Data Sources**: Integrates with various data sources and version control systems
-- **Customizable Rules**: Supports ignore patterns and custom configurations to reduce false positives
-
-These components work together to provide comprehensive secret detection and incident response capabilities.
-
-### Data sources
-
-Data sources are configured integrations with external platforms, such as a GitHub organization or a GitLab group, that establish secure connections for scanning purposes using [App Connections](/integrations/app-connections/overview).
-
-A data source acts as a secure intermediary between the external system and the scanner engine. It manages a collection of scannable resources (such as repositories) and handles the authentication and communication required for scanning operations.
-
-![data sources](/images/platform/secret-scanning/secret-scanning-data-sources.png)
-
-### Resources
-
-Resources are the atomic, scannable units, such as a repository, that can be monitored for secret exposure. Resources are added automatically when a data source is scanned and updated when scanning events are triggered, such as when a user pushes changes to GitHub.
-
-Each resource maintains its own scanning history and status, allowing for granular monitoring and management of secret scanning across your organization.
-
-![resources](/images/platform/secret-scanning/secret-scanning-resources.png)
-
-### Scans
-
-Scans can be initiated in two ways:
-
-1. **Historical Scan** - Manually triggered scan that comprehensively checks either all resources associated with a data source or a single selected resource.
-
-2. **Realtime Scan** - Automatically executed when **Auto-Scan** is enabled on a data source. This scan type specifically focuses on updates to existing resources.
-
-All scan activities can be monitored in real-time through the Infisical UI, which displays:
-
-- Current scan status
-- Timestamp of the scan
-- Resource(s) being scanned
-- Detection results (whether any secrets were found)
-
-![scans](/images/platform/secret-scanning/secret-scanning-scans.png)
-
-### Findings
-
-Findings are automatically generated when secret leaks are detected during scanning operations. Each finding contains comprehensive information including:
-
-- The specific scanning rule that identified the leak
-- File location and line number where the secret was found
-- Resource-specific details (e.g., commit hash and author for Git repositories)
-
-Findings are initially marked as **Unresolved** and can be updated to one of the following statuses with additional remarks:
-
-- **Resolved** - The issue has been addressed
-- **False Positive** - The detection was incorrect
-- **Ignore** - The finding can be safely disregarded
-
-These status options help teams effectively track and manage the lifecycle of detected secret leaks.
-
-![findings](/images/platform/secret-scanning/secret-scanning-findings.png)
-
-### Configuration
-
-You can configure custom scanning rules and exceptions by updating your project's scanning configuration via the UI or API.
-
-The configuration options allow you to:
-
-- Define custom scanning patterns and rules
-- Set up ignore patterns to reduce false positives
-- Specify file path exclusions
-- Configure entropy thresholds for secret detection
-- Add allowlists for known safe patterns
-
-For detailed configuration options, expand the example configuration below.
-
-<Accordion title="Example Configuration">
- ```toml
- # Title for the configuration file
- title = "Some title"
-
- # This configuration is the foundation that can be expanded. If there are any overlapping rules
- # between this base and the expanded configuration, the rules in this base will take priority.
- # Another aspect of extending configurations is the ability to link multiple files, up to a depth of 2.
- # "Allowlist" arrays get appended and may have repeated elements.
- # "useDefault" and "path" cannot be used simultaneously. Please choose one.
- [extend]
- # useDefault will extend the base configuration with the default config:
- # https://raw.githubusercontent.com/Infisical/infisical/main/cli/config/infisical-scan.toml
- useDefault = true
- # or you can supply a path to a configuration. Path is relative to where infisical cli
- # was invoked, not the location of the base config.
- path = "common_config.toml"
-
- # An array of tables that contain information that define instructions
- # on how to detect secrets
- [[rules]]
-
- # Unique identifier for this rule
- id = "some-identifier-for-rule"
-
- # Short human readable description of the rule.
- description = "awesome rule 1"
-
- # Golang regular expression used to detect secrets. Note Golang's regex engine
- # does not support lookaheads.
- regex = '''one-go-style-regex-for-this-rule'''
-
- # Golang regular expression used to match paths. This can be used as a standalone rule or it can be used
- # in conjunction with a valid `regex` entry.
- path = '''a-file-path-regex'''
-
- # Array of strings used for metadata and reporting purposes.
- tags = ["tag","another tag"]
-
- # A regex match may have many groups, this allows you to specify the group that should be used as (which group the secret is contained in)
- # its entropy checked if `entropy` is set.
- secretGroup = 3
-
- # Float representing the minimum shannon entropy a regex group must have to be considered a secret.
- # Shannon entropy measures how random a data is. Since secrets are usually composed of many random characters, they typically have high entropy
- entropy = 3.5
-
- # Keywords are used for pre-regex check filtering.
- # If rule has keywords but the text fragment being scanned doesn't have at least one of it's keywords, it will be skipped for processing further.
- # Ideally these values should either be part of the identifier or unique strings specific to the rule's regex
- # (introduced in v8.6.0)
- keywords = [
- "auth",
- "password",
- "token",
- ]
-
- # You can include an allowlist table for a single rule to reduce false positives or ignore commits
- # with known/rotated secrets
- [rules.allowlist]
- description = "ignore commit A"
- commits = [ "commit-A", "commit-B"]
- paths = [
- '''go\.mod''',
- '''go\.sum'''
- ]
- # note: (rule) regexTarget defaults to check the _Secret_ in the finding.
- # if regexTarget is not specified then _Secret_ will be used.
- # Acceptable values for regexTarget are "match" and "line"
- regexTarget = "match"
- regexes = [
- '''process''',
- '''getenv''',
- ]
- # note: stopwords targets the extracted secret, not the entire regex match
- # if the extracted secret is found in the stopwords list, the finding will be skipped (i.e not included in report)
- stopwords = [
- '''client''',
- '''endpoint''',
- ]
-
-
- # This is a global allowlist which has a higher order of precedence than rule-specific allowlists.
- # If a commit listed in the `commits` field below is encountered then that commit will be skipped and no
- # secrets will be detected for said commit. The same logic applies for regexes and paths.
- [allowlist]
- description = "global allow list"
- commits = [ "commit-A", "commit-B", "commit-C"]
- paths = [
- '''gitleaks\.toml''',
- '''(.*?)(jpg|gif|doc)'''
- ]
-
- # note: (global) regexTarget defaults to check the _Secret_ in the finding.
- # if regexTarget is not specified then _Secret_ will be used.
- # Acceptable values for regexTarget are "match" and "line"
- regexTarget = "match"
-
- regexes = [
- '''219-09-9999''',
- '''078-05-1120''',
- '''(9[0-9]{2}|666)-\d{2}-\d{4}''',
- ]
- # note: stopwords targets the extracted secret, not the entire regex match
- # if the extracted secret is found in the stopwords list, the finding will be skipped (i.e not included in report)
- stopwords = [
- '''client''',
- '''endpoint''',
- ]
- ```
-
-</Accordion>
-
-![config](/images/platform/secret-scanning/secret-scanning-config.png)
-
-## Ignoring known secrets
-
-If you're intentionally committing a test secret that the secret scanner might flag, you can instruct Infisical to overlook that secret with the methods listed below.
-
-### `betterleaks:allow`
-
-To ignore a secret contained in line of code, simply add `betterleaks:allow` at the end of the line as comment in the given programming.
-
-```js example.js
-function helloWorld() {
- console.log("8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ"); // betterleaks:allow
-}
-```
-
-### .infisicalignore
-
-An alternative method to exclude specific findings involves creating a .infisicalignore file at your repository's root.
-You can then add the fingerprints of the findings you wish to exclude. The [Infisical scan](/documentation/platform/secret-scanning/scan-locally) report provides a unique Fingerprint for each secret found.
-By incorporating these Fingerprints into the .infisicalignore file, Infisical will skip the corresponding secret findings in subsequent scans.
-
-```.ignore .infisicalignore
-bea0ff6e05a4de73a5db625d4ae181a015b50855:frontend/components/utilities/attemptLogin.js:stripe-access-token:147
-bea0ff6e05a4de73a5db625d4ae181a015b50855:backend/src/json/integrations.json:generic-api-key:5
-1961b92340e5d2613acae528b886c842427ce5d0:frontend/components/utilities/attemptLogin.js:stripe-access-token:148
-```
diff --git a/docs/images/platform/secret-scanning/icons/bitbucket.svg b/docs/images/platform/secret-scanning/icons/bitbucket.svg
new file mode 100644
index 0000000000..5d172a68b4
--- /dev/null
+++ b/docs/images/platform/secret-scanning/icons/bitbucket.svg
@@ -0,0 +1 @@
+<svg role="img" fill="#0052CC" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Bitbucket</title><path d="M.778 1.213a.768.768 0 00-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 00.77-.646l3.27-20.03a.768.768 0 00-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z"/></svg>
\ No newline at end of file
diff --git a/docs/images/platform/secret-scanning/icons/github.svg b/docs/images/platform/secret-scanning/icons/github.svg
new file mode 100644
index 0000000000..c596257d9d
--- /dev/null
+++ b/docs/images/platform/secret-scanning/icons/github.svg
@@ -0,0 +1 @@
+<svg role="img" fill="#6E7781" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
\ No newline at end of file
diff --git a/docs/images/platform/secret-scanning/icons/gitlab.svg b/docs/images/platform/secret-scanning/icons/gitlab.svg
new file mode 100644
index 0000000000..a93a732bf2
--- /dev/null
+++ b/docs/images/platform/secret-scanning/icons/gitlab.svg
@@ -0,0 +1 @@
+<svg role="img" fill="#FC6D26" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitLab</title><path d="m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"/></svg>
\ No newline at end of file
diff --git a/docs/snippets/documentation/platform/secret-scanning/allowlist-fields.mdx b/docs/snippets/documentation/platform/secret-scanning/allowlist-fields.mdx
new file mode 100644
index 0000000000..98910564b8
--- /dev/null
+++ b/docs/snippets/documentation/platform/secret-scanning/allowlist-fields.mdx
@@ -0,0 +1,25 @@
+The scanner skips a match if any field in the table matches it.
+
+<ResponseField name="description" type="string">
+What the allowlist is for.
+</ResponseField>
+
+<ResponseField name="paths" type="string[]">
+Regular expressions for the paths of files to skip.
+</ResponseField>
+
+<ResponseField name="commits" type="string[]">
+The IDs of commits to skip.
+</ResponseField>
+
+<ResponseField name="regexes" type="string[]">
+Regular expressions for secrets to skip.
+</ResponseField>
+
+<ResponseField name="stopwords" type="string[]">
+Words that, if a secret contains one, make the scanner skip the secret.
+</ResponseField>
+
+<ResponseField name="condition" type="string" default="OR">
+Set to `AND` to skip a match only if every field you set matches it.
+</ResponseField>
diff --git a/docs/snippets/documentation/platform/secret-scanning/extend-fields.mdx b/docs/snippets/documentation/platform/secret-scanning/extend-fields.mdx
new file mode 100644
index 0000000000..d4a7ca7dc2
--- /dev/null
+++ b/docs/snippets/documentation/platform/secret-scanning/extend-fields.mdx
@@ -0,0 +1,7 @@
+<ResponseField name="useDefault" type="boolean">
+Whether to keep the built-in rules. The built-in rules and their IDs are in [the CLI's default configuration](https://github.com/Infisical/cli/blob/main/detect/config/betterleaks.toml).
+</ResponseField>
+
+<ResponseField name="disabledRules" type="string[]">
+The IDs of built-in rules to turn off.
+</ResponseField>
diff --git a/docs/snippets/documentation/platform/secret-scanning/ignore-one-line.mdx b/docs/snippets/documentation/platform/secret-scanning/ignore-one-line.mdx
new file mode 100644
index 0000000000..8970dc3a9b
--- /dev/null
+++ b/docs/snippets/documentation/platform/secret-scanning/ignore-one-line.mdx
@@ -0,0 +1,9 @@
+## Ignore one line
+
+To ignore a secret on one line of code, add a `betterleaks:allow` comment at the end of the line:
+
+```js example.js
+const testKey = "8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ"; // betterleaks:allow
+```
+
+The scanner also accepts `gitleaks:allow`, so existing `gitleaks:allow` comments keep working.
diff --git a/docs/snippets/documentation/platform/secret-scanning/rule-fields.mdx b/docs/snippets/documentation/platform/secret-scanning/rule-fields.mdx
new file mode 100644
index 0000000000..2ba19ebac9
--- /dev/null
+++ b/docs/snippets/documentation/platform/secret-scanning/rule-fields.mdx
@@ -0,0 +1,39 @@
+import AllowlistFields from "/snippets/documentation/platform/secret-scanning/allowlist-fields.mdx";
+
+If a rule has the same `id` as a built-in rule, the fields you set replace the built-in rule's fields.
+
+<ResponseField name="id" type="string" required>
+A unique ID for the rule.
+</ResponseField>
+
+<ResponseField name="description" type="string">
+What the rule detects.
+</ResponseField>
+
+<ResponseField name="regex" type="string">
+A [Go regular expression](https://pkg.go.dev/regexp/syntax) that matches the secret. A rule needs `regex`, `path`, or both.
+</ResponseField>
+
+<ResponseField name="path" type="string">
+A regular expression for file paths. On its own, `path` makes the rule report every file whose path matches. With `regex`, the rule only checks files whose path matches.
+</ResponseField>
+
+<ResponseField name="keywords" type="string[]">
+Words that a line must contain before the scanner checks the line against `regex`.
+</ResponseField>
+
+<ResponseField name="entropy" type="number">
+The minimum randomness a match needs.
+</ResponseField>
+
+<ResponseField name="secretGroup" type="integer">
+The group in `regex` that holds the secret.
+</ResponseField>
+
+<ResponseField name="allowlists" type="table[]">
+Matches of this rule to skip, as `[[rules.allowlists]]` tables.
+
+<Expandable title="properties">
+<AllowlistFields />
+</Expandable>
+</ResponseField>
diff --git a/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/components/SecretScanningFindingsSection.tsx b/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/components/SecretScanningFindingsSection.tsx
index 46445c07d9..1218d5379b 100644
--- a/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/components/SecretScanningFindingsSection.tsx
+++ b/frontend/src/pages/secret-scanning/SecretScanningFindingsPage/components/SecretScanningFindingsSection.tsx
@@ -23,7 +23,7 @@ export const SecretScanningFindingsSection = () => {
<div>
<div className="flex items-center gap-x-2">
<p className="text-xl font-medium text-foreground">Findings</p>
- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/usage#findings" />
+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/findings" />
</div>
<p className="text-sm text-label-secondary">
Secret leaks discovered across your data sources
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
index 0a49a1676d..dcddfa8e93 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
@@ -54,7 +54,7 @@ export const SecretScanningConfigForm = ({ config }: Props) => {
<div className="mb-4">
<div className="flex items-center gap-2">
<h2 className="text-xl font-normal text-foreground">Project Configuration</h2>
- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/usage#configuration" />
+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/configuration" />
</div>
<p className="leading-5 text-muted">Configure rules and exceptions to customize scanning</p>
</div>