Skip to content

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

address reviews

Andrey2ef666322c63
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
index 8a3be67bea..65ff8daf4b 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-account-router.ts
@@ -62,9 +62,6 @@ const PamAccountListItemSchema = SanitizedAccountListItemSchema.extend({
requireReason: z.boolean().describe("Whether the account's template requires a reason for access"),
accessStatus: z.nativeEnum(PamAccessStatus).describe("Current approval status for the caller"),
grantExpiresAt: z.date().nullable().describe("When the current grant expires, if granted"),
- requiresCredentialApproval: z
- .boolean()
- .describe("Whether this account requires approval before its credentials can be viewed"),
supportsCredentialReveal: z.boolean().describe("Whether this account type stores a credential that can be revealed"),
credentialAccessStatus: z.nativeEnum(PamAccessStatus).describe("Current credential-approval status for the caller"),
permissions: z.any().array().describe("The caller's effective (packed) resource permissions on this account")
diff --git a/backend/src/ee/routes/v1/pam-routers/pam-resource-role-router.ts b/backend/src/ee/routes/v1/pam-routers/pam-resource-role-router.ts
index 48d3363a3c..efcf888aee 100644
--- a/backend/src/ee/routes/v1/pam-routers/pam-resource-role-router.ts
+++ b/backend/src/ee/routes/v1/pam-routers/pam-resource-role-router.ts
@@ -17,7 +17,7 @@ const DEFAULT_RESOURCE_ROLES = [
slug: PamResourceRole.Operator,
name: "Operator",
isDefault: true,
- description: "Launch sessions and view account credentials; cannot approve requests or change configuration"
+ description: "Launch sessions and view account credentials"
},
{
slug: PamResourceRole.Connector,
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 b78222fa49..62e3a5a189 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
@@ -673,10 +673,7 @@ export const pamAccessRequestServiceFactory = ({
);
const accessControls = resolveAccessControls(account.templatePolicies);
- const gateEnabled = isCredentialRequest
- ? accessControls.requiresCredentialApproval
- : accessControls.requiresApproval;
- if (!gateEnabled) {
+ if (!accessControls.requiresApproval) {
throw new BadRequestError({
message: isCredentialRequest
? "This account does not require approval to view its credentials"
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 14b1c4204d..d193e98d9a 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -243,9 +243,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
(a) => resolveAccessControls(a.templatePolicies).requiresApproval
);
const accountIdsRequiringApproval = accountsRequiringApproval.map((a) => a.id);
- const accountIdsRequiringCredentialApproval = accounts
- .filter((a) => resolveAccessControls(a.templatePolicies).requiresCredentialApproval)
- .map((a) => a.id);
+
const folderIdsRequiringApproval = [
...new Set(accountsRequiringApproval.map((a) => a.folderId).filter(Boolean) as string[])
];
@@ -259,7 +257,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
),
deps.pamAccessRequestService.getAccessStatusBatch(
{ actorId: ctx.actorId, actor: ctx.actor },
- accountIdsRequiringCredentialApproval,
+ accountIdsRequiringApproval,
projectId,
PamAccessType.Credential
),
@@ -276,7 +274,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
return accounts.map((a) => {
const { accessibilityIssues, isAccessible } = computeAccessibility(a);
- const { requiresApproval, requiresCredentialApproval, requireReason } = resolveAccessControls(a.templatePolicies);
+ const { requiresApproval, requireReason } = resolveAccessControls(a.templatePolicies);
if (requiresApproval && a.folderId && !foldersWithApprovalPolicy.has(a.folderId)) {
accessibilityIssues.push(PamAccountAccessibilityIssue.NoApprovalConfig);
}
@@ -299,12 +297,11 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
accessibilityIssues,
isStale: a.isStale,
requiresApproval,
- requiresCredentialApproval,
supportsCredentialReveal: hasRevealableCredential(a.accountType as PamAccountType),
requireReason,
accessStatus: requiresApproval ? (statusEntry?.accessStatus ?? PamAccessStatus.None) : PamAccessStatus.None,
grantExpiresAt: statusEntry?.grantExpiresAt ?? null,
- credentialAccessStatus: requiresCredentialApproval
+ credentialAccessStatus: requiresApproval
? (credentialStatusEntry?.accessStatus ?? PamAccessStatus.None)
: PamAccessStatus.None,
permissions: permissionsByAccountId.get(a.id) ?? [],
@@ -389,7 +386,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
const trimmedReason = reason?.trim() || null;
let grantExpiresAt: Date | null = null;
- if (policy.requiresCredentialApproval) {
+ if (policy.requiresApproval) {
const grant = await deps.pamAccessRequestService.checkGrant({
actorId: ctx.actorId,
actor: ctx.actor,
diff --git a/backend/src/ee/services/pam/CLAUDE.md b/backend/src/ee/services/pam/CLAUDE.md
index 0fd4668caa..8598107162 100644
--- a/backend/src/ee/services/pam/CLAUDE.md
+++ b/backend/src/ee/services/pam/CLAUDE.md
@@ -60,9 +60,9 @@ Gotchas:
product-level bucket and is hidden from resource viewers.
- Gated accounts (`requiresApproval`) require `LaunchSessions` **and** a valid approval grant, enforced in
both the session and web-access services.
-- **Session launch and credential reveal (`pamAccountService.getCredentials`) are independent gates over
- one folder policy.** `requiresApproval` / `requiresCredentialApproval` turn them on; both use the same
- `PamAccess` policy and approvers, told apart by `accessType` on the request data and grant attributes.
+- **Session launch and credential reveal (`pamAccountService.getCredentials`) are separately approved
+ behind one switch.** The template's `requiresApproval` gates both; they share the same `PamAccess`
+ policy and approvers, told apart by `accessType` on the request data and grant attributes.
**A missing `accessType` means session**, so a grant predating credential access can never unlock a
reveal — never treat it as a wildcard. Hence `checkGrant`/`getAccessStatusBatch` take an `accessType`,
pending requests dedupe per (account, accessType), and `revokeGrantRow` skips session termination for a
diff --git a/backend/src/ee/services/pam/pam-policies.test.ts b/backend/src/ee/services/pam/pam-policies.test.ts
index 4aad00598d..afa05b8f97 100644
--- a/backend/src/ee/services/pam/pam-policies.test.ts
+++ b/backend/src/ee/services/pam/pam-policies.test.ts
@@ -88,7 +88,6 @@ describe("validatePolicyValues", () => {
describe("resolveAccessControls", () => {
const DEFAULTS = {
requiresApproval: false,
- requiresCredentialApproval: false,
requireReason: false,
requireMfa: false,
maxSessionDurationSeconds: null
diff --git a/backend/src/ee/services/pam/pam-policies.ts b/backend/src/ee/services/pam/pam-policies.ts
index 32bf37d922..a44f2a788c 100644
--- a/backend/src/ee/services/pam/pam-policies.ts
+++ b/backend/src/ee/services/pam/pam-policies.ts
@@ -5,7 +5,6 @@ import { PamAccountType } from "./pam-enums";
export enum PamPolicyType {
RequiresApproval = "requires-approval",
- RequiresCredentialApproval = "requires-credential-approval",
RequireMfa = "require-mfa",
RequireReason = "require-reason",
MaxSessionDuration = "max-session-duration",
@@ -51,8 +50,6 @@ export const patternsStringSchema = (maxPatterns = 20, maxPatternLength = 500) =
{ message: "One or more patterns are not valid regular expressions" }
);
-const CREDENTIAL_BEARING_ACCOUNT_TYPES = Object.values(PamAccountType).filter((type) => type !== PamAccountType.AwsIam);
-
type TPamPolicyTypeOverride = {
description?: string;
schema?: z.ZodTypeAny;
@@ -73,12 +70,6 @@ export const PAM_POLICY_DEFINITIONS: Record<PamPolicyType, TPamPolicyDefinition>
appliesTo: "all",
schema: z.boolean()
},
- [PamPolicyType.RequiresCredentialApproval]: {
- label: "Require Approval for Credentials",
- description: "Users must request and receive approval before viewing this account's credentials.",
- appliesTo: CREDENTIAL_BEARING_ACCOUNT_TYPES,
- schema: z.boolean()
- },
[PamPolicyType.RequireMfa]: {
label: "Require MFA",
description: "Users must re-authenticate with MFA before accessing.",
@@ -180,7 +171,6 @@ export const resolvePolicy = (policyMap: unknown, policy: PamPolicyType): unknow
export type TPamAccessControls = {
requiresApproval: boolean;
- requiresCredentialApproval: boolean;
requireReason: boolean;
requireMfa: boolean;
maxSessionDurationSeconds: number | null;
@@ -200,7 +190,6 @@ export const resolveAccessControls = (policyMap: unknown): TPamAccessControls =>
const duration = resolvePolicy(policyMap, PamPolicyType.MaxSessionDuration);
return {
requiresApproval: resolvePolicy(policyMap, PamPolicyType.RequiresApproval) === true,
- requiresCredentialApproval: resolvePolicy(policyMap, PamPolicyType.RequiresCredentialApproval) === true,
requireReason: resolvePolicy(policyMap, PamPolicyType.RequireReason) === true,
requireMfa: resolvePolicy(policyMap, PamPolicyType.RequireMfa) === true,
maxSessionDurationSeconds: typeof duration === "number" ? duration : null
diff --git a/docs/docs.json b/docs/docs.json
index dae5e9fb86..8e71f3e81c 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -746,7 +746,6 @@
"group": "Accounts",
"pages": [
"documentation/platform/pam/accounts/overview",
- "documentation/platform/pam/accounts/viewing-credentials",
"documentation/platform/pam/accounts/postgresql",
"documentation/platform/pam/accounts/mysql",
"documentation/platform/pam/accounts/mssql",
diff --git a/docs/documentation/platform/pam/access-requests/overview.mdx b/docs/documentation/platform/pam/access-requests/overview.mdx
index d23ee39f92..52bdd5a408 100644
--- a/docs/documentation/platform/pam/access-requests/overview.mdx
+++ b/docs/documentation/platform/pam/access-requests/overview.mdx
@@ -6,12 +6,7 @@ description: "Require approval before a member can use a sensitive account."
Some [accounts](/documentation/platform/pam/accounts/overview) are sensitive enough that simply having access to them should not be enough to use them. A production database or a domain admin account should be reachable only by people who are already trusted, but even for them, each individual use should clear an extra checkpoint. Access requests add that checkpoint: before a member can [launch a session](/documentation/platform/pam/sessions/overview) on a gated account, their access has to be approved.
-An account can gate two things independently, and each is requested separately:
-
-- **Session access**, gated by the template's **Require Approval** policy.
-- **Credential access**, gated by **Require Approval for Credentials**. See [Viewing credentials](/documentation/platform/pam/accounts/viewing-credentials).
-
-Everything below applies to both. An approved session request never reveals the credential, and an approved credential request never launches a session, so a member who needs both files both.
+The template's **Require Approval** policy gates two things, and each is requested separately: launching a session, and [viewing the account's credentials](/documentation/platform/pam/accounts/overview#viewing-credentials). Everything below applies to both. An approved session request never reveals the credential, and an approved credential request never launches a session, so a member who needs both files both.
The same checkpoint applies to [AI agents](/documentation/platform/pam/ai-agents/overview). An agent requests access as whoever started it, a person or a [machine identity](/documentation/platform/identities/machine-identities), and waits for an approver either way.
diff --git a/docs/documentation/platform/pam/accounts/overview.mdx b/docs/documentation/platform/pam/accounts/overview.mdx
index 2e82e96ad3..c6eb515ee6 100644
--- a/docs/documentation/platform/pam/accounts/overview.mdx
+++ b/docs/documentation/platform/pam/accounts/overview.mdx
@@ -85,6 +85,18 @@ Every other account type starts a local proxy and outputs the port to connect to
To let an [AI agent](/documentation/platform/pam/ai-agents/overview) reach an account, use [`infisical pam agentic access`](/cli/commands/pam-agentic) instead.
+### Viewing credentials
+
+Some work needs the password itself, not a session: pasting it into a desktop client Infisical does not broker, or configuring an appliance by hand. Select **View Credentials** from the account's menu, give a reason, and the stored fields are shown with secrets masked until revealed.
+
+This needs the **Operator** or **Admin** [role](/documentation/platform/pam/concepts/access-control) on the folder or account, and an approval when the template requires one — the entry reads **Request Credentials** until you hold one. Sessions and credentials are approved separately, so an approved session request never reveals the credential. Accounts whose auth method stores no secret (SSH certificate, AWS IAM, PostgreSQL AWS IAM) have nothing to reveal and say so.
+
+Every reveal writes a **View PAM Account Credentials** entry to the [audit log](/documentation/platform/pam/auditing) with the member, account, and reason.
+
+<Warning>
+ A revealed credential is outside Infisical: no session recording, no command blocking, and revoking the grant stops further reveals but cannot take back a copied password. Prefer a session where one will do, and [rotate](/documentation/platform/pam/accounts/overview) the account after a checkout.
+</Warning>
+
## Direct account memberships
Most access is granted at the folder level — if you have access to the folder, you have access to all accounts in it.
diff --git a/docs/documentation/platform/pam/accounts/viewing-credentials.mdx b/docs/documentation/platform/pam/accounts/viewing-credentials.mdx
deleted file mode 100644
index 657cf7d778..0000000000
--- a/docs/documentation/platform/pam/accounts/viewing-credentials.mdx
+++ /dev/null
@@ -1,106 +0,0 @@
----
-title: "Viewing credentials"
-sidebarTitle: "Viewing credentials"
-description: "Read an account's stored password or key, with approval and an audit trail."
----
-
-Most privileged work in Infisical never needs the password. A member [launches a session](/documentation/platform/pam/sessions/overview), the Gateway injects the credential, and the session is recorded. The credential stays inside the platform.
-
-Some work still needs the credential itself. A DBA has to paste a password into a desktop client that Infisical does not broker, or an engineer has to configure an appliance by hand. Viewing credentials covers that case: a member reads the stored password or key directly, once approved, and the reveal lands in the audit log.
-
-<Warning>
- A revealed credential is outside Infisical. There is no session recording, no command blocking, and no way to end the access early. Prefer a session wherever one will do, and gate credential access with approval where you cannot.
-</Warning>
-
-## Who can view a credential
-
-Two things have to hold.
-
-- **Permission.** The member needs the **Operator** or **Admin** [role](/documentation/platform/pam/concepts/access-control) on the folder or account. Connector and Auditor cannot view credentials.
-- **Approval**, when the account's [template](/documentation/platform/pam/templates/overview) turns on **Require Approval for Credentials**. The member requests credential access and an approver signs off before the reveal works.
-
-This mirrors how session gating works: permission is the record of who can ever read the credential, and approval decides whether they are cleared to read it right now.
-
-## Viewing a credential
-
-<Steps>
- <Step title="Open the account's menu">
- From the **Accounts** page, open the menu on the account row and choose **View Credentials**. On a gated account the entry reads **Request Credentials** instead until you hold an approval.
- </Step>
- <Step title="Give a reason">
- Enter why you need the credential. The reason is required when the template turns on **Require Reason**, and is recorded either way.
- </Step>
- <Step title="Complete MFA, if the template requires it">
- An account whose template turns on **Require MFA** challenges you before the reveal, the same as it does before a session.
- </Step>
- <Step title="Read or copy the credential">
- Sensitive fields are masked until you reveal them.
- </Step>
-</Steps>
-
-## Gating credential access with approval
-
-Approval for credentials is configured the same way as approval for sessions, and shares the same approvers.
-
-<Steps>
- <Step title="Turn on the policy (Product Admin)">
- Go to **Privileged Access Management → Account Templates**, open the template for the account type, and turn on **Require Approval for Credentials**.
- </Step>
- <Step title="Onboard the account with that template (Folder Admin)">
- Accounts using the template inherit the requirement.
- </Step>
- <Step title="Seat approvers in the folder (Folder Admin)">
- Open the folder and go to its **Approvals** tab. The approvers seated there review both session and credential requests for the folder's accounts.
- </Step>
-</Steps>
-
-A credential request carries a reason and a duration, is reviewed from **Approval Requests** like any other, and shows a **Credentials** badge so an approver can tell it apart from a session request. Once approved, the member can reveal the credential until the duration runs out.
-
-<Note>
- Session and credential grants are independent. An approved session request never reveals the credential, and an approved credential request never launches a session. A member who needs both files both.
-</Note>
-
-## Rotate after a checkout
-
-A credential that has left the platform should not stay valid indefinitely. For account types that support it, set up [credential rotation](/documentation/platform/pam/accounts/overview) on the account so the revealed password is replaced on a schedule, and rotate on demand after a checkout you want to close out immediately.
-
-## Auditing
-
-Every reveal writes a **View PAM Account Credentials** entry to the [audit log](/documentation/platform/pam/auditing) with the member, the account, the reason they gave, and when their approval expires. The log is the record of who holds a credential outside Infisical, so review it alongside session recordings.
-
-## Frequently asked questions
-
-<AccordionGroup>
- <Accordion title="Which account types can have their credentials viewed?">
- Any account that stores a credential. AWS IAM accounts are the exception: Infisical assumes a role rather than storing a secret, so there is nothing to reveal and the option does not appear.
- </Accordion>
- <Accordion title="Can a machine identity view a credential?">
- Yes, if it holds Operator or Admin on the folder or account, and an approval when the account is gated. An account whose template requires MFA stays out of reach, since no machine can complete the challenge.
- </Accordion>
- <Accordion title="Does revoking a credential grant take the credential back?">
- No. Revoking stops further reveals, but a credential already copied is out of the platform and stays valid until it is rotated. Rotate the account to close that off.
- </Accordion>
- <Accordion title="Does revoking a credential grant end the member's sessions?">
- No. Sessions are authorized by their own grant, so revoking credential access leaves live sessions running. Revoke the session grant to end those.
- </Accordion>
- <Accordion title="Can an approver approve their own credential request?">
- No, the same separation of duties applies as for session requests. This is why the Operator role carries no approval rights: an Operator can request credential access but never clear their own request.
- </Accordion>
-</AccordionGroup>
-
-## Next steps
-
-<CardGroup cols={2}>
- <Card title="Access requests" icon="key" href="/documentation/platform/pam/access-requests/overview">
- Gate sessions with the same approvers.
- </Card>
- <Card title="Account templates" icon="layer-group" href="/documentation/platform/pam/templates/overview">
- Turn on Require Approval for Credentials.
- </Card>
- <Card title="Access control" icon="lock" href="/documentation/platform/pam/concepts/access-control">
- Grant the Operator role.
- </Card>
- <Card title="Auditing" icon="list-check" href="/documentation/platform/pam/auditing">
- Review who revealed which credential.
- </Card>
-</CardGroup>
diff --git a/docs/documentation/platform/pam/concepts/access-control.mdx b/docs/documentation/platform/pam/concepts/access-control.mdx
index 7916d329b5..0f5efb3fe0 100644
--- a/docs/documentation/platform/pam/concepts/access-control.mdx
+++ b/docs/documentation/platform/pam/concepts/access-control.mdx
@@ -48,12 +48,12 @@ Once someone is a product member, they still need to be granted access to specif
| Role | What they can do |
|------|------------------|
| **Admin** | Full control — accounts, folders, sessions, memberships |
-| **Operator** | Launch sessions and [view account credentials](/documentation/platform/pam/accounts/viewing-credentials) |
+| **Operator** | Launch sessions and [view account credentials](/documentation/platform/pam/accounts/overview#viewing-credentials) |
| **Connector** | Launch sessions and connect to accounts |
| **Auditor** | View audit logs and session recordings |
<Note>
- **Operator** is Connector plus the right to read an account's stored password or key. Grant it only where someone genuinely needs the credential in hand, since a revealed credential leaves no session recording. An Operator cannot approve requests or change configuration, so an account gated with **Require Approval for Credentials** still needs someone else to sign off.
+ **Operator** is Connector plus the right to read an account's stored password or key. Grant it only where someone genuinely needs the credential in hand, since a revealed credential leaves no session recording.
</Note>
### Folder vs account memberships
diff --git a/docs/documentation/platform/pam/templates/overview.mdx b/docs/documentation/platform/pam/templates/overview.mdx
index 711e824b28..9432da803f 100644
--- a/docs/documentation/platform/pam/templates/overview.mdx
+++ b/docs/documentation/platform/pam/templates/overview.mdx
@@ -34,15 +34,14 @@ If you need different rules — say, 4-hour sessions with MFA for production —
<Step title="Configure policies">
| Option | What it does |
|--------|--------------|
- | **Require Approval** | Users must request and receive approval before launching a session |
- | **Require Approval for Credentials** | Users must request and receive approval before [viewing the account's credentials](/documentation/platform/pam/accounts/viewing-credentials) |
+ | **Require Approval** | Users must request and receive approval before launching a session or [viewing credentials](/documentation/platform/pam/accounts/overview#viewing-credentials) |
| **Require MFA** | Users must re-authenticate with MFA before connecting |
| **Require Reason** | A reason must be provided before connecting |
| **Max Session Duration** | How long someone can stay connected (in seconds) |
| **Command Blocking** | Regex patterns for commands to reject (one per line). Currently SSH only. |
<Note>
- The two approval options are separate gates. Turning on **Require Approval** does not gate the credential, and an approved session request does not reveal it. Gate both if a session and the raw password should each need sign-off.
+ **Require Approval** gates sessions and credential reveals with one switch, but they are approved separately: a session request never reveals the credential, and a credential request never launches a session. A member who needs both files both.
</Note>
<Note>
diff --git a/frontend/src/hooks/api/pam/enums.ts b/frontend/src/hooks/api/pam/enums.ts
index 9b16a4431c..7e798138d6 100644
--- a/frontend/src/hooks/api/pam/enums.ts
+++ b/frontend/src/hooks/api/pam/enums.ts
@@ -64,7 +64,6 @@ export const formatRotationInterval = (seconds: number | null | undefined): stri
export enum PamPolicyType {
RequiresApproval = "requires-approval",
- RequiresCredentialApproval = "requires-credential-approval",
RequireMfa = "require-mfa",
RequireReason = "require-reason",
MaxSessionDuration = "max-session-duration",
diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsx
index 75c973ccec..b8e8b9b4d6 100644
--- a/frontend/src/hooks/api/pam/mutations.tsx
+++ b/frontend/src/hooks/api/pam/mutations.tsx
@@ -783,6 +783,7 @@ export const useCreatePamAccessRequest = () => {
export const usePamAccountCredentials = () => {
return useMutation({
+ meta: { handledErrorCodes: ["SESSION_MFA_REQUIRED"] },
mutationFn: async ({ accountId, reason, mfaSessionId }: TGetPamAccountCredentialsDTO) => {
const { data } = await apiRequest.post<TPamAccountCredentials>(
`/api/v1/pam/accounts/${accountId}/credentials`,
diff --git a/frontend/src/hooks/api/pam/queries.tsx b/frontend/src/hooks/api/pam/queries.tsx
index d992197c5d..52cf39bf7b 100644
--- a/frontend/src/hooks/api/pam/queries.tsx
+++ b/frontend/src/hooks/api/pam/queries.tsx
@@ -211,7 +211,6 @@ export type TPamAccountListItem = {
// the latest discovery scan didn't find it. Informational only, nothing about the account is blocked.
isStale: boolean;
requiresApproval: boolean;
- requiresCredentialApproval: boolean;
supportsCredentialReveal: boolean;
requireReason: boolean;
accessStatus: PamAccessStatus;
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index 80c5558409..c9654eb181 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -351,7 +351,6 @@ export type TAccessiblePamAccount = {
requireReason?: boolean;
accessStatus?: PamAccessStatus;
grantExpiresAt?: string | null;
- requiresCredentialApproval?: boolean;
credentialAccessStatus?: PamAccessStatus;
disabledReason?: string | null;
createdAt: string;
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx
index 26ddf2abff..dc00972b9e 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AccountActionsMenu.tsx
@@ -26,8 +26,8 @@ type Props = {
accountType: PamAccountType;
isAccessible: boolean;
requiresApproval: boolean;
+ hasApprovalConfig: boolean;
accessStatus: PamAccessStatus;
- requiresCredentialApproval: boolean;
supportsCredentialReveal: boolean;
credentialAccessStatus: PamAccessStatus;
onLaunch: () => void;
@@ -43,8 +43,8 @@ export const AccountActionsMenu = ({
accountType,
isAccessible,
requiresApproval,
+ hasApprovalConfig,
accessStatus,
- requiresCredentialApproval,
supportsCredentialReveal,
credentialAccessStatus,
onLaunch,
@@ -72,7 +72,8 @@ export const AccountActionsMenu = ({
const isCredentialPending = credentialAccessStatus === PamAccessStatus.Pending;
const needsCredentialApproval =
- requiresCredentialApproval && credentialAccessStatus !== PamAccessStatus.Granted;
+ requiresApproval && credentialAccessStatus !== PamAccessStatus.Granted;
+ const canRequestCredentials = hasApprovalConfig && !isCredentialPending;
const availableTabs = PAM_ACCOUNT_TABS.filter(
(tab) => (tab.value !== PamSheetTab.Rotation || isRotatable) && (!tab.action || can(tab.action))
@@ -109,7 +110,7 @@ export const AccountActionsMenu = ({
<div>
<DropdownMenuItem isDisabled={isPending} onClick={onRequestAccess}>
{isPending ? <Clock className="size-4" /> : <KeyRound className="size-4" />}
- {isPending ? "Request Pending" : "Request Access"}
+ {isPending ? "Access Request Pending" : "Request Access"}
</DropdownMenuItem>
</div>
</TooltipTrigger>
@@ -136,7 +137,7 @@ export const AccountActionsMenu = ({
<TooltipTrigger asChild>
<div>
<DropdownMenuItem
- isDisabled={isCredentialPending}
+ isDisabled={!canRequestCredentials}
onClick={onRequestCredentialAccess}
>
{isCredentialPending ? (
@@ -148,8 +149,12 @@ export const AccountActionsMenu = ({
</DropdownMenuItem>
</div>
</TooltipTrigger>
- {isCredentialPending && (
- <TooltipContent side="left">Your request is awaiting approval</TooltipContent>
+ {!canRequestCredentials && (
+ <TooltipContent side="left">
+ {isCredentialPending
+ ? "Your request is awaiting approval"
+ : "This folder has no approvers configured"}
+ </TooltipContent>
)}
</Tooltip>
) : (
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRow.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRow.tsx
index 9fa7188f8e..d9d91cca2d 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRow.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRow.tsx
@@ -1,5 +1,6 @@
import {
PamAccessStatus,
+ PamAccountAccessibilityIssue,
PamAccountType,
PamResourcePermissionActions,
TAccessiblePamAccount,
@@ -64,7 +65,6 @@ export const FolderAccountRow = ({
requireReason: account.requireReason,
accessStatus,
grantExpiresAt: account.grantExpiresAt,
- requiresCredentialApproval: account.requiresCredentialApproval,
credentialAccessStatus: account.credentialAccessStatus,
createdAt: account.createdAt,
updatedAt: account.updatedAt
@@ -98,8 +98,10 @@ export const FolderAccountRow = ({
accountType={accountType}
isAccessible={account.isAccessible}
requiresApproval={requiresApproval}
+ hasApprovalConfig={
+ !account.accessibilityIssues.includes(PamAccountAccessibilityIssue.NoApprovalConfig)
+ }
accessStatus={accessStatus}
- requiresCredentialApproval={account.requiresCredentialApproval}
supportsCredentialReveal={account.supportsCredentialReveal}
credentialAccessStatus={account.credentialAccessStatus}
onLaunch={() => onLaunchAccount(launchableAccount)}
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
index 42a44c4e9a..045aaf09ce 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
@@ -55,6 +55,7 @@ import {
import { TPamAccessRequest, TPamNotificationConfig } from "@app/hooks/api/pam/types";
import { useGetOrgUsers } from "@app/hooks/api/users/queries";
+import { AccessTypeBadge } from "../../components/AccessTypeBadge";
import { AccountPlatformIcon } from "../../components/AccountPlatformIcon";
import { getRequestStatusInfo, isGrantActive } from "../../components/approvalRequestStatus";
import { getRequesterSubtitle } from "../../components/requesterDisplay";
@@ -451,6 +452,7 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
<TableRow>
<TableHead>Requester</TableHead>
<TableHead>Account</TableHead>
+ <TableHead>Requesting</TableHead>
<TableHead>Status</TableHead>
{canRevoke && <TableHead variant="action" />}
</TableRow>
@@ -476,6 +478,9 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
{request.accountName ?? "-"}
</div>
</TableCell>
+ <TableCell>
+ <AccessTypeBadge accessType={request.accessType} />
+ </TableCell>
<TableCell>
<Badge variant={status.variant}>{status.label}</Badge>
</TableCell>
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/ViewCredentialsModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/ViewCredentialsModal.tsx
index f3654b8aa3..afa3b1d161 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/ViewCredentialsModal.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/ViewCredentialsModal.tsx
@@ -39,10 +39,6 @@ type Props = {
onOpenChange: (open: boolean) => void;
};
-const errorMessageOf = (err: unknown) =>
- (err as { response?: { data?: { message?: string } } })?.response?.data?.message ??
- "Failed to reveal credentials. Please try again.";
-
const MFA_FAILURE_MESSAGE = {
blocked:
"Your browser blocked the MFA verification window. Allow popups for this site, then try again.",
@@ -145,10 +141,7 @@ export const ViewCredentialsModal = ({
if (isStale()) return;
const challengeId = mfaSessionId ? undefined : extractMfaSessionId(err);
- if (!challengeId) {
- setErrorMessage(errorMessageOf(err));
- return;
- }
+ if (!challengeId) return;
setIsVerifyingMfa(true);
const outcome = await runMfaChallenge(challengeId);
@@ -181,7 +174,7 @@ export const ViewCredentialsModal = ({
{errorMessage && (
<Alert variant="danger">
- <AlertTitle>Could not reveal credentials</AlertTitle>
+ <AlertTitle>MFA verification incomplete</AlertTitle>
<AlertDescription>{errorMessage}</AlertDescription>
</Alert>
)}
diff --git a/frontend/src/pages/pam/PamApprovalRequestsPage/PamApprovalRequestsPage.tsx b/frontend/src/pages/pam/PamApprovalRequestsPage/PamApprovalRequestsPage.tsx
index 7eac209ddd..2689e63663 100644
--- a/frontend/src/pages/pam/PamApprovalRequestsPage/PamApprovalRequestsPage.tsx
+++ b/frontend/src/pages/pam/PamApprovalRequestsPage/PamApprovalRequestsPage.tsx
@@ -3,7 +3,7 @@ import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { useNavigate, useSearch } from "@tanstack/react-router";
import { format } from "date-fns";
-import { FolderOpen, KeyRound, SearchIcon, ShieldCheck } from "lucide-react";
+import { FolderOpen, SearchIcon, ShieldCheck } from "lucide-react";
import { PageHeader } from "@app/components/v2";
import {
@@ -36,10 +36,11 @@ import {
PreferenceKey,
setUserTablePreference
} from "@app/helpers/userTablePreferences";
-import { PamAccessType, useListPamPendingMyApproval } from "@app/hooks/api/pam";
+import { useListPamPendingMyApproval } from "@app/hooks/api/pam";
import { TPamAccessRequest } from "@app/hooks/api/pam/types";
import { ProjectType } from "@app/hooks/api/projects/types";
+import { AccessTypeBadge } from "../components/AccessTypeBadge";
import { AccountPlatformIcon } from "../components/AccountPlatformIcon";
import { getRequestStatusInfo } from "../components/approvalRequestStatus";
import { formatDuration } from "../components/formatDuration";
@@ -70,14 +71,11 @@ const RequestRow = ({
<AccountPlatformIcon accountType={request.accountType} size={16} />
)}
{request.accountName ?? "-"}
- {request.accessType === PamAccessType.Credential && (
- <Badge variant="warning">
- <KeyRound className="mr-1 size-3" />
- Credentials
- </Badge>
- )}
</div>
</TableCell>
+ <TableCell>
+ <AccessTypeBadge accessType={request.accessType} />
+ </TableCell>
<TableCell className="text-sm">{request.folderName ?? "-"}</TableCell>
<TableCell className="text-sm">{formatDuration(duration)}</TableCell>
<TableCell className="text-sm">
@@ -135,6 +133,7 @@ const RequestTable = ({
<TableRow>
<TableHead>Requester</TableHead>
<TableHead>Account</TableHead>
+ <TableHead>Requesting</TableHead>
<TableHead>Folder</TableHead>
<TableHead>Duration</TableHead>
<TableHead>Requested</TableHead>
@@ -145,7 +144,7 @@ const RequestTable = ({
{isPending &&
Array.from({ length: 5 }).map((_, i) => (
<TableRow key={`skeleton-${i + 1}`}>
- {Array.from({ length: 6 }).map((__, j) => (
+ {Array.from({ length: 7 }).map((__, j) => (
<TableCell key={`cell-${j + 1}`}>
<Skeleton className="h-4 w-full" />
</TableCell>
diff --git a/frontend/src/pages/pam/components/AccessTypeBadge.tsx b/frontend/src/pages/pam/components/AccessTypeBadge.tsx
new file mode 100644
index 0000000000..8d586896e4
--- /dev/null
+++ b/frontend/src/pages/pam/components/AccessTypeBadge.tsx
@@ -0,0 +1,18 @@
+import { KeyRound, Rocket } from "lucide-react";
+
+import { Badge } from "@app/components/v3";
+import { PamAccessType } from "@app/hooks/api/pam";
+
+// Requests raised before credential access existed carry no accessType; those were session requests
+export const AccessTypeBadge = ({ accessType }: { accessType?: PamAccessType }) =>
+ accessType === PamAccessType.Credential ? (
+ <Badge variant="warning">
+ <KeyRound className="mr-1 size-3" />
+ Credentials
+ </Badge>
+ ) : (
+ <Badge variant="neutral">
+ <Rocket className="mr-1 size-3" />
+ Session
+ </Badge>
+ );
diff --git a/frontend/src/pages/pam/components/policyEditors/index.tsx b/frontend/src/pages/pam/components/policyEditors/index.tsx
index d5f8cb2245..64601d4241 100644
--- a/frontend/src/pages/pam/components/policyEditors/index.tsx
+++ b/frontend/src/pages/pam/components/policyEditors/index.tsx
@@ -16,7 +16,6 @@ const CommandBlockingEditor = (props: PolicyEditorProps) => (
export const POLICY_EDITORS: Partial<Record<PamPolicyType, ComponentType<PolicyEditorProps>>> = {
[PamPolicyType.RequiresApproval]: BooleanPolicyEditor,
- [PamPolicyType.RequiresCredentialApproval]: BooleanPolicyEditor,
[PamPolicyType.RequireMfa]: BooleanPolicyEditor,
[PamPolicyType.RequireReason]: BooleanPolicyEditor,
[PamPolicyType.MaxSessionDuration]: DurationPolicyEditor,