Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
update symbols
Matheus Nogueira718cc18b9a46
diff --git a/backend/src/keystore/keystore.ts b/backend/src/keystore/keystore.tsindex cd7e5f6a4b..3b0118c256 100644--- a/backend/src/keystore/keystore.ts+++ b/backend/src/keystore/keystore.ts@@ -41,7 +41,7 @@ export const PgSqlLock = {AuditReportRequest: (projectId: string) => pgAdvisoryLockHashText(`audit-report-request:${projectId}`),OrgAuditReportRequest: (orgId: string) => pgAdvisoryLockHashText(`audit-report-request:org:${orgId}`),OrgAgentProxyConfigInit: (orgId: string) => pgAdvisoryLockHashText(`org-agent-proxy-config-init:${orgId}`),- SecretValueUniqueCheck: (projectId: string) => pgAdvisoryLockHashText(`secret-value-unique-check:${projectId}`)+ SecretValueReuseCheck: (projectId: string) => pgAdvisoryLockHashText(`secret-value-reuse-check:${projectId}`)} as const;// all the key prefixes used must be set here to avoid conflictdiff --git a/backend/src/server/plugins/secret-scanner-v2.ts b/backend/src/server/plugins/secret-scanner-v2.tsindex 75f4e17e91..3c0813be32 100644--- a/backend/src/server/plugins/secret-scanner-v2.ts+++ b/backend/src/server/plugins/secret-scanner-v2.ts@@ -43,6 +43,8 @@ export const registerSecretScanningV2Webhooks = async (server: FastifyZodProvidesecret: appCfg.INF_APP_CONNECTION_GITHUB_RADAR_APP_WEBHOOK_SECRET as string});+ await probot.load(probotApp);+// github push event webhookserver.route({method: "POST",diff --git a/backend/src/services/secret-validation-rule/secret-validation-rule-constraint-fns.ts b/backend/src/services/secret-validation-rule/secret-validation-rule-constraint-fns.tsindex 004498114f..564c0f5296 100644--- a/backend/src/services/secret-validation-rule/secret-validation-rule-constraint-fns.ts+++ b/backend/src/services/secret-validation-rule/secret-validation-rule-constraint-fns.ts@@ -11,7 +11,7 @@ export const CONSTRAINT_LABELS: Record<ConstraintKind, string> = {[ConstraintKind.RequiredPrefix]: "Required prefix",[ConstraintKind.RequiredSuffix]: "Required suffix",[ConstraintKind.ReusePreviousVersions]: "Prevent reuse of previous secret values",- [ConstraintKind.ReuseOtherSecrets]: "Prevent reuse of a value another secret already holds"+ [ConstraintKind.ReuseOtherSecretsInScope]: "Prevent reuse of a value another secret in scope already holds"};export type TConstraintViolation = {diff --git a/backend/src/services/secret-validation-rule/secret-validation-rule-enums.ts b/backend/src/services/secret-validation-rule/secret-validation-rule-enums.tsindex 9c685fdadd..5aa8912d5c 100644--- a/backend/src/services/secret-validation-rule/secret-validation-rule-enums.ts+++ b/backend/src/services/secret-validation-rule/secret-validation-rule-enums.ts@@ -11,7 +11,7 @@ export enum ConstraintKind {RequiredPrefix = "required-prefix",RequiredSuffix = "required-suffix",ReusePreviousVersions = "reuse-previous-versions",- ReuseOtherSecrets = "reuse-other-secrets"+ ReuseOtherSecretsInScope = "reuse-other-secrets-in-scope"}export enum ConstraintTarget {diff --git a/backend/src/services/secret-validation-rule/secret-validation-rule-fns.ts b/backend/src/services/secret-validation-rule/secret-validation-rule-fns.tsindex 7b81170fac..c5f52b7029 100644--- a/backend/src/services/secret-validation-rule/secret-validation-rule-fns.ts+++ b/backend/src/services/secret-validation-rule/secret-validation-rule-fns.ts@@ -141,7 +141,7 @@ export type TRuleToEnforce = {config: TStaticSecretsRuleConfig;};-/** Whether a rule scoped to `rulePath` reaches a secret sitting at `secretPath`. */+// Whether a rule scoped to `rulePath` reaches a secret sitting at `secretPath`export const doesRulePathCover = (rulePath: string, secretPath: string) =>picomatch.isMatch(secretPath, rulePath, { strictSlashes: false });diff --git a/backend/src/services/secret-validation-rule/secret-validation-rule-service.ts b/backend/src/services/secret-validation-rule/secret-validation-rule-service.tsindex 12bc10ba69..66d69fa692 100644--- a/backend/src/services/secret-validation-rule/secret-validation-rule-service.ts+++ b/backend/src/services/secret-validation-rule/secret-validation-rule-service.ts@@ -52,7 +52,7 @@ import {import { TDuplicateSecret, TStaticSecretsRuleConfig } from "./static-secrets";/** Only static-secret rules can ask for a value no other secret already holds. */-const $wantsCrossSecretUniqueness = (config: TSecretValidationRuleConfig) =>+const $preventsReuseAcrossSecrets = (config: TSecretValidationRuleConfig) =>Boolean((config as TStaticSecretsRuleConfig).valueConstraints?.reusePrevention?.otherSecretsInScope);type TSecretValidationRuleServiceFactoryDep = {@@ -108,7 +108,6 @@ export const secretValidationRuleServiceFactory = ({}};- // Pass `tx` from inside a transaction: without it the key lookup checks out a second connection.const $getCipher = (projectId: string, tx?: Knex) =>kmsService.createCipherPairWithDataKey({ type: KmsDataKey.SecretManager, projectId }, tx);@@ -201,9 +200,9 @@ export const secretValidationRuleServiceFactory = ({);};- // Cross-secret uniqueness is answered from the blind index, so a project without one cannot enforce it.+ // Reuse across secrets is answered from the blind index, so a project without one cannot enforce it.const $assertBlindIndexingAvailable = async (projectId: string, config: TSecretValidationRuleConfig) => {- if (!$wantsCrossSecretUniqueness(config)) return;+ if (!$preventsReuseAcrossSecrets(config)) return;const project = await projectDAL.findById(projectId);if (!project.secretBlindIndexEnabled) {@@ -428,7 +427,7 @@ export const secretValidationRuleServiceFactory = ({// Two writes of the same value would each find no duplicate and both land. The lock makes this// check and the write that follows it atomic, so the second one sees the first.- if (tx) await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.SecretValueUniqueCheck(projectId)]);+ if (tx) await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.SecretValueReuseCheck(projectId)]);const blindIndexes = await Promise.all(candidates.map((secret) => generateSecretBlindIndex(Buffer.from(secret.value)))@@ -548,16 +547,16 @@ export const secretValidationRuleServiceFactory = ({});}- // Only one covering rule can ask for cross-secret uniqueness; overlap is rejected at save time.- const uniquenessRule = coveringRules.find((rule) => $wantsCrossSecretUniqueness(rule.config));- const duplicates = uniquenessRule+ // Only one covering rule can ask for reuse prevention across secrets; overlap is rejected at save time.+ const reuseAcrossSecretsRule = coveringRules.find((rule) => $preventsReuseAcrossSecrets(rule.config));+ const duplicates = reuseAcrossSecretsRule? await $findDuplicatesInScope({projectId,environment,secretPath,secrets,- scope: uniquenessRule.scope,+ scope: reuseAcrossSecretsRule.scope,canAccessLocation,generateSecretBlindIndex},diff --git a/backend/src/services/secret-validation-rule/secret-validation-rule-types.ts b/backend/src/services/secret-validation-rule/secret-validation-rule-types.tsindex 4d85a3ed3e..95838648fd 100644--- a/backend/src/services/secret-validation-rule/secret-validation-rule-types.ts+++ b/backend/src/services/secret-validation-rule/secret-validation-rule-types.ts@@ -129,10 +129,8 @@ export type TValidateSecretsDTO = {envId: string;secretPath: string;secrets: TSecretToValidate[];- /**- * Whether the writer may read a location a duplicate value was found in. Without it the violation- * would name a secret they cannot see, telling them where a value they hold is also used.- */+ // Whether the writer may read a location a duplicate value was found in. Without it the violation+ // would name a secret they cannot see, telling them where a value they hold is also used.canAccessLocation?: (environment: string, secretPath: string) => boolean;};diff --git a/backend/src/services/secret-validation-rule/static-secrets/static-secrets-rule-fns.ts b/backend/src/services/secret-validation-rule/static-secrets/static-secrets-rule-fns.tsindex f915222a79..cf077f5908 100644--- a/backend/src/services/secret-validation-rule/static-secrets/static-secrets-rule-fns.ts+++ b/backend/src/services/secret-validation-rule/static-secrets/static-secrets-rule-fns.ts@@ -2,12 +2,12 @@ import { CONSTRAINT_LABELS, evaluateConstraints, TConstraintViolation } from "..import { ConstraintKind, ConstraintTarget } from "../secret-validation-rule-enums";import { TStaticSecretsRuleConfig } from "./static-secrets-rule-types";-/** Where a value that another secret already holds was found, once the service has looked it up. */+// Where a value that another secret already holds was found, once the service has looked it up.export type TDuplicateSecret = {key: string;environment: string;secretPath: string;- /** Set when the writer cannot read the location, so the message has to stay vague. */+ // Set when the writer cannot read the location, so the message has to stay vague.hidden?: boolean;};@@ -53,8 +53,8 @@ export const evaluateStaticSecretConstraints = (const { duplicateOf } = secret;if (config.valueConstraints.reusePrevention?.otherSecretsInScope && duplicateOf) {violations.push({- kind: ConstraintKind.ReuseOtherSecrets,- label: CONSTRAINT_LABELS[ConstraintKind.ReuseOtherSecrets],+ kind: ConstraintKind.ReuseOtherSecretsInScope,+ label: CONSTRAINT_LABELS[ConstraintKind.ReuseOtherSecretsInScope],// Naming a secret the writer cannot read would leak where a value they do know is also used.message: duplicateOf.hidden? "value is already used by another secret in this project"