Skip to content

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

feat(project): limit secret scanning to one project per organization

Claudeb9bd1135b5b5
diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.ts
index ebd583ff94..c0b3c28206 100644
--- a/backend/src/services/project/project-service.ts
+++ b/backend/src/services/project/project-service.ts
@@ -304,6 +304,19 @@ export const projectServiceFactory = ({
}
}
+ if (type === ProjectType.SecretScanning) {
+ const [existingSecretScanningProject] = await projectDAL.find(
+ { orgId: organization.id, type: ProjectType.SecretScanning },
+ { limit: 1, tx }
+ );
+
+ if (existingSecretScanningProject) {
+ throw new BadRequestError({
+ message: "Secret Scanning is limited to one project per organization at this time."
+ });
+ }
+ }
+
if (kmsKeyId) {
if (permission.cannot(OrgPermissionActions.Read, OrgPermissionSubjects.Kms)) {
throw new ForbiddenRequestError({ message: "You don't have permission to use this KMS key" });