Skip to content

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

block windows account access if no external bucket configured

x032205cac395597f74
diff --git a/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts b/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts
index d39ff1890b..ab2d50fa3e 100644
--- a/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts
+++ b/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts
@@ -557,6 +557,7 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Redis) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.SSH) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Kubernetes) }),
+ GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Windows) }),
// AWS IAM (no gateway, returns short-lived STS credentials usable by both CLI and console)
z.object({
sessionId: z.string(),
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 aa76aa890c..ef6967114e 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -65,6 +65,7 @@ import { TPamAccountDependenciesDALFactory } from "../pam-discovery/pam-account-
import { TPamDomainDALFactory } from "../pam-domain/pam-domain-dal";
import { PamDomainType } from "../pam-domain/pam-domain-enums";
import { PAM_DOMAIN_FACTORY_MAP } from "../pam-domain/pam-domain-factory";
+import { TPamProjectRecordingConfigDALFactory } from "../pam-project-recording-config/pam-project-recording-config-dal";
import { TPamProjectRecordingConfigServiceFactory } from "../pam-project-recording-config/pam-project-recording-config-service";
import { TPamResourceDALFactory } from "../pam-resource/pam-resource-dal";
import { PamResource } from "../pam-resource/pam-resource-enums";
@@ -125,6 +126,7 @@ type TPamAccountServiceFactoryDep = {
"findByAccountId" | "updateById" | "countByAccountIds"
>;
keyStore: Pick<TKeyStoreFactory, "setItemWithExpiry" | "getItem">;
+ pamProjectRecordingConfigDAL: Pick<TPamProjectRecordingConfigDALFactory, "findByProjectId">;
pamProjectRecordingConfigService: Pick<TPamProjectRecordingConfigServiceFactory, "resolveConfigForProject">;
};
@@ -153,6 +155,7 @@ export const pamAccountServiceFactory = ({
resourceMetadataDAL,
pamAccountDependenciesDAL,
keyStore,
+ pamProjectRecordingConfigDAL,
pamProjectRecordingConfigService
}: TPamAccountServiceFactoryDep) => {
// Helper to resolve account parent (resource or domain)
@@ -890,9 +893,15 @@ export const pamAccountServiceFactory = ({
kmsService
);
- // Temporarily disable access to Windows Server
- if (resourceType === PamResource.Windows)
- throw new BadRequestError({ message: `Windows resources cannot be accessed at this time` });
+ if (resourceType === PamResource.Windows) {
+ const recordingConfig = await pamProjectRecordingConfigDAL.findByProjectId(account.projectId);
+ if (!recordingConfig) {
+ throw new BadRequestError({
+ message:
+ "Windows resources require an external session recording configuration. Configure session recording in project settings before accessing Windows accounts."
+ });
+ }
+ }
const user = await userDAL.findById(actor.id);
if (!user) throw new NotFoundError({ message: `User with ID '${actor.id}' not found` });
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts
index c42640868b..0ec00c5457 100644
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@ -2977,6 +2977,7 @@ export const registerRoutes = async (
resourceMetadataDAL,
pamAccountDependenciesDAL,
keyStore,
+ pamProjectRecordingConfigDAL,
pamProjectRecordingConfigService
});