Skip to content

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

fix(pam): remove live refresh from session view, restore PAM_SESSION_GET audit log

bernie-gf2ce7973f356
diff --git a/backend/src/ee/routes/v1/pam-session-router.ts b/backend/src/ee/routes/v1/pam-session-router.ts
index 490d148412..7dbdeda51f 100644
--- a/backend/src/ee/routes/v1/pam-session-router.ts
+++ b/backend/src/ee/routes/v1/pam-session-router.ts
@@ -304,6 +304,19 @@ export const registerPamSessionRouter = async (server: FastifyZodProvider) => {
onRequest: verifyAuth([AuthMode.JWT]),
handler: async (req) => {
const response = await server.services.pamSession.getById(req.params.sessionId, req.permission);
+
+ await server.services.auditLog.createAuditLog({
+ ...req.auditLogInfo,
+ orgId: req.permission.orgId,
+ projectId: response.session.projectId,
+ event: {
+ type: EventType.PAM_SESSION_GET,
+ metadata: {
+ sessionId: req.params.sessionId
+ }
+ }
+ });
+
return response;
}
});
diff --git a/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx b/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx
index e7811319f8..e9d2f9ebfa 100644
--- a/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx
+++ b/frontend/src/pages/pam/PamSessionsByIDPage/PamSessionByIDPage.tsx
@@ -29,15 +29,7 @@ const Page = () => {
from: ROUTE_PATHS.Pam.PamSessionByIDPage.id,
select: (el) => el.sessionId
});
- const { data: session } = useGetPamSessionById(sessionId, {
- refetchInterval: (query) => {
- const s = query.state.data;
- return s?.status === PamSessionStatus.Active || s?.status === PamSessionStatus.Starting
- ? 5000
- : false;
- },
- refetchIntervalInBackground: false
- });
+ const { data: session } = useGetPamSessionById(sessionId);
const { currentOrg } = useOrganization();
const { currentProject } = useProject();
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["terminateSession"] as const);
diff --git a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx
index 10397d24e0..38f70645be 100644
--- a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx
+++ b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx
@@ -4,7 +4,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Button } from "@app/components/v2";
import {
PamResourceType,
- PamSessionStatus,
THttpEvent,
TPamCommandLog,
TPamSession,
@@ -21,13 +20,8 @@ type Props = {
};
export const PamSessionLogsSection = ({ session }: Props) => {
- const isActive =
- session.status === PamSessionStatus.Active || session.status === PamSessionStatus.Starting;
-
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isFetching } =
- useInfiniteGetPamSessionLogs(session.id, {
- refetchInterval: isActive ? 5000 : false
- });
+ useInfiniteGetPamSessionLogs(session.id);
const allLogs = data?.pages.flatMap((page) => page.logs) ?? [];