Skip to content

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

remove secret scanning config

Matheus Nogueirae5b705da0593
diff --git a/backend/src/ee/routes/v2/secret-scanning-v2-routers/secret-scanning-v2-router.ts b/backend/src/ee/routes/v2/secret-scanning-v2-routers/secret-scanning-v2-router.ts
index dedfc9a02e..afdcc2c4f2 100644
--- a/backend/src/ee/routes/v2/secret-scanning-v2-routers/secret-scanning-v2-router.ts
+++ b/backend/src/ee/routes/v2/secret-scanning-v2-routers/secret-scanning-v2-router.ts
@@ -1,6 +1,5 @@
import { z } from "zod";
-import { SecretScanningConfigsSchema } from "@app/db/schemas";
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { BitbucketDataSourceListItemSchema } from "@app/ee/services/secret-scanning-v2/bitbucket";
import { GitHubDataSourceListItemSchema } from "@app/ee/services/secret-scanning-v2/github";
@@ -13,12 +12,7 @@ import {
SecretScanningDataSourceSchema,
SecretScanningFindingSchema
} from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-union-schemas";
-import {
- ApiDocsTags,
- SecretScanningConfigs,
- SecretScanningDataSources,
- SecretScanningFindings
-} from "@app/lib/api-docs";
+import { ApiDocsTags, SecretScanningDataSources, SecretScanningFindings } from "@app/lib/api-docs";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
@@ -261,98 +255,6 @@ export const registerSecretScanningV2Router = async (server: FastifyZodProvider)
}
});
- server.route({
- method: "GET",
- url: "/configs",
- config: {
- rateLimit: readLimit
- },
- schema: {
- hide: false,
- operationId: "getSecretScanningConfig",
- tags: [ApiDocsTags.SecretScanning],
- description: "Get the Secret Scanning Config for the specified project.",
- querystring: z.object({
- projectId: z
- .string()
- .trim()
- .min(1, "Project ID required")
- .describe(SecretScanningConfigs.GET_BY_PROJECT_ID.projectId)
- }),
- response: {
- 200: z.object({
- config: z.object({ content: z.string().nullish(), projectId: z.string(), updatedAt: z.date().nullish() })
- })
- }
- },
- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN, AuthMode.OAUTH]),
- handler: async (req) => {
- const {
- query: { projectId },
- permission
- } = req;
-
- const config = await server.services.secretScanningV2.findSecretScanningConfigByProjectId(projectId, permission);
-
- await server.services.auditLog.createAuditLog({
- ...req.auditLogInfo,
- projectId,
- event: {
- type: EventType.SECRET_SCANNING_CONFIG_GET
- }
- });
-
- return { config };
- }
- });
-
- server.route({
- method: "PATCH",
- url: "/configs",
- config: {
- rateLimit: writeLimit
- },
- schema: {
- hide: false,
- operationId: "updateSecretScanningConfig",
- tags: [ApiDocsTags.SecretScanning],
- description: "Update the specified Secret Scanning Configuration.",
- querystring: z.object({
- projectId: z.string().trim().min(1, "Project ID required").describe(SecretScanningConfigs.UPDATE.projectId)
- }),
- body: z.object({
- content: z.string().nullable().describe(SecretScanningConfigs.UPDATE.content)
- }),
- response: {
- 200: z.object({ config: SecretScanningConfigsSchema })
- }
- },
- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
- handler: async (req) => {
- const {
- query: { projectId },
- body,
- permission
- } = req;
-
- const config = await server.services.secretScanningV2.upsertSecretScanningConfig(
- { projectId, ...body },
- permission
- );
-
- await server.services.auditLog.createAuditLog({
- ...req.auditLogInfo,
- projectId,
- event: {
- type: EventType.SECRET_SCANNING_CONFIG_UPDATE,
- metadata: body
- }
- });
-
- return { config };
- }
- });
-
// not exposed, for UI only
server.route({
method: "GET",
diff --git a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-dal.ts b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-dal.ts
index b895069106..64727dded3 100644
--- a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-dal.ts
+++ b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-dal.ts
@@ -126,7 +126,6 @@ export const secretScanningV2DALFactory = (db: TDbClient) => {
const resourceOrm = ormify(db, TableName.SecretScanningResource);
const scanOrm = ormify(db, TableName.SecretScanningScan);
const findingOrm = ormify(db, TableName.SecretScanningFinding);
- const configOrm = ormify(db, TableName.SecretScanningConfig);
const findDataSource = async (filter: Parameters<(typeof dataSourceOrm)["find"]>[0], tx?: Knex) => {
try {
@@ -530,7 +529,6 @@ export const secretScanningV2DALFactory = (db: TDbClient) => {
findings: {
...findingOrm,
countByScanId: countFindingsByScanId
- },
- configs: configOrm
+ }
};
};
diff --git a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-queue.ts b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-queue.ts
index e1f6e1f450..7dc168211e 100644
--- a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-queue.ts
+++ b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-queue.ts
@@ -2,11 +2,7 @@ import { join } from "path";
import { ProjectMembershipRole, TSecretScanningFindings } from "@app/db/schemas";
import { EventType, TAuditLogServiceFactory } from "@app/ee/services/audit-log/audit-log-types";
-import {
- createTempFolder,
- deleteTempFolder,
- writeTextToFile
-} from "@app/ee/services/secret-scanning/secret-scanning-queue/secret-scanning-fns";
+import { createTempFolder, deleteTempFolder } from "@app/ee/services/secret-scanning/secret-scanning-queue/secret-scanning-fns";
import {
assertClonedRepositoryWithinSizeLimit,
parseScanErrorMessage,
@@ -329,17 +325,6 @@ export const secretScanningV2QueueServiceFactory = ({
tempFolder
});
- const config = await secretScanningV2DAL.configs.findOne({
- projectId: dataSource.projectId
- });
-
- let configPath: string | undefined;
-
- if (config && config.content) {
- configPath = join(tempFolder, "infisical-scan.toml");
- await writeTextToFile(configPath, config.content);
- }
-
// Counts what this attempt scanned, for the progress logs only. The scan's finding total is
// read from the database at the end, because an attempt that resumes a partly-scanned scan
// never sees the batches an earlier one already persisted.
@@ -407,7 +392,7 @@ export const secretScanningV2QueueServiceFactory = ({
const { SECRET_SCANNING_COMMIT_BATCH_SIZE: batchSize } = getConfig();
if (!batchSize) {
- const batchFindings = await scanGitRepositoryAndGetFindings(scanPath, findingsPath, configPath);
+ const batchFindings = await scanGitRepositoryAndGetFindings(scanPath, findingsPath);
scannedFindingsCount += batchFindings.length;
stillOwned = await persistBatch(batchFindings);
break;
@@ -429,7 +414,7 @@ export const secretScanningV2QueueServiceFactory = ({
const batchFindings = await scanGitRepositoryAndGetFindings(
scanPath,
join(tempFolder, `findings-${index}.json`),
- configPath,
+ undefined,
batch
);
@@ -677,25 +662,13 @@ export const secretScanningV2QueueServiceFactory = ({
let connection: TAppConnection | null = null;
if (dataSource.connection) connection = await decryptAppConnection(dataSource.connection, kmsService);
- const config = await secretScanningV2DAL.configs.findOne({
- projectId: dataSource.projectId
- });
-
- let configPath: string | undefined;
-
- if (config && config.content) {
- configPath = join(tempFolder, "infisical-scan.toml");
- await writeTextToFile(configPath, config.content);
- }
-
const findingsPayload = await factory.getDiffScanFindingsPayload({
dataSource: {
...dataSource,
connection
} as TSecretScanningDataSourceWithConnection,
resourceName: resource.name,
- payload,
- configPath
+ payload
});
const { allFindings, closedOutByThisRun } = await secretScanningV2DAL.findings.transaction(async (tx) => {
diff --git a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-service.ts b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-service.ts
index 36a425d7b2..24b2e57202 100644
--- a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-service.ts
+++ b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-service.ts
@@ -1,21 +1,13 @@
import { ForbiddenError } from "@casl/ability";
-import { join } from "path";
import { ActionProjectType } from "@app/db/schemas";
import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
- ProjectPermissionSecretScanningConfigActions,
ProjectPermissionSecretScanningDataSourceActions,
ProjectPermissionSecretScanningFindingActions,
ProjectPermissionSub
} from "@app/ee/services/permission/project-permission";
-import {
- createTempFolder,
- deleteTempFolder,
- scanContentAndGetFindings,
- writeTextToFile
-} from "@app/ee/services/secret-scanning/secret-scanning-queue/secret-scanning-fns";
import { githubSecretScanningService } from "@app/ee/services/secret-scanning-v2/github/github-secret-scanning-service";
import { SecretScanningFindingStatus } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-enums";
import { SECRET_SCANNING_FACTORY_MAP } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-factory";
@@ -40,8 +32,7 @@ import {
TSecretScanningScanWithDetails,
TTriggerSecretScanningDataSourceDTO,
TUpdateSecretScanningDataSourceDTO,
- TUpdateSecretScanningFindingDTO,
- TUpsertSecretScanningConfigDTO
+ TUpdateSecretScanningFindingDTO
} from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-types";
import { DatabaseErrorCode } from "@app/lib/error-codes";
import { BadRequestError, DatabaseError, NotFoundError } from "@app/lib/errors";
@@ -835,94 +826,6 @@ export const secretScanningV2ServiceFactory = ({
return { finding: updatedFinding as TSecretScanningFinding, projectId: finding.projectId };
};
- const findSecretScanningConfigByProjectId = async (projectId: string, actor: OrgServiceActor) => {
- const plan = await licenseService.getPlan(actor.orgId);
-
- if (!plan.secretScanning)
- throw new BadRequestError({
- message:
- "Failed to access Secret Scanning Configuration due to plan restriction. Upgrade plan to enable Secret Scanning."
- });
-
- const { permission } = await permissionService.getProjectPermission({
- actor: actor.type,
- actorId: actor.id,
- actorAuthMethod: actor.authMethod,
- actorOrgId: actor.orgId,
- actionProjectType: ActionProjectType.SecretScanning,
- projectId
- });
-
- ForbiddenError.from(permission).throwUnlessCan(
- ProjectPermissionSecretScanningConfigActions.Read,
- ProjectPermissionSub.SecretScanningConfigs
- );
-
- const config = await secretScanningV2DAL.configs.findOne({
- projectId
- });
-
- return (
- config ?? { content: null, projectId, updatedAt: null } // using default config
- );
- };
-
- const upsertSecretScanningConfig = async (
- { projectId, content }: TUpsertSecretScanningConfigDTO,
- actor: OrgServiceActor
- ) => {
- const plan = await licenseService.getPlan(actor.orgId);
-
- if (!plan.secretScanning)
- throw new BadRequestError({
- message:
- "Failed to access Secret Scanning Configuration due to plan restriction. Upgrade plan to enable Secret Scanning."
- });
-
- const { permission } = await permissionService.getProjectPermission({
- actor: actor.type,
- actorId: actor.id,
- actorAuthMethod: actor.authMethod,
- actorOrgId: actor.orgId,
- actionProjectType: ActionProjectType.SecretScanning,
- projectId
- });
-
- ForbiddenError.from(permission).throwUnlessCan(
- ProjectPermissionSecretScanningConfigActions.Update,
- ProjectPermissionSub.SecretScanningConfigs
- );
-
- if (content) {
- const tempFolder = await createTempFolder();
- try {
- const configPath = join(tempFolder, "infisical-scan.toml");
- await writeTextToFile(configPath, content);
-
- // just checking if config parses
- await scanContentAndGetFindings("", configPath);
- } catch (e) {
- throw new BadRequestError({
- message: "Unable to parse configuration: Check syntax and formatting."
- });
- } finally {
- await deleteTempFolder(tempFolder);
- }
- }
-
- const [config] = await secretScanningV2DAL.configs.upsert(
- [
- {
- projectId,
- content
- }
- ],
- "projectId"
- );
-
- return config;
- };
-
return {
listSecretScanningDataSourceOptions,
listSecretScanningDataSourcesByProjectId,
@@ -940,8 +843,6 @@ export const secretScanningV2ServiceFactory = ({
getSecretScanningUnresolvedFindingsCountByProjectId,
listSecretScanningFindingsByProjectId,
updateSecretScanningFindingById,
- findSecretScanningConfigByProjectId,
- upsertSecretScanningConfig,
github: githubSecretScanningService(secretScanningV2DAL, secretScanningV2Queue),
bitbucket: bitbucketSecretScanningService(secretScanningV2DAL, secretScanningV2Queue, kmsService),
gitlab: gitlabSecretScanningService(secretScanningV2DAL, secretScanningV2Queue, kmsService)
diff --git a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-types.ts b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-types.ts
index d885b05f5f..b2d1673bb6 100644
--- a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-types.ts
+++ b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-types.ts
@@ -247,8 +247,3 @@ export type TUpdateSecretScanningFindingDTO = {
remarks?: string | null;
findingId: string;
};
-
-export type TUpsertSecretScanningConfigDTO = {
- projectId: string;
- content: string | null;
-};
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 20fb612be4..5274b77b58 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -3834,16 +3834,6 @@ export const SecretScanningFindings = {
}
};
-export const SecretScanningConfigs = {
- GET_BY_PROJECT_ID: {
- projectId: `The ID of the project to retrieve the Secret Scanning Configuration for.`
- },
- UPDATE: {
- projectId: "The ID of the project to update the Secret Scanning Configuration for.",
- content: "The contents of the Secret Scanning Configuration file."
- }
-};
-
export const OidcSSo = {
GET_CONFIG: {
organizationId: "The ID of the organization to get the OIDC config for."
diff --git a/docs/api-reference/endpoints/secret-scanning/config/get-by-project-id.mdx b/docs/api-reference/endpoints/secret-scanning/config/get-by-project-id.mdx
deleted file mode 100644
index 4f1994d358..0000000000
--- a/docs/api-reference/endpoints/secret-scanning/config/get-by-project-id.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: "Get by project ID"
-openapi: "GET /api/v2/secret-scanning/configs"
----
diff --git a/docs/api-reference/endpoints/secret-scanning/config/update.mdx b/docs/api-reference/endpoints/secret-scanning/config/update.mdx
deleted file mode 100644
index bf068a20fc..0000000000
--- a/docs/api-reference/endpoints/secret-scanning/config/update.mdx
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: "Update"
-openapi: "PATCH /api/v2/secret-scanning/configs"
----
-
-<Note>
- Check out the [Configuration Docs](/documentation/platform/secret-scanning/overview#configuration) for an in-depth guide on custom configurations.
-</Note>
\ No newline at end of file
diff --git a/docs/docs.json b/docs/docs.json
index 1924ba2945..1531ac4cd8 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -4363,13 +4363,6 @@
"api-reference/endpoints/secret-scanning/findings/list",
"api-reference/endpoints/secret-scanning/findings/update"
]
- },
- {
- "group": "Configuration",
- "pages": [
- "api-reference/endpoints/secret-scanning/config/get-by-project-id",
- "api-reference/endpoints/secret-scanning/config/update"
- ]
}
]
},
diff --git a/docs/documentation/platform/secret-scanning/usage.mdx b/docs/documentation/platform/secret-scanning/usage.mdx
index 0c001d9604..c1d4dab7d6 100644
--- a/docs/documentation/platform/secret-scanning/usage.mdx
+++ b/docs/documentation/platform/secret-scanning/usage.mdx
@@ -25,7 +25,7 @@ Secret Scanning consists of several components that enable you to quickly respon
- **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
+- **Ignore Rules**: Supports ignore patterns to reduce false positives
These components work together to provide comprehensive secret detection and incident response capabilities.
@@ -80,135 +80,6 @@ These status options help teams effectively track and manage the lifecycle of de
![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.
diff --git a/docs/images/platform/secret-scanning/secret-scanning-config.png b/docs/images/platform/secret-scanning/secret-scanning-config.png
deleted file mode 100644
index b844f711fc..0000000000
Binary files a/docs/images/platform/secret-scanning/secret-scanning-config.png and /dev/null differ
diff --git a/frontend/src/hooks/api/secretScanningV2/mutations.tsx b/frontend/src/hooks/api/secretScanningV2/mutations.tsx
index beb1cffa08..6412350454 100644
--- a/frontend/src/hooks/api/secretScanningV2/mutations.tsx
+++ b/frontend/src/hooks/api/secretScanningV2/mutations.tsx
@@ -6,8 +6,6 @@ import { secretScanningV2Keys } from "./queries";
import {
TCreateSecretScanningDataSourceDTO,
TDeleteSecretScanningDataSourceDTO,
- TGetSecretScanningConfigResponse,
- TSecretScanningConfig,
TSecretScanningDataSourceResponse,
TSecretScanningFindingResponse,
TTriggerSecretScanningDataSourceDTO,
@@ -165,22 +163,3 @@ export const useUpdateMultipleSecretScanningFinding = () => {
}
});
};
-
-export const useUpdateSecretScanningConfig = () => {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: async ({ projectId, ...params }: TSecretScanningConfig) => {
- const { data } = await apiRequest.patch<TGetSecretScanningConfigResponse>(
- `/api/v2/secret-scanning/configs?projectId=${projectId}`,
- params
- );
-
- return data.config;
- },
- onSuccess: (_, { projectId }) => {
- queryClient.invalidateQueries({
- queryKey: secretScanningV2Keys.configByProjectId(projectId)
- });
- }
- });
-};
diff --git a/frontend/src/hooks/api/secretScanningV2/queries.tsx b/frontend/src/hooks/api/secretScanningV2/queries.tsx
index d500a5371d..3e7867f72a 100644
--- a/frontend/src/hooks/api/secretScanningV2/queries.tsx
+++ b/frontend/src/hooks/api/secretScanningV2/queries.tsx
@@ -3,7 +3,6 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import {
- TGetSecretScanningConfigResponse,
TGetSecretScanningDataSource,
TGetSecretScanningUnresolvedFindingsResponse,
TListSecretScanningDataSourceOptions,
@@ -11,7 +10,6 @@ import {
TListSecretScanningFindingsResponse,
TListSecretScanningResourcesResponse,
TListSecretScanningScansResponse,
- TSecretScanningConfig,
TSecretScanningDataSource,
TSecretScanningDataSourceOption,
TSecretScanningDataSourceResponse,
@@ -44,9 +42,7 @@ export const secretScanningV2Keys = {
finding: () => [...secretScanningV2Keys.all, "finding"] as const,
findingCount: (projectId: string) =>
[...secretScanningV2Keys.finding(), "count", projectId] as const,
- listFindings: (projectId: string) => [...secretScanningV2Keys.finding(), "list", projectId],
- configByProjectId: (projectId: string) =>
- [...secretScanningV2Keys.all, "config", projectId] as const
+ listFindings: (projectId: string) => [...secretScanningV2Keys.finding(), "list", projectId]
};
export const useSecretScanningDataSourceOptions = (
@@ -220,29 +216,3 @@ export const useListSecretScanningFindings = (
...options
});
};
-
-export const useGetSecretScanningConfig = (
- projectId: string,
- options?: Omit<
- UseQueryOptions<
- TSecretScanningConfig,
- unknown,
- TSecretScanningConfig,
- ReturnType<typeof secretScanningV2Keys.configByProjectId>
- >,
- "queryKey" | "queryFn"
- >
-) => {
- return useQuery({
- queryKey: secretScanningV2Keys.configByProjectId(projectId),
- queryFn: async () => {
- const { data } = await apiRequest.get<TGetSecretScanningConfigResponse>(
- "/api/v2/secret-scanning/configs",
- { params: { projectId } }
- );
-
- return data.config;
- },
- ...options
- });
-};
diff --git a/frontend/src/hooks/api/secretScanningV2/types/index.ts b/frontend/src/hooks/api/secretScanningV2/types/index.ts
index 2c45c9bcfd..fd9c458c49 100644
--- a/frontend/src/hooks/api/secretScanningV2/types/index.ts
+++ b/frontend/src/hooks/api/secretScanningV2/types/index.ts
@@ -126,15 +126,6 @@ export type TGetSecretScanningUnresolvedFindingsResponse = {
unresolvedFindings: number;
};
-export type TSecretScanningConfig = {
- projectId: string;
- content: string | null;
-};
-
-export type TGetSecretScanningConfigResponse = {
- config: TSecretScanningConfig;
-};
-
export type TSecretScanningFinding = {
id: string;
dataSourceName: string;
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
index d50ab97fbd..9e94f5bf4f 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
@@ -23,7 +23,6 @@ import {
CERT_CERTIFICATES_SUBMENU,
CERT_INTEGRATIONS_SUBMENU,
PROJECT_ACCESS_CONTROL_SUBMENU,
- SECRET_SCANNING_SETTINGS_SUBMENU,
SM_SETTINGS_SUBMENU
} from "./submenus";
import { ProjectSubmenuView } from "./SubmenuViews";
@@ -87,8 +86,6 @@ export const ProjectNav = () => {
if (isOnIntegrations && isCertManager) return CERT_INTEGRATIONS_SUBMENU;
if (isOnProjectSettings && currentProject.type === ProjectType.SecretManager)
return SM_SETTINGS_SUBMENU;
- if (isOnProjectSettings && currentProject.type === ProjectType.SecretScanning)
- return SECRET_SCANNING_SETTINGS_SUBMENU;
if (isOnCertPolicies) return CERT_CERTIFICATES_SUBMENU;
if (isOnCertApprovals) return CERT_APPROVALS_SUBMENU;
return null;
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx
index e8e22e2424..a605987277 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SecretScanningNav.tsx
@@ -10,7 +10,7 @@ import { ProjectPermissionSecretScanningFindingActions } from "@app/context/Proj
import { useGetSecretScanningUnresolvedFindingCount } from "@app/hooks/api/secretScanningV2";
import { ProjectNavList } from "./ProjectNavLink";
-import { PROJECT_ACCESS_CONTROL_SUBMENU, SECRET_SCANNING_SETTINGS_SUBMENU } from "./submenus";
+import { PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";
import type { NavItem, Submenu } from "./types";
export const SecretScanningNav = ({
@@ -52,12 +52,7 @@ export const SecretScanningNav = ({
submenu: PROJECT_ACCESS_CONTROL_SUBMENU
},
{ label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },
- {
- label: "Settings",
- icon: Settings,
- pathSuffix: "settings",
- submenu: SECRET_SCANNING_SETTINGS_SUBMENU
- }
+ { label: "Settings", icon: Settings, pathSuffix: "settings" }
];
return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;
};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
index 424937d436..6edf41b314 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
@@ -11,7 +11,6 @@ import {
Lock,
MapPin,
Plug,
- ScanSearch,
Search,
Shield,
Tag,
@@ -117,15 +116,3 @@ export const CERT_INTEGRATIONS_SUBMENU: Submenu = {
{ label: "Certificate Syncs", icon: ArrowLeftRight, tab: "pki-syncs" }
]
};
-
-// --- Secret scanning submenus ---
-
-export const SECRET_SCANNING_SETTINGS_SUBMENU: Submenu = {
- title: "Settings",
- pathSuffix: "settings",
- defaultTab: "general",
- items: [
- { label: "General", icon: Cog, tab: "general" },
- { label: "Scanning Settings", icon: ScanSearch, tab: "scanning-settings" }
- ]
-};
diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
index a68efb5132..4ded20828c 100644
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
@@ -3497,7 +3497,8 @@ const CertificateManagerPermissionSubjects = (enabled = false) => ({
const SecretScanningSubject = (enabled = false) => ({
[ProjectPermissionSub.SecretScanningDataSources]: enabled,
[ProjectPermissionSub.SecretScanningFindings]: enabled,
- [ProjectPermissionSub.SecretScanningConfigs]: enabled
+ // Hidden until the scanning configuration is redesigned; nothing reads it today.
+ [ProjectPermissionSub.SecretScanningConfigs]: false
});
const AgentVaultPermissionSubjects = (enabled = false) => ({
@@ -3769,10 +3770,6 @@ export const RoleTemplates: Record<ProjectType, RoleTemplate[]> = {
{
subject: ProjectPermissionSub.SecretScanningFindings,
actions: [ProjectPermissionSecretScanningFindingActions.Read]
- },
- {
- subject: ProjectPermissionSub.SecretScanningConfigs,
- actions: [ProjectPermissionSecretScanningConfigActions.Read]
}
]
},
@@ -3789,19 +3786,10 @@ export const RoleTemplates: Record<ProjectType, RoleTemplate[]> = {
{
subject: ProjectPermissionSub.SecretScanningFindings,
actions: Object.values(ProjectPermissionSecretScanningFindingActions)
- },
- {
- subject: ProjectPermissionSub.SecretScanningConfigs,
- actions: [ProjectPermissionSecretScanningConfigActions.Read]
}
]
},
- projectManagerTemplate([
- {
- subject: ProjectPermissionSub.SecretScanningConfigs,
- actions: Object.values(ProjectPermissionSecretScanningConfigActions)
- }
- ])
+ projectManagerTemplate()
],
[ProjectType.SecretManager]: [
{
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx b/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx
index a4a039c253..c6d1a8052b 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/SettingsPage.tsx
@@ -1,24 +1,13 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
-import { useSearch } from "@tanstack/react-router";
-import { ProjectPermissionCan } from "@app/components/permissions";
import { PageHeader } from "@app/components/v2";
import { LookingForOrgPageLink } from "@app/components/v3";
-import { ProjectPermissionSub } from "@app/context";
-import { ProjectPermissionSecretScanningConfigActions } from "@app/context/ProjectPermissionContext/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";
-import { ProjectScanningConfigTab } from "./components/ProjectScanningConfigTab";
-
export const SettingsPage = () => {
const { t } = useTranslation();
- const { selectedTab } = useSearch({
- from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/settings"
- });
-
- const activeTab = selectedTab || "general";
return (
<div className="flex h-full w-full justify-center bg-page text-foreground-inverse">
@@ -33,18 +22,7 @@ export const SettingsPage = () => {
>
<LookingForOrgPageLink page="settings" />
</PageHeader>
- <div>
- {activeTab === "general" && <ProjectGeneralTab />}
- {activeTab === "scanning-settings" && (
- <ProjectPermissionCan
- I={ProjectPermissionSecretScanningConfigActions.Read}
- a={ProjectPermissionSub.SecretScanningConfigs}
- renderGuardBanner
- >
- <ProjectScanningConfigTab />
- </ProjectPermissionCan>
- )}
- </div>
+ <ProjectGeneralTab />
</div>
</div>
);
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx
deleted file mode 100644
index ba6b275668..0000000000
--- a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/ProjectScanningConfigTab.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { faBan } from "@fortawesome/free-solid-svg-icons";
-
-import { ContentLoader, EmptyState } from "@app/components/v2";
-import { AccessRestrictedNotice } from "@app/components/v3";
-import { useProject, useSubscription } from "@app/context";
-import { useGetSecretScanningConfig } from "@app/hooks/api/secretScanningV2";
-
-import { SecretScanningConfigForm } from "./SecretScanningConfigForm";
-
-export const ProjectScanningConfigTab = () => {
- const { currentProject } = useProject();
- const { subscription } = useSubscription();
- const { data: config, isPending: isConfigPending } = useGetSecretScanningConfig(
- currentProject.id,
- { enabled: subscription.secretScanning }
- );
-
- if (!subscription.secretScanning) {
- return (
- <AccessRestrictedNotice
- title="Secret Scanning Not Available"
- description="Your current plan doesn't include Secret Scanning. Contact Infisical support or reach out on Slack to enable it."
- />
- );
- }
-
- if (isConfigPending) {
- return (
- <div className="flex h-full w-full items-center justify-center">
- <ContentLoader />
- </div>
- );
- }
-
- if (!config) {
- return (
- <div className="flex h-full w-full items-center justify-center px-20">
- <EmptyState
- className="max-w-2xl rounded-md text-center"
- icon={faBan}
- title="Could not find Project Configuration"
- />
- </div>
- );
- }
-
- return (
- <div>
- <SecretScanningConfigForm config={config} />
- </div>
- );
-};
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
deleted file mode 100644
index e3a0380154..0000000000
--- a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/SecretScanningConfigForm.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { Controller, useForm } from "react-hook-form";
-import { zodResolver } from "@hookform/resolvers/zod";
-import { z } from "zod";
-
-import { createNotification } from "@app/components/notifications";
-import { ProjectPermissionCan } from "@app/components/permissions";
-import { Button, FormControl, TextArea } from "@app/components/v2";
-import { DocumentationLinkBadge } from "@app/components/v3";
-import { ProjectPermissionSub } from "@app/context";
-import { ProjectPermissionSecretScanningConfigActions } from "@app/context/ProjectPermissionContext/types";
-import {
- TSecretScanningConfig,
- useUpdateSecretScanningConfig
-} from "@app/hooks/api/secretScanningV2";
-
-type Props = {
- config: TSecretScanningConfig;
-};
-
-const FormSchema = z.object({
- content: z.string().max(5000, "Configuration cannot exceed 5000 characters").optional()
-});
-
-type FormType = z.infer<typeof FormSchema>;
-
-export const SecretScanningConfigForm = ({ config }: Props) => {
- const updateConfig = useUpdateSecretScanningConfig();
-
- const {
- handleSubmit,
- control,
- formState: { isDirty }
- } = useForm<FormType>({
- resolver: zodResolver(FormSchema),
- defaultValues: {
- content: config.content ?? ""
- }
- });
-
- const onSubmit = async ({ content }: FormType) => {
- await updateConfig.mutateAsync({
- projectId: config.projectId,
- content: content || null
- });
-
- createNotification({
- type: "success",
- text: "Configuration successfully updated"
- });
- };
-
- return (
- <div className="rounded-lg border border-border-control bg-surface-base p-4">
- <div className="mb-4">
- <div className="flex items-center gap-2">
- <h2 className="text-xl font-medium text-foreground">Project Configuration</h2>
- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/secret-scanning/usage#configuration" />
- </div>
- <p className="leading-5 text-muted">Configure rules and exceptions to customize scanning</p>
- </div>
- <div>
- <form onSubmit={handleSubmit(onSubmit)} className="flex w-full flex-col">
- <ProjectPermissionCan
- I={ProjectPermissionSecretScanningConfigActions.Update}
- a={ProjectPermissionSub.SecretScanningConfigs}
- >
- {(isAllowed) => (
- <Controller
- defaultValue=""
- render={({ field, fieldState: { error } }) => (
- <FormControl isError={Boolean(error)} errorText={error?.message}>
- <TextArea
- placeholder={
- "[extend]\n\nuseDefault = true\n\n# See docs for configuration guide"
- }
- {...field}
- rows={3}
- className="min-h-144 thin-scrollbar w-full resize-none! resize-y!"
- isDisabled={!isAllowed}
- />
- </FormControl>
- )}
- control={control}
- name="content"
- />
- )}
- </ProjectPermissionCan>
- <ProjectPermissionCan
- I={ProjectPermissionSecretScanningConfigActions.Update}
- a={ProjectPermissionSub.SecretScanningConfigs}
- >
- {(isAllowed) => (
- <Button
- colorSchema="secondary"
- type="submit"
- className="w-min"
- isLoading={updateConfig.isPending}
- isDisabled={updateConfig.isPending || !isAllowed || !isDirty}
- >
- Save
- </Button>
- )}
- </ProjectPermissionCan>
- </form>
- </div>
- </div>
- );
-};
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/index.tsx b/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/index.tsx
deleted file mode 100644
index 6043a09628..0000000000
--- a/frontend/src/pages/secret-scanning/SettingsPage/components/ProjectScanningConfigTab/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { ProjectScanningConfigTab } from "./ProjectScanningConfigTab";
diff --git a/frontend/src/pages/secret-scanning/SettingsPage/route.tsx b/frontend/src/pages/secret-scanning/SettingsPage/route.tsx
index 14faa12517..b4d4296a39 100644
--- a/frontend/src/pages/secret-scanning/SettingsPage/route.tsx
+++ b/frontend/src/pages/secret-scanning/SettingsPage/route.tsx
@@ -1,18 +1,11 @@
import { createFileRoute } from "@tanstack/react-router";
-import { zodValidator } from "@tanstack/zod-adapter";
-import { z } from "zod";
import { SettingsPage } from "./SettingsPage";
-const settingsPageSearchSchema = z.object({
- selectedTab: z.string().optional().default("general")
-});
-
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/settings"
)({
component: SettingsPage,
- validateSearch: zodValidator(settingsPageSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [