Skip to content

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

misc reviews

Andrey7a41216dce5a
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts
index e7b45b501b..1f8ae3df9c 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-approval-configuration-router.ts
@@ -55,7 +55,7 @@ export const registerPamApprovalConfigurationRouter = async (server: FastifyZodP
})
),
notificationConfigs: z.array(NotificationConfigResponseSchema),
- breakGlassApprovers: z.array(ApproverSchema)
+ breakGlassUsers: z.array(ApproverSchema)
})
}
},
@@ -84,11 +84,13 @@ export const registerPamApprovalConfigurationRouter = async (server: FastifyZodP
body: z.object({
steps: z.array(StepSchema).max(1),
notificationConfigs: z.array(NotificationConfigSchema).max(10).optional(),
- breakGlassApprovers: z
+ breakGlassUsers: z
.array(ApproverSchema)
.max(20)
.optional()
- .describe("Users and groups allowed to self-approve their own request. Omitted or empty means nobody.")
+ .describe(
+ "Users and groups allowed to grant themselves access without an approver. Omitted leaves the stored list unchanged; an empty array clears it."
+ )
}),
response: {
200: z.object({
@@ -103,7 +105,7 @@ export const registerPamApprovalConfigurationRouter = async (server: FastifyZodP
projectId: req.internalPamProjectId,
steps: req.body.steps,
notificationConfigs: req.body.notificationConfigs,
- breakGlassApprovers: req.body.breakGlassApprovers,
+ breakGlassUsers: req.body.breakGlassUsers,
actorId: req.permission.id,
actor: req.permission.type,
actorOrgId: req.permission.orgId,
@@ -121,7 +123,7 @@ export const registerPamApprovalConfigurationRouter = async (server: FastifyZodP
policyId: result.policyId,
stepCount: result.stepCount,
notificationConfigCount: result.notificationConfigCount,
- breakGlassApproverCount: result.breakGlassApproverCount
+ breakGlassUserCount: result.breakGlassUserCount
}
}
});
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index 3f3b6600d5..b13eece376 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -6183,7 +6183,7 @@ interface PamApprovalConfigUpdateEvent {
policyId: string | null;
stepCount: number;
notificationConfigCount?: number;
- breakGlassApproverCount?: number;
+ breakGlassUserCount?: number;
};
}
diff --git a/backend/src/ee/services/pam-access-request/pam-access-request-service.ts b/backend/src/ee/services/pam-access-request/pam-access-request-service.ts
index 13e838e671..92158233b8 100644
--- a/backend/src/ee/services/pam-access-request/pam-access-request-service.ts
+++ b/backend/src/ee/services/pam-access-request/pam-access-request-service.ts
@@ -207,7 +207,7 @@ export const pamAccessRequestServiceFactory = ({
return policy ?? null;
};
- const isFolderBreakGlassApprover = async (
+ const isFolderBreakGlassUser = async (
policyId: string,
userId: string,
userGroupIds: Set<string>
@@ -491,18 +491,18 @@ export const pamAccessRequestServiceFactory = ({
const policy = await findFolderPolicy(folderId);
if (!policy) {
- return { steps: [], notificationConfigs, breakGlassApprovers: [] };
+ return { steps: [], notificationConfigs, breakGlassUsers: [] };
}
// The policy row and step tuning fields are internal; the UI only needs the approver lists.
- const [steps, breakGlassApprovers] = await Promise.all([
+ const [steps, breakGlassUsers] = await Promise.all([
approvalPolicyDAL.findStepsByPolicyId(policy.id),
approvalPolicyDAL.findBypassersByPolicyId(policy.id)
]);
return {
steps: steps.map((s) => ({ approvers: s.approvers })),
notificationConfigs,
- breakGlassApprovers: breakGlassApprovers.map((b) => ({ type: b.type, id: b.id }))
+ breakGlassUsers: breakGlassUsers.map((b) => ({ type: b.type, id: b.id }))
};
};
@@ -511,7 +511,7 @@ export const pamAccessRequestServiceFactory = ({
projectId,
steps,
notificationConfigs,
- breakGlassApprovers,
+ breakGlassUsers,
...ctx
}: TSetApprovalConfigurationDTO) => {
await verifyProductMembership(permissionService, projectId, ctx);
@@ -521,13 +521,13 @@ export const pamAccessRequestServiceFactory = ({
throw new BadRequestError({ message: "Phase 1 only supports a single approval step" });
}
- // Approvers and break-glass approvers must be active members of the folder. This keeps both lists in
+ // Approvers and break-glass users must be active members of the folder. This keeps both lists in
// sync with membership so that removing someone from the folder (which strips their approver rows)
// can't be circumvented by designating a non-member or expired member.
const requestedApprovers = steps.flatMap((s) => s.approvers);
- const managesBreakGlass = breakGlassApprovers !== undefined;
- const requestedBreakGlassApprovers = breakGlassApprovers ?? [];
- if (requestedApprovers.length > 0 || requestedBreakGlassApprovers.length > 0) {
+ const managesBreakGlass = breakGlassUsers !== undefined;
+ const requestedBreakGlassUsers = breakGlassUsers ?? [];
+ if (requestedApprovers.length > 0 || requestedBreakGlassUsers.length > 0) {
const memberships = await findActiveFolderMemberships(projectId, folderId);
const memberUserIds = new Set(memberships.map((m) => m.actorUserId).filter(Boolean));
const memberGroupIds = new Set(memberships.map((m) => m.actorGroupId).filter(Boolean));
@@ -540,27 +540,25 @@ export const pamAccessRequestServiceFactory = ({
}
}
- for (const bypasser of requestedBreakGlassApprovers) {
+ for (const bypasser of requestedBreakGlassUsers) {
if (!isFolderMember(bypasser)) {
- throw new BadRequestError({ message: "Break-glass approvers must be members of the folder" });
+ throw new BadRequestError({ message: "Break-glass users must be members of the folder" });
}
}
}
- const dedupedBreakGlassApprovers = [
- ...new Map(requestedBreakGlassApprovers.map((b) => [`${b.type}:${b.id}`, b])).values()
- ];
+ const dedupedBreakGlassUsers = [...new Map(requestedBreakGlassUsers.map((b) => [`${b.type}:${b.id}`, b])).values()];
- if (dedupedBreakGlassApprovers.length > 0 && requestedApprovers.length === 0) {
+ if (dedupedBreakGlassUsers.length > 0 && requestedApprovers.length === 0) {
throw new BadRequestError({
- message: "Break-glass approvers can only be configured on a folder that has approvers"
+ message: "Break-glass users can only be configured on a folder that has approvers"
});
}
- const replaceBreakGlassApprovers = async (policyId: string, tx: Knex) => {
+ const replaceBreakGlassUsers = async (policyId: string, tx: Knex) => {
if (!managesBreakGlass) return;
await approvalPolicyBypassersDAL.delete({ policyId }, tx);
- for (const bypasser of dedupedBreakGlassApprovers) {
+ for (const bypasser of dedupedBreakGlassUsers) {
// eslint-disable-next-line no-await-in-loop
await approvalPolicyBypassersDAL.create(
{
@@ -633,12 +631,12 @@ export const pamAccessRequestServiceFactory = ({
folderId,
stepCount: steps.length,
notificationConfigCount,
- breakGlassApproverCount: 0
+ breakGlassUserCount: 0
};
}
if (!hasApprovers) {
- return { policyId: null, folderId, stepCount: 0, notificationConfigCount, breakGlassApproverCount: 0 };
+ return { policyId: null, folderId, stepCount: 0, notificationConfigCount, breakGlassUserCount: 0 };
}
if (existingPolicy) {
@@ -670,7 +668,7 @@ export const pamAccessRequestServiceFactory = ({
}
}
- await replaceBreakGlassApprovers(existingPolicy.id, tx);
+ await replaceBreakGlassUsers(existingPolicy.id, tx);
});
return {
@@ -678,7 +676,7 @@ export const pamAccessRequestServiceFactory = ({
folderId,
stepCount: steps.length,
notificationConfigCount,
- breakGlassApproverCount: managesBreakGlass ? dedupedBreakGlassApprovers.length : undefined
+ breakGlassUserCount: managesBreakGlass ? dedupedBreakGlassUsers.length : undefined
};
}
@@ -723,7 +721,7 @@ export const pamAccessRequestServiceFactory = ({
}
}
- await replaceBreakGlassApprovers(policy.id, tx);
+ await replaceBreakGlassUsers(policy.id, tx);
return policy;
});
@@ -733,7 +731,7 @@ export const pamAccessRequestServiceFactory = ({
folderId,
stepCount: steps.length,
notificationConfigCount,
- breakGlassApproverCount: managesBreakGlass ? dedupedBreakGlassApprovers.length : undefined
+ breakGlassUserCount: managesBreakGlass ? dedupedBreakGlassUsers.length : undefined
};
};
@@ -883,9 +881,9 @@ export const pamAccessRequestServiceFactory = ({
}
const userGroupIds = await getUserGroupIds(ctx.actorId, ctx.actorOrgId);
- if (!(await isFolderBreakGlassApprover(policy.id, ctx.actorId, userGroupIds))) {
+ if (!(await isFolderBreakGlassUser(policy.id, ctx.actorId, userGroupIds))) {
throw new ForbiddenRequestError({
- message: "You are not a break-glass approver for this folder"
+ message: "You are not a break-glass user for this folder"
});
}
@@ -2005,9 +2003,9 @@ export const pamAccessRequestServiceFactory = ({
return new Set(scopeIds);
};
- // Of the given folders, the ones where this actor is a named break-glass approver. Drives whether the
+ // Of the given folders, the ones where this actor is a named break-glass user. Drives whether the
// account list offers the break-glass action at all.
- const getBreakGlassApproverFolders = async (
+ const getBreakGlassUserFolders = async (
folderIds: string[],
actorCtx: TAccessRequestActor,
orgId: string
@@ -2155,7 +2153,7 @@ export const pamAccessRequestServiceFactory = ({
checkGrant,
getAccessStatusBatch,
getFolderPolicyConfigured,
- getBreakGlassApproverFolders,
+ getBreakGlassUserFolders,
cleanupFolderResources,
cleanupAccountResources
};
diff --git a/backend/src/ee/services/pam-access-request/pam-access-request-types.ts b/backend/src/ee/services/pam-access-request/pam-access-request-types.ts
index 5ae14196d0..0c80497abd 100644
--- a/backend/src/ee/services/pam-access-request/pam-access-request-types.ts
+++ b/backend/src/ee/services/pam-access-request/pam-access-request-types.ts
@@ -23,7 +23,7 @@ export type TSetApprovalConfigurationDTO = {
}[];
// undefined leaves existing configs unchanged so older clients that only manage steps can't wipe them
notificationConfigs?: TPamNotificationConfigInput[];
- breakGlassApprovers?: { type: ApproverType; id: string }[];
+ breakGlassUsers?: { type: ApproverType; id: string }[];
} & TActorContext;
export type TBreakGlassAccessRequestDTO = {
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 e063b44b9b..4147a55afe 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -112,7 +112,7 @@ type TPamAccountServiceFactoryDep = {
TPamAccessRequestServiceFactory,
| "getAccessStatusBatch"
| "getFolderPolicyConfigured"
- | "getBreakGlassApproverFolders"
+ | "getBreakGlassUserFolders"
| "cleanupAccountResources"
| "checkGrant"
>;
@@ -282,7 +282,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
PamAccessType.Credential
),
deps.pamAccessRequestService.getFolderPolicyConfigured(folderIdsRequiringApproval),
- deps.pamAccessRequestService.getBreakGlassApproverFolders(
+ deps.pamAccessRequestService.getBreakGlassUserFolders(
folderIdsRequiringApproval,
{ actorId: ctx.actorId, actor: ctx.actor },
ctx.actorOrgId
@@ -1112,7 +1112,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
projectId
),
deps.pamAccessRequestService.getFolderPolicyConfigured(folderIdsRequiringApproval),
- deps.pamAccessRequestService.getBreakGlassApproverFolders(
+ deps.pamAccessRequestService.getBreakGlassUserFolders(
folderIdsRequiringApproval,
{ actorId: ctx.actorId, actor: ctx.actor },
ctx.actorOrgId
diff --git a/backend/src/ee/services/pam/CLAUDE.md b/backend/src/ee/services/pam/CLAUDE.md
index dc0c16cb4e..dd43b886e2 100644
--- a/backend/src/ee/services/pam/CLAUDE.md
+++ b/backend/src/ee/services/pam/CLAUDE.md
@@ -143,7 +143,7 @@ the account's template carries `allow-break-glass`, *and* the folder's approval
the shared `approval-policy-service` treats an empty list as everybody, which is the opposite rule, so do
not reuse its predicate. `allow-break-glass` resolves to false without `requires-approval`, since there is
then no approval to skip. Saving the folder config keeps the policy's `enforcementLevel` in step with the
-list (`soft` when non-empty), and omitting `breakGlassApprovers` entirely leaves the stored list alone so a
+list (`soft` when non-empty), and omitting `breakGlassUsers` entirely leaves the stored list alone so a
steps-only client can't switch break-glass off by accident. The grant records `isBreakGlass` +
`bypassReason`, and `PAM_ACCESS_POLICY_BYPASSED` must carry `accountId`/`folderId` or the event is hidden
from folder and account auditors (see the audit-log gotcha under Permissions).
diff --git a/backend/src/ee/services/pam/pam-policies.ts b/backend/src/ee/services/pam/pam-policies.ts
index 00ed3d7711..c20892d90d 100644
--- a/backend/src/ee/services/pam/pam-policies.ts
+++ b/backend/src/ee/services/pam/pam-policies.ts
@@ -74,7 +74,7 @@ export const PAM_POLICY_DEFINITIONS: Record<PamPolicyType, TPamPolicyDefinition>
[PamPolicyType.AllowBreakGlass]: {
label: "Allow Break-Glass",
description:
- "Designated break-glass users may self-approve their own request in an emergency. Has no effect until a folder admin names them under the folder's Approvals tab.",
+ "Designated break-glass users can grant themselves access in an emergency, without an approver. Has no effect until a folder admin names them under the folder's Approvals tab.",
appliesTo: "all",
schema: z.boolean()
},
diff --git a/docs/documentation/platform/pam/access-requests/overview.mdx b/docs/documentation/platform/pam/access-requests/overview.mdx
index 09699adfd3..1ec04ac65c 100644
--- a/docs/documentation/platform/pam/access-requests/overview.mdx
+++ b/docs/documentation/platform/pam/access-requests/overview.mdx
@@ -115,7 +115,7 @@ It grants no standing access. The responder still files a request, still gives a
Break-glass needs two switches on, and a different person owns each one:
- The **Product Admin** turns on **Allow Break-Glass** on the [template](/documentation/platform/pam/templates/overview). This sets which accounts can ever be broken into.
-- The **Folder Admin** names the break-glass approvers on the folder's **Approvals** tab. This sets who can do it.
+- The **Folder Admin** names the break-glass users on the folder's **Approvals** tab. This sets who can do it.
An empty break-glass list means nobody, not everybody, so the template policy on its own changes nothing until a Folder Admin names someone.
@@ -126,7 +126,7 @@ An empty break-glass list means nobody, not everybody, so the template policy on
```mermaid
graph TD
T["Product Admin<br/>turns on Allow Break-Glass<br/>on the template"]
- F["Folder Admin<br/>names break-glass approvers<br/>on the Approvals tab"]
+ F["Folder Admin<br/>names break-glass users<br/>on the Approvals tab"]
B["Responder can break glass"]
T --> B
@@ -140,9 +140,9 @@ graph TD
Go to **Privileged Access Management → Account Templates**, open the template, and turn on **Allow Break-Glass** alongside **Require Approval**.
</Step>
<Step title="Name the responders (Folder Admin)">
- Open the folder, go to its **Approvals** tab, and add users or groups under **Break-Glass Approvers**.
+ Open the folder, go to its **Approvals** tab, and add users or groups under **Break-Glass Users**.
- Break-glass approvers must be members of the folder, same as ordinary approvers, so the picker only offers people who already belong to it. Keep the list to your on-call responders rather than everyone who might need the account.
+ Break-glass users must be members of the folder, same as ordinary approvers, so the picker only offers people who already belong to it. Keep the list to your on-call responders rather than everyone who might need the account.
</Step>
</Steps>
@@ -164,7 +164,7 @@ Every use of break-glass:
- Notifies them in the app
- Posts to the folder's Slack channels, if you've configured notifications on the folder
- Writes a **PAM Access Policy Bypassed** entry to the [audit log](/documentation/platform/pam/auditing) with the reason, the account, the folder, and how many approvers were skipped
-- Marks the request with a **Break-glass** badge, in the folder's request history and in the approver's own queue
+- Marks the request with a **Break-glass** badge in the folder's request history
The badge and the audit entry are permanent.
diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsx
index cfcf88bd70..2d8c1181e2 100644
--- a/frontend/src/hooks/api/pam/mutations.tsx
+++ b/frontend/src/hooks/api/pam/mutations.tsx
@@ -865,11 +865,11 @@ export const useSetPamApprovalConfig = () => {
folderId,
steps,
notificationConfigs,
- breakGlassApprovers
+ breakGlassUsers
}: TSetPamApprovalConfigDTO) => {
const { data } = await apiRequest.put(
`/api/v1/pam/folders/${folderId}/approval-configuration`,
- { steps, notificationConfigs, breakGlassApprovers }
+ { steps, notificationConfigs, breakGlassUsers }
);
return data;
},
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index b3ebde9e4e..50758f69e4 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -739,7 +739,7 @@ export type TPamApprovalConfig = {
integration: string;
integrationSlug: string;
})[];
- breakGlassApprovers: { type: PamApproverType; id: string }[];
+ breakGlassUsers: { type: PamApproverType; id: string }[];
};
export type TPamAccessGrant = {
@@ -785,5 +785,5 @@ export type TSetPamApprovalConfigDTO = {
approvers: { type: PamApproverType; id: string }[];
}[];
notificationConfigs?: TPamNotificationConfig[];
- breakGlassApprovers?: { type: PamApproverType; id: string }[];
+ breakGlassUsers?: { type: PamApproverType; id: string }[];
};
diff --git a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
index 984d492c61..c6e0decae5 100644
--- a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
@@ -454,6 +454,10 @@ export const PamAccountsPage = () => {
onOpenChange={(open) => {
if (!open) setRequestAccount(null);
}}
+ onGranted={(account, grantedAccessType) => {
+ if (grantedAccessType === PamAccessType.Credential) setCredentialAccount(account);
+ else setLaunchAccount(account);
+ }}
/>
<ViewCredentialsModal
diff --git a/frontend/src/pages/pam/PamAccountsPage/PamFolderPage/PamFolderPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamFolderPage/PamFolderPage.tsx
index 3ad92007f2..f3ad1d0bf7 100644
--- a/frontend/src/pages/pam/PamAccountsPage/PamFolderPage/PamFolderPage.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/PamFolderPage/PamFolderPage.tsx
@@ -472,6 +472,10 @@ export const PamFolderPage = () => {
onOpenChange={(open) => {
if (!open) setRequestAccount(null);
}}
+ onGranted={(account, grantedAccessType) => {
+ if (grantedAccessType === PamAccessType.Credential) setCredentialAccount(account);
+ else setLaunchAccount(account);
+ }}
/>
<ViewCredentialsModal
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
index f350ee59e5..9b0b859093 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
@@ -144,7 +144,7 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
};
const [approvers, setApprovers] = useState<ApproverEntry[]>([]);
- const [breakGlassApprovers, setBreakGlassApprovers] = useState<ApproverEntry[]>([]);
+ const [breakGlassUsers, setBreakGlassApprovers] = useState<ApproverEntry[]>([]);
const [isDirty, setIsDirty] = useState(false);
const [notificationConfigs, setNotificationConfigs] = useState<TPamNotificationConfig[]>([]);
@@ -153,8 +153,8 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
return config.steps[0].approvers.map((a) => ({ type: a.type, id: a.id }));
}, [config]);
- const savedBreakGlassApprovers = useMemo(
- () => (config?.breakGlassApprovers ?? []).map((a) => ({ type: a.type, id: a.id })),
+ const savedBreakGlassUsers = useMemo(
+ () => (config?.breakGlassUsers ?? []).map((a) => ({ type: a.type, id: a.id })),
[config]
);
@@ -182,8 +182,8 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
}, [savedApprovers]);
useEffect(() => {
- setBreakGlassApprovers(savedBreakGlassApprovers);
- }, [savedBreakGlassApprovers]);
+ setBreakGlassApprovers(savedBreakGlassUsers);
+ }, [savedBreakGlassUsers]);
useEffect(() => {
setNotificationConfigs(savedNotificationConfigs);
@@ -194,8 +194,8 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
[notificationConfigs, savedNotificationConfigs]
);
const isBreakGlassDirty = useMemo(
- () => JSON.stringify(breakGlassApprovers) !== JSON.stringify(savedBreakGlassApprovers),
- [breakGlassApprovers, savedBreakGlassApprovers]
+ () => JSON.stringify(breakGlassUsers) !== JSON.stringify(savedBreakGlassUsers),
+ [breakGlassUsers, savedBreakGlassUsers]
);
const isAnyDirty = isDirty || isNotifDirty || isBreakGlassDirty;
@@ -210,8 +210,8 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
);
const selectedBreakGlassIds = useMemo(
- () => new Set(breakGlassApprovers.map((a) => `${a.type}:${a.id}`)),
- [breakGlassApprovers]
+ () => new Set(breakGlassUsers.map((a) => `${a.type}:${a.id}`)),
+ [breakGlassUsers]
);
const userMap = useMemo(
@@ -303,12 +303,12 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
setIsDirty(true);
};
- const addBreakGlassApprover = (opt: ApproverOption | null) => {
+ const addBreakGlassUser = (opt: ApproverOption | null) => {
if (!opt) return;
setBreakGlassApprovers((prev) => [...prev, { type: opt.kind, id: opt.value }]);
};
- const removeBreakGlassApprover = (index: number) => {
+ const removeBreakGlassUser = (index: number) => {
setBreakGlassApprovers((prev) => prev.filter((_, i) => i !== index));
};
@@ -326,10 +326,10 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
return;
}
- if (breakGlassApprovers.length > 0 && approvers.length === 0) {
+ if (breakGlassUsers.length > 0 && approvers.length === 0) {
createNotification({
type: "error",
- text: "Break-glass approvers need at least one approver to bypass"
+ text: "Break-glass users need at least one approver to skip"
});
return;
}
@@ -338,7 +338,7 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
{
folderId,
steps: [{ approvers }],
- breakGlassApprovers,
+ breakGlassUsers,
// undefined leaves server-side configs untouched when the plan doesn't include the feature
notificationConfigs: isPamSlackEnabled ? notificationConfigs : undefined
},
@@ -356,7 +356,7 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
const handleDiscard = () => {
setApprovers(savedApprovers);
- setBreakGlassApprovers(savedBreakGlassApprovers);
+ setBreakGlassApprovers(savedBreakGlassUsers);
setNotificationConfigs(savedNotificationConfigs);
setIsDirty(false);
};
@@ -461,12 +461,12 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
<Card>
<CardHeader className="border-b">
<CardTitle className="text-base">
- Break-Glass Approvers
- <Badge variant="pam">{breakGlassApprovers.length}</Badge>
+ Break-Glass Users
+ <Badge variant="pam">{breakGlassUsers.length}</Badge>
</CardTitle>
<CardDescription>
- Users and groups who may self-approve their own request for accounts in this folder,
- skipping the approvers above. Only applies to accounts whose template has the Allow
+ Users and groups who can grant themselves access to accounts in this folder in an
+ emergency, without an approver. Only applies to accounts whose template has the Allow
Break-Glass policy on. Every use is recorded in the audit log and emailed to the
approvers who were skipped.
</CardDescription>
@@ -475,7 +475,7 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
<FilterableSelect
value={null}
options={breakGlassOptions}
- onChange={(opt) => addBreakGlassApprover(opt as ApproverOption | null)}
+ onChange={(opt) => addBreakGlassUser(opt as ApproverOption | null)}
getOptionValue={(opt) => `${opt.kind}:${opt.value}`}
getOptionLabel={(opt) => opt.label}
components={{ Option: ApproverSelectOption }}
@@ -485,9 +485,9 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
}
/>
- {breakGlassApprovers.length === 0 ? (
+ {breakGlassUsers.length === 0 ? (
<div className="rounded-md border border-border p-8 text-center text-sm text-muted">
- No break-glass approvers configured. Nobody can bypass approval in this folder.
+ No break-glass users configured. Nobody can bypass approval in this folder.
</div>
) : (
<Table>
@@ -499,7 +499,7 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
</TableRow>
</TableHeader>
<TableBody>
- {breakGlassApprovers.map((approver, idx) => {
+ {breakGlassUsers.map((approver, idx) => {
const Icon = KIND_ICON[approver.type];
const displayName =
approver.type === PamApproverType.User
@@ -530,9 +530,9 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
<IconButton
variant="ghost"
size="xs"
- aria-label="Remove break-glass approver"
+ aria-label="Remove break-glass user"
className="text-muted hover:text-danger"
- onClick={() => removeBreakGlassApprover(idx)}
+ onClick={() => removeBreakGlassUser(idx)}
>
<Trash2 className="size-4" />
</IconButton>
@@ -651,7 +651,6 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
</Badge>
</TooltipTrigger>
<TooltipContent>
- Self-approved, skipping the approvers.
{request.bypassReason ? ` Reason: "${request.bypassReason}"` : ""}
</TooltipContent>
</Tooltip>
diff --git a/frontend/src/pages/pam/PamTemplatesPage/components/TemplateDetailSheet.tsx b/frontend/src/pages/pam/PamTemplatesPage/components/TemplateDetailSheet.tsx
index 0bfed786bc..17f178db0d 100644
--- a/frontend/src/pages/pam/PamTemplatesPage/components/TemplateDetailSheet.tsx
+++ b/frontend/src/pages/pam/PamTemplatesPage/components/TemplateDetailSheet.tsx
@@ -38,6 +38,7 @@ import {
isRotatablePamAccountType,
PAM_ROTATION_INTERVAL_OPTIONS,
PamAccountType,
+ PamPolicyType,
useGetPamAccountTemplate,
usePamAccountTypeMap,
useUpdatePamAccountTemplate
@@ -374,8 +375,9 @@ const SettingsTab = ({
const showGatewaySettings = accountTypeMap[template.type]?.requiresGateway !== false;
const typeName = accountTypeMap[template.type]?.name ?? template.type;
const isRotatableTemplateType = isRotatablePamAccountType(template.type);
+ const requiresApproval = policies[PamPolicyType.RequiresApproval] === true;
const applicablePolicies = (accountTypeMap[template.type]?.applicablePolicies ?? []).filter(
- (p) => POLICY_EDITORS[p.key]
+ (p) => POLICY_EDITORS[p.key] && (p.key !== PamPolicyType.AllowBreakGlass || requiresApproval)
);
const onSubmit = (data: SettingsForm) => {
@@ -519,6 +521,9 @@ const SettingsTab = ({
const next = { ...policies };
if (value === null || value === undefined) delete next[p.key];
else next[p.key] = value;
+ if (p.key === PamPolicyType.RequiresApproval && value !== true) {
+ delete next[PamPolicyType.AllowBreakGlass];
+ }
setValue("policies", next, { shouldDirty: true });
}}
/>
diff --git a/frontend/src/pages/pam/components/RequestAccessSheet.tsx b/frontend/src/pages/pam/components/RequestAccessSheet.tsx
index 15a15ac4a5..877b5984a4 100644
--- a/frontend/src/pages/pam/components/RequestAccessSheet.tsx
+++ b/frontend/src/pages/pam/components/RequestAccessSheet.tsx
@@ -90,6 +90,7 @@ type Props = {
isOpen: boolean;
onOpenChange: (open: boolean) => void;
accessType?: PamAccessType;
+ onGranted?: (account: TAccessiblePamAccount, accessType: PamAccessType) => void;
};
const ApproverChip = ({
@@ -173,7 +174,8 @@ export const RequestAccessSheet = ({
account,
isOpen,
onOpenChange,
- accessType = PamAccessType.Session
+ accessType = PamAccessType.Session,
+ onGranted
}: Props) => {
const { typeName, subtitle, metadata } = useAccountSheetDetails(account, isOpen);
const createRequest = useCreatePamAccessRequest();
@@ -228,6 +230,7 @@ export const RequestAccessSheet = ({
});
setBypassReason("");
onOpenChange(false);
+ if (account) onGranted?.(account, accessType);
}
}
);
@@ -256,6 +259,7 @@ export const RequestAccessSheet = ({
});
reset();
onOpenChange(false);
+ if (breakGlassOnSubmit && account) onGranted?.(account, accessType);
}
}
);