Skip to content

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

misc: added configurable env for enabling/disabling encrypt

Sheen Capadngan90f85152bc18
diff --git a/.env.example b/.env.example
index 8bcb4039d7..9998769da3 100644
--- a/.env.example
+++ b/.env.example
@@ -78,3 +78,5 @@ PLAIN_API_KEY=
PLAIN_WISH_LABEL_IDS=
SSL_CLIENT_CERTIFICATE_HEADER_KEY=
+
+ENABLE_MSSQL_SECRET_ROTATION_ENCRYPT=
diff --git a/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue.ts b/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue.ts
index d21f7674b3..015cce0e5e 100644
--- a/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue.ts
+++ b/backend/src/ee/services/secret-rotation/secret-rotation-queue/secret-rotation-queue.ts
@@ -116,6 +116,7 @@ export const secretRotationQueueFactory = ({
queue.start(QueueName.SecretRotation, async (job) => {
const { rotationId } = job.data;
+ const appCfg = getConfig();
logger.info(`secretRotationQueue.process: [rotationDocument=${rotationId}]`);
const secretRotation = await secretRotationDAL.findById(rotationId);
const rotationProvider = rotationTemplates.find(({ name }) => name === secretRotation?.provider);
@@ -178,7 +179,7 @@ export const secretRotationQueueFactory = ({
const options =
provider.template.client === TDbProviderClients.MsSqlServer
? ({
- encrypt: true,
+ encrypt: appCfg.ENABLE_MSSQL_SECRET_ROTATION_ENCRYPT,
cryptoCredentialsDetails: ca ? { ca } : {}
} as Record<string, unknown>)
: undefined;
diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts
index 60f4b74a93..638f21e5d7 100644
--- a/backend/src/lib/config/env.ts
+++ b/backend/src/lib/config/env.ts
@@ -162,7 +162,8 @@ const envSchema = z
DISABLE_AUDIT_LOG_GENERATION: zodStrBool.default("false"),
SSL_CLIENT_CERTIFICATE_HEADER_KEY: zpStr(z.string().optional()).default("x-ssl-client-cert"),
WORKFLOW_SLACK_CLIENT_ID: zpStr(z.string().optional()),
- WORKFLOW_SLACK_CLIENT_SECRET: zpStr(z.string().optional())
+ WORKFLOW_SLACK_CLIENT_SECRET: zpStr(z.string().optional()),
+ ENABLE_MSSQL_SECRET_ROTATION_ENCRYPT: zodStrBool.default("true")
})
.transform((data) => ({
...data,