Skip to content

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

feat(pam-windows): return accountName in session credentials

bernie-g65785f26fc13
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 28504045be..26ae19f78b 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -1312,6 +1312,7 @@ export const pamAccountServiceFactory = ({
credentials: {
...rest,
host: hostname,
+ accountName: account.name,
...decryptedAccount.credentials
},
policyRules,
diff --git a/backend/src/ee/services/pam-resource/windows-server/windows-server-resource-schemas.ts b/backend/src/ee/services/pam-resource/windows-server/windows-server-resource-schemas.ts
index 0e8fefe9d2..0b63032de7 100644
--- a/backend/src/ee/services/pam-resource/windows-server/windows-server-resource-schemas.ts
+++ b/backend/src/ee/services/pam-resource/windows-server/windows-server-resource-schemas.ts
@@ -135,6 +135,10 @@ export const WindowsSessionCredentialsSchema = z
useWinrmHttps: z.boolean(),
winrmRejectUnauthorized: z.boolean(),
winrmCaCert: z.string().optional(),
- winrmTlsServerName: z.string().optional()
+ winrmTlsServerName: z.string().optional(),
+ // Account name from the CLI flag (e.g. --account test). The gateway's
+ // RDP MITM bridge expects the user to type this into their RDP client,
+ // distinct from the actual Windows username injected to the target.
+ accountName: z.string().trim().min(1).max(255)
})
.and(WindowsAccountCredentialsSchema);