Skip to content

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

Adress Reviews

x0322059d6cf099826b
diff --git a/backend/src/ee/services/pam-project-recording-config/pam-project-recording-config-service.ts b/backend/src/ee/services/pam-project-recording-config/pam-project-recording-config-service.ts
index 6054778934..1cf88e440e 100644
--- a/backend/src/ee/services/pam-project-recording-config/pam-project-recording-config-service.ts
+++ b/backend/src/ee/services/pam-project-recording-config/pam-project-recording-config-service.ts
@@ -200,6 +200,14 @@ export const pamProjectRecordingConfigServiceFactory = ({
const existing = await pamProjectRecordingConfigDAL.findByProjectId(projectId);
if (!existing) return { ok: true as const };
+
+ const activeCount = await pamSessionDAL.countActiveByProjectId(projectId);
+ if (activeCount > 0) {
+ throw new BadRequestError({
+ message: `Cannot disable recording configuration while ${activeCount} session${activeCount > 1 ? "s are" : " is"} in progress. End all active sessions first.`
+ });
+ }
+
await pamProjectRecordingConfigDAL.deleteById(existing.id);
return { ok: true as const };
};
diff --git a/docs/docs.json b/docs/docs.json
index c8703ba396..4e02856d76 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -913,6 +913,7 @@
"documentation/platform/pam/product-reference/account-policies",
"documentation/platform/pam/product-reference/auditing",
"documentation/platform/pam/product-reference/session-recording",
+ "documentation/platform/pam/product-reference/external-storage",
"documentation/platform/pam/product-reference/ai-session-insights",
"documentation/platform/pam/product-reference/credential-rotation",
"documentation/platform/pam/product-reference/view-credentials",
diff --git a/docs/documentation/platform/pam/product-reference/external-storage.mdx b/docs/documentation/platform/pam/product-reference/external-storage.mdx
new file mode 100644
index 0000000000..5a4d5d9add
--- /dev/null
+++ b/docs/documentation/platform/pam/product-reference/external-storage.mdx
@@ -0,0 +1,67 @@
+---
+title: "External Storage"
+sidebarTitle: "External Storage"
+description: "Store PAM session recordings in your own S3 bucket for full control over data residency and retention."
+---
+
+By default, Infisical stores session recordings in its managed database. You can instead point recordings at your own Amazon S3 bucket so that encrypted session data stays in infrastructure you control.
+
+## Prerequisites
+
+Before configuring external storage you need an **AWS Connection** set up in your organization. This connection gives Infisical the credentials it needs to write and read objects in your bucket.
+
+If you don't have one yet, follow the [AWS Connection guide](/integrations/app-connections/aws) to create one. The connection's IAM role must have `s3:PutObject`, `s3:GetObject`, and `s3:HeadObject` permissions on the target bucket.
+
+## Configuring the Bucket
+
+<Steps>
+ <Step title="Navigate to PAM project settings">
+ Open your PAM project, go to **Settings**, then select the **Session Recording** tab.
+ </Step>
+ <Step title="Select the AWS connection and fill in bucket details">
+ Choose your AWS Connection from the dropdown, then enter the bucket name, region, and an optional key prefix. The key prefix is useful when multiple projects share the same bucket.
+ </Step>
+ <Step title="Save the configuration">
+ Click **Save**. Infisical will validate that it can reach the bucket with the provided credentials before persisting the configuration.
+ </Step>
+</Steps>
+
+<Warning>
+Changing the bucket or key prefix on a project that already has recordings makes those recordings inaccessible unless you manually migrate the objects. When rotating credentials, keep the same bucket and key prefix.
+</Warning>
+
+## CORS Configuration
+
+During session playback the browser fetches encrypted chunks directly from S3 using presigned GET URLs. For this to work the bucket needs a CORS policy that allows requests from your Infisical dashboard origin.
+
+Open the bucket in the AWS console, go to **Permissions > Cross-origin resource sharing (CORS)**, and add:
+
+```json
+[
+ {
+ "AllowedHeaders": ["*"],
+ "AllowedMethods": ["GET"],
+ "AllowedOrigins": ["https://app.infisical.com"],
+ "ExposeHeaders": [],
+ "MaxAgeSeconds": 3600
+ }
+]
+```
+
+Replace `https://app.infisical.com` with the origin where your Infisical dashboard is served (for example `https://eu.infisical.com` or `http://localhost:8080` during development). You can list multiple origins if needed.
+
+If CORS is not configured, the config page will show a warning toast after saving and session playback will fail with a network error in the browser console.
+
+## FAQ
+
+<AccordionGroup>
+ <Accordion title="Can I use a bucket in a different AWS account?">
+ Yes, as long as the IAM role in your AWS Connection has cross-account access to the bucket. Configure the bucket policy to allow the role's ARN.
+ </Accordion>
+ <Accordion title="What happens if I disable the external storage configuration?">
+ New sessions will fall back to the managed database. Existing recordings in the bucket remain there but won't be accessible from the dashboard until you reconfigure with the same bucket and key prefix.
+ </Accordion>
+ <Accordion title="Can I share one bucket across multiple projects?">
+ Yes. Use a different key prefix for each project (for example `pam/prod` and `pam/staging`) to keep recordings organized.
+ </Accordion>
+</AccordionGroup>
diff --git a/frontend/src/pages/pam/SettingsPage/components/PamRecordingConfigTab.tsx b/frontend/src/pages/pam/SettingsPage/components/PamRecordingConfigTab.tsx
index bb18a44ec7..68b6298e6c 100644
--- a/frontend/src/pages/pam/SettingsPage/components/PamRecordingConfigTab.tsx
+++ b/frontend/src/pages/pam/SettingsPage/components/PamRecordingConfigTab.tsx
@@ -112,7 +112,7 @@ export const PamRecordingConfigTab = () => {
{
title: "Bucket CORS not configured",
type: "warning",
- text: "Session playback requires the bucket to allow GET requests from this origin. Add a CORS rule for this domain on your S3 bucket."
+ text: "Session playback requires the bucket to allow GET requests from this origin. See the CORS setup guide in the docs."
},
{ autoClose: 10000 }
);
@@ -152,6 +152,25 @@ export const PamRecordingConfigTab = () => {
</AlertDescription>
</Alert>
+ <Alert variant="warning" className="mt-4">
+ <AlertTriangleIcon />
+ <AlertTitle>CORS policy required</AlertTitle>
+ <AlertDescription>
+ <span>
+ Your S3 bucket must have a CORS policy that allows GET requests from this origin for
+ session playback to work.{" "}
+ <a
+ href="https://infisical.com/docs/documentation/platform/pam/product-reference/external-storage#cors-configuration"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline hover:text-warning/80"
+ >
+ View CORS setup guide
+ </a>
+ </span>
+ </AlertDescription>
+ </Alert>
+
<form className="mt-6 space-y-4" onSubmit={onSave}>
<Controller
control={control}