Skip to content

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

fixed browser RDP access not using s3 bucket and added more guardrails

x03220573b161d902d6
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 a4899ca05b..9381f60573 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -963,10 +963,10 @@ export const pamAccountServiceFactory = ({
if (resourceType === PamResource.Windows) {
const recordingConfig = await pamProjectRecordingConfigDAL.findByProjectId(account.projectId);
- if (!recordingConfig) {
+ if (!recordingConfig || recordingConfig.storageBackend === PamRecordingStorageBackend.Postgres) {
throw new BadRequestError({
message:
- "Windows resources require an external session recording configuration. Configure session recording in project settings before accessing Windows accounts."
+ "Windows resources require an external (S3) session recording configuration. Postgres storage is not supported for RDP sessions. Configure an S3 bucket in project settings before accessing Windows accounts."
});
}
}
@@ -1357,6 +1357,13 @@ export const pamAccountServiceFactory = ({
const projectRecordingConfig = await pamProjectRecordingConfigService.resolveConfigForProject(session.projectId);
const storageBackend = projectRecordingConfig?.backend ?? PamRecordingStorageBackend.Postgres;
+ if (resource.resourceType === PamResource.Windows && storageBackend === PamRecordingStorageBackend.Postgres) {
+ throw new BadRequestError({
+ message:
+ "Windows (RDP) sessions require an external (S3) recording backend. Postgres storage is not supported for RDP recordings."
+ });
+ }
+
const { sessionKey, uploadToken, encryptedSessionKey, uploadTokenHash } = await generateSessionRecordingSecrets({
projectId: session.projectId,
sessionId,
@@ -1379,6 +1386,14 @@ export const pamAccountServiceFactory = ({
} else if (session.status === PamSessionStatus.Active && session.encryptedSessionKey) {
const projectRecordingConfig = await pamProjectRecordingConfigService.resolveConfigForProject(session.projectId);
const storageBackend = projectRecordingConfig?.backend ?? PamRecordingStorageBackend.Postgres;
+
+ if (resource.resourceType === PamResource.Windows && storageBackend === PamRecordingStorageBackend.Postgres) {
+ throw new BadRequestError({
+ message:
+ "Windows (RDP) sessions require an external (S3) recording backend. Postgres storage is not supported for RDP recordings."
+ });
+ }
+
const sessionKey = await decryptSessionKey({
projectId: session.projectId,
sessionId,
diff --git a/backend/src/ee/services/pam-web-access/pam-web-access-service.ts b/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
index 299498d3e5..072bd33061 100644
--- a/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
+++ b/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
@@ -632,10 +632,15 @@ export const pamWebAccessServiceFactory = ({
}
// 7. ACTIVATE SESSION
- await pamSessionDAL.updateById(session.id, {
- status: PamSessionStatus.Active,
- startedAt: new Date()
- });
+ // For RDP (Windows), the gateway calls getSessionCredentials which transitions
+ // Starting -> Active via startSession() and generates recording secrets.
+ // Setting Active here first would prevent recording secrets from being created.
+ if (resource.resourceType !== PamResource.Windows) {
+ await pamSessionDAL.updateById(session.id, {
+ status: PamSessionStatus.Active,
+ startedAt: new Date()
+ });
+ }
logger.info({ accountId, sessionId: session.id }, "Web access session established");