Skip to content

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

misc: add requireMfa to accessible

Sheen Capadngan13dacd192d97
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 96503b4753..df8d783b77 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
@@ -411,6 +411,11 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
.boolean()
.describe("Whether this account requires approval before launching a session"),
requireReason: z.boolean().describe("Whether the account's template requires a reason for access"),
+ requireMfa: z
+ .boolean()
+ .describe(
+ "Whether launching a session for this account requires MFA verification. Machine identities cannot satisfy MFA, so launch is rejected for them when this is true."
+ ),
accessStatus: z.nativeEnum(PamAccessStatus).describe("Current approval status for the caller"),
grantExpiresAt: z.date().nullable().describe("When the current grant expires, if granted"),
disabledReason: z.string().nullable().describe("Why this account is disabled, or null if usable")
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 af19256c49..b87482a420 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -872,7 +872,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
return {
accounts: accounts.map((a) => {
- const { requiresApproval, requireReason } = resolveAccessControls(a.templatePolicies);
+ const { requiresApproval, requireReason, requireMfa } = resolveAccessControls(a.templatePolicies);
const statusEntry = accessStatusMap.get(a.id);
const hasPolicyConfigured = a.folderId ? foldersWithApprovalPolicy.has(a.folderId) : false;
let disabledReason: string | null = null;
@@ -893,6 +893,9 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
canLaunch: launchAccountIds.has(a.id) || (!!a.folderId && launchFolderIds.has(a.folderId)),
requiresApproval,
requireReason,
+ // Machine identities cannot satisfy MFA, so launch rejects them outright (see
+ // pam-session-service). Callers acting as an identity should treat this as unusable.
+ requireMfa,
accessStatus: requiresApproval ? (statusEntry?.accessStatus ?? PamAccessStatus.None) : PamAccessStatus.None,
grantExpiresAt: statusEntry?.grantExpiresAt ?? null,
disabledReason,