Skip to content

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

Align PAM account settings overrides

bernie-gb3a62422aded
diff --git a/backend/src/db/migrations/20260619144500_pam-account-recording-settings.ts b/backend/src/db/migrations/20260619144500_pam-account-settings-overrides.ts
similarity index 77%
rename from backend/src/db/migrations/20260619144500_pam-account-recording-settings.ts
rename to backend/src/db/migrations/20260619144500_pam-account-settings-overrides.ts
index 98a16e475d..aee337ab1e 100644
--- a/backend/src/db/migrations/20260619144500_pam-account-recording-settings.ts
+++ b/backend/src/db/migrations/20260619144500_pam-account-settings-overrides.ts
@@ -3,19 +3,19 @@ import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
- const hasColumn = await knex.schema.hasColumn(TableName.PamAccount, "recordingSettings");
+ const hasColumn = await knex.schema.hasColumn(TableName.PamAccount, "settingsOverrides");
if (!hasColumn) {
await knex.schema.alterTable(TableName.PamAccount, (t) => {
- t.jsonb("recordingSettings").nullable();
+ t.jsonb("settingsOverrides").nullable();
});
}
}
export async function down(knex: Knex): Promise<void> {
- const hasColumn = await knex.schema.hasColumn(TableName.PamAccount, "recordingSettings");
+ const hasColumn = await knex.schema.hasColumn(TableName.PamAccount, "settingsOverrides");
if (hasColumn) {
await knex.schema.alterTable(TableName.PamAccount, (t) => {
- t.dropColumn("recordingSettings");
+ t.dropColumn("settingsOverrides");
});
}
}
diff --git a/backend/src/db/schemas/pam-accounts.ts b/backend/src/db/schemas/pam-accounts.ts
index 7cbdcc6ec0..82526b857a 100644
--- a/backend/src/db/schemas/pam-accounts.ts
+++ b/backend/src/db/schemas/pam-accounts.ts
@@ -34,7 +34,7 @@ export const PamAccountsSchema = z.object({
gatewayPoolId: z.string().uuid().nullable().optional(),
recordingConnectionId: z.string().uuid().nullable().optional(),
credentialConfigured: z.boolean().default(false),
- recordingSettings: z.unknown().nullable().optional()
+ settingsOverrides: z.unknown().nullable().optional()
});
export type TPamAccounts = z.infer<typeof PamAccountsSchema>;
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
index 2fb464f76e..327703c6af 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
@@ -10,7 +10,7 @@ import {
PamAccountTypeMetadataSchema
} from "@app/ee/services/pam-account/pam-account-schemas";
import {
- PamAccountRecordingSettingsSchema,
+ PamAccountSettingsOverridesSchema,
PamTemplateAccessPolicySchema,
PamTemplateSettingsSchema
} from "@app/ee/services/pam-account-template/pam-account-template-schemas";
@@ -37,7 +37,7 @@ const BaseAccountFields = PamAccountsSchema.pick({
gatewayId: true,
gatewayPoolId: true,
recordingConnectionId: true,
- recordingSettings: true,
+ settingsOverrides: true,
createdAt: true,
updatedAt: true
});
@@ -105,9 +105,9 @@ const registerPerTypeEndpoints = (
gatewayId: z.string().uuid().optional().describe("The ID of the gateway to use"),
gatewayPoolId: z.string().uuid().optional().describe("The ID of the gateway pool to use"),
recordingConnectionId: z.string().uuid().optional().describe("The ID of the recording connection to use"),
- recordingSettings: PamAccountRecordingSettingsSchema.nullable()
+ settingsOverrides: PamAccountSettingsOverridesSchema.nullable()
.optional()
- .describe("Account-level recording S3 config override")
+ .describe("Account-level template settings overrides")
}),
response: {
200: z.object({
@@ -190,9 +190,9 @@ const registerPerTypeEndpoints = (
.nullable()
.optional()
.describe("The ID of the recording connection to use"),
- recordingSettings: PamAccountRecordingSettingsSchema.nullable()
+ settingsOverrides: PamAccountSettingsOverridesSchema.nullable()
.optional()
- .describe("Account-level recording S3 config override")
+ .describe("Account-level template settings overrides")
}),
response: {
200: z.object({
diff --git a/backend/src/ee/services/pam-account-template/pam-account-template-schemas.ts b/backend/src/ee/services/pam-account-template/pam-account-template-schemas.ts
index d327880519..db9a9a6740 100644
--- a/backend/src/ee/services/pam-account-template/pam-account-template-schemas.ts
+++ b/backend/src/ee/services/pam-account-template/pam-account-template-schemas.ts
@@ -19,8 +19,8 @@ export const PamRecordingS3ConfigSchema = z.object({
keyPrefix: z.string().trim().optional()
});
-export const PamAccountRecordingSettingsSchema = z.object({
- s3Config: PamRecordingS3ConfigSchema.optional()
+export const PamAccountSettingsOverridesSchema = z.object({
+ recordingS3Config: PamRecordingS3ConfigSchema.optional()
});
export const PamTemplateSettingsSchema = z.object({
diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.ts
index 60b7925d87..8229617d1a 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -197,7 +197,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
gatewayId: account.gatewayId,
gatewayPoolId: account.gatewayPoolId,
recordingConnectionId: account.recordingConnectionId,
- recordingSettings: account.recordingSettings ?? null,
+ settingsOverrides: account.settingsOverrides ?? null,
connectionDetails,
credentials,
...computeAccessibility(account),
@@ -218,7 +218,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
gatewayId,
gatewayPoolId,
recordingConnectionId,
- recordingSettings,
+ settingsOverrides,
...ctx
}: TCreatePamAccountDTO & TActorContext) => {
const { permission } = await checkFolder(folderId, projectId, ctx);
@@ -256,14 +256,14 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
await validateRecordingConnection(deps, recordingConnectionId, ctx);
let resolvedS3Config = null;
- if (recordingSettings?.s3Config) {
+ if (settingsOverrides?.recordingS3Config) {
const connId = recordingConnectionId ?? template.recordingConnectionId;
if (!connId) {
throw new BadRequestError({
message: "S3 recording config requires an AWS connection on the account or template"
});
}
- resolvedS3Config = await validateRecordingS3Config(deps, connId, recordingSettings.s3Config, ctx);
+ resolvedS3Config = await validateRecordingS3Config(deps, connId, settingsOverrides.recordingS3Config, ctx);
}
const validatedConnectionDetails = validateConnectionDetails(accountType, connectionDetails);
@@ -285,7 +285,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
gatewayId,
gatewayPoolId,
recordingConnectionId,
- recordingSettings: recordingSettings ?? null
+ settingsOverrides: settingsOverrides ?? null
});
const corsProbeUrl = resolvedS3Config ? await mintCorsProbeUrl(resolvedS3Config) : null;
@@ -300,6 +300,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
gatewayId: account.gatewayId,
gatewayPoolId: account.gatewayPoolId,
recordingConnectionId: account.recordingConnectionId,
+ settingsOverrides: account.settingsOverrides ?? null,
createdAt: account.createdAt,
updatedAt: account.updatedAt,
accountType,
@@ -337,7 +338,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
gatewayId,
gatewayPoolId,
recordingConnectionId,
- recordingSettings,
+ settingsOverrides,
...ctx
}: TUpdatePamAccountDTO & TActorContext) => {
const existing = await pamAccountDAL.findByIdWithDetails(accountId);
@@ -376,7 +377,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
await validateRecordingConnection(deps, recordingConnectionId, ctx);
let resolvedS3Config = null;
- if (recordingSettings?.s3Config) {
+ if (settingsOverrides?.recordingS3Config) {
const connId =
(recordingConnectionId !== undefined ? recordingConnectionId : existing.recordingConnectionId) ??
existing.templateRecordingConnectionId;
@@ -385,7 +386,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
message: "S3 recording config requires an AWS connection on the account or template"
});
}
- resolvedS3Config = await validateRecordingS3Config(deps, connId, recordingSettings.s3Config, ctx);
+ resolvedS3Config = await validateRecordingS3Config(deps, connId, settingsOverrides.recordingS3Config, ctx);
}
const updateData: Record<string, unknown> = {};
@@ -396,7 +397,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
if (gatewayId !== undefined) updateData.gatewayId = gatewayId;
if (gatewayPoolId !== undefined) updateData.gatewayPoolId = gatewayPoolId;
if (recordingConnectionId !== undefined) updateData.recordingConnectionId = recordingConnectionId;
- if (recordingSettings !== undefined) updateData.recordingSettings = recordingSettings;
+ if (settingsOverrides !== undefined) updateData.settingsOverrides = settingsOverrides;
if (connectionDetails) {
const validated = validateConnectionDetails(accountType, connectionDetails);
diff --git a/backend/src/ee/services/pam-account/pam-account-types.ts b/backend/src/ee/services/pam-account/pam-account-types.ts
index 1bdf819de0..3586e73064 100644
--- a/backend/src/ee/services/pam-account/pam-account-types.ts
+++ b/backend/src/ee/services/pam-account/pam-account-types.ts
@@ -12,7 +12,7 @@ export type TCreatePamAccountDTO = {
gatewayId?: string;
gatewayPoolId?: string;
recordingConnectionId?: string;
- recordingSettings?: { s3Config?: { bucket: string; region: string; keyPrefix?: string } } | null;
+ settingsOverrides?: { recordingS3Config?: { bucket: string; region: string; keyPrefix?: string } } | null;
};
export type TUpdatePamAccountDTO = {
@@ -28,7 +28,7 @@ export type TUpdatePamAccountDTO = {
gatewayId?: string | null;
gatewayPoolId?: string | null;
recordingConnectionId?: string | null;
- recordingSettings?: { s3Config?: { bucket: string; region: string; keyPrefix?: string } } | null;
+ settingsOverrides?: { recordingS3Config?: { bucket: string; region: string; keyPrefix?: string } } | null;
};
export type TDeletePamAccountDTO = {
diff --git a/backend/src/ee/services/pam-session-recording/pam-recording-chunk-service.ts b/backend/src/ee/services/pam-session-recording/pam-recording-chunk-service.ts
index a6ee7174ba..cfc49f7a50 100644
--- a/backend/src/ee/services/pam-session-recording/pam-recording-chunk-service.ts
+++ b/backend/src/ee/services/pam-session-recording/pam-recording-chunk-service.ts
@@ -63,8 +63,8 @@ export const pamSessionChunkServiceFactory = ({
const templateSettings = templateParsed?.success ? templateParsed.data : null;
if (!templateSettings) return null;
- const accountS3Parsed = account.recordingSettings
- ? PamRecordingS3ConfigSchema.safeParse((account.recordingSettings as Record<string, unknown>).s3Config)
+ const accountS3Parsed = account.settingsOverrides
+ ? PamRecordingS3ConfigSchema.safeParse((account.settingsOverrides as Record<string, unknown>).recordingS3Config)
: null;
const accountS3 = accountS3Parsed?.success ? accountS3Parsed.data : null;
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index a3f95d0c79..fca1443b66 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -63,8 +63,8 @@ export enum PamAccountAccessibilityIssue {
export const accountTypeRequiresRecording = (type: PamAccountType): boolean =>
type === PamAccountType.Windows;
-export type TPamAccountRecordingSettings = {
- s3Config?: { bucket: string; region: string; keyPrefix?: string };
+export type TPamAccountSettingsOverrides = {
+ recordingS3Config?: { bucket: string; region: string; keyPrefix?: string };
};
export type TPamAccount = {
@@ -81,7 +81,7 @@ export type TPamAccount = {
gatewayId: string | null;
gatewayPoolId: string | null;
recordingConnectionId: string | null;
- recordingSettings: TPamAccountRecordingSettings | null;
+ settingsOverrides: TPamAccountSettingsOverrides | null;
connectionDetails: Record<string, unknown>;
// Non-secret credential fields only
credentials: Record<string, unknown>;
@@ -261,7 +261,7 @@ export type TUpdatePamAccountDTO = {
gatewayId?: string | null;
gatewayPoolId?: string | null;
recordingConnectionId?: string | null;
- recordingSettings?: TPamAccountRecordingSettings | null;
+ settingsOverrides?: TPamAccountSettingsOverrides | null;
};
export type TDeletePamAccountDTO = {
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
index b60ef2cb51..b4bf72a0a5 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
@@ -474,7 +474,7 @@ const SettingsTab = ({
useEffect(() => {
if (account) {
- const s3 = account.recordingSettings?.s3Config;
+ const s3 = account.settingsOverrides?.recordingS3Config;
reset({
gatewayId: account.gatewayId,
gatewayPoolId: account.gatewayPoolId,
@@ -551,9 +551,9 @@ const SettingsTab = ({
const region = values.recordingRegion.trim();
const keyPrefix = values.recordingKeyPrefix.trim();
const hasS3Override = Boolean(bucket) || Boolean(region);
- const recordingSettings = hasS3Override
+ const settingsOverrides = hasS3Override
? {
- s3Config: {
+ recordingS3Config: {
bucket,
region,
...(keyPrefix ? { keyPrefix } : {})
@@ -568,7 +568,7 @@ const SettingsTab = ({
gatewayId: values.gatewayId,
gatewayPoolId: values.gatewayPoolId,
recordingConnectionId: values.recordingConnectionId,
- recordingSettings
+ settingsOverrides
},
{
onSuccess: async (result) => {