Skip to content

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

fix(pam): reject project-scoped identities, UI polish, error handling

bernie-g2c088dad4336
diff --git a/backend/src/ee/services/pam-membership/pam-membership-service.ts b/backend/src/ee/services/pam-membership/pam-membership-service.ts
index f8809a65aa..969c82785b 100644
--- a/backend/src/ee/services/pam-membership/pam-membership-service.ts
+++ b/backend/src/ee/services/pam-membership/pam-membership-service.ts
@@ -181,6 +181,9 @@ export const pamMembershipServiceFactory = ({
} else {
const identity = await identityDAL.findById(id);
if (!identity) throw new NotFoundError({ message: `Identity with ID '${id}' not found` });
+ if (identity.projectId) {
+ throw new BadRequestError({ message: "Project-scoped identities cannot be added as PAM members" });
+ }
const orgMemberships = await membershipDAL.find({
scope: AccessScope.Organization,
diff --git a/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx b/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx
index 4409b3e813..0af7c5af59 100644
--- a/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx
+++ b/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx
@@ -12,6 +12,7 @@ import {
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import { DeleteActionModal } from "@app/components/v2";
+import { HighlightText } from "@app/components/v2/HighlightText";
import {
Badge,
Button,
@@ -88,9 +89,13 @@ export const IdentitiesTab = () => {
const handleDeleteIdentity = async () => {
if (!identityToRemove) return;
if (!identityToRemove.identityId) return;
- await removeIdentity.mutateAsync({ identityId: identityToRemove.identityId });
- createNotification({ text: "Identity removed", type: "success" });
- setIdentityToRemove(null);
+ try {
+ await removeIdentity.mutateAsync({ identityId: identityToRemove.identityId });
+ createNotification({ text: "Identity removed", type: "success" });
+ setIdentityToRemove(null);
+ } catch {
+ createNotification({ text: "Failed to remove identity", type: "error" });
+ }
};
const selectedIdentityName = selectedIdentity ? getIdentityName(selectedIdentity) : undefined;
@@ -174,7 +179,9 @@ export const IdentitiesTab = () => {
const primaryRole = member.role ?? ProjectMembershipRole.Member;
return (
<TableRow key={member.membershipId}>
- <TableCell className="font-medium">{name}</TableCell>
+ <TableCell className="font-medium">
+ <HighlightText text={name} highlight={search} />
+ </TableCell>
<TableCell>
<button type="button" onClick={() => setSelectedIdentity(member)}>
<Badge
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
index 39ddb9c834..7e5d2a91a5 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
@@ -309,7 +309,7 @@ const PermissionsTab = ({
<Badge variant="pam">{directMembers.length}</Badge>
</CardTitle>
<CardDescription>
- Users and groups granted access directly on this account.
+ Users, groups, and identities granted access directly on this account.
</CardDescription>
<CardAction>
<Button size="sm" variant="pam" onClick={() => setIsAssignOpen(true)}>
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AssignAccessModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AssignAccessModal.tsx
index 7d6c2d18fa..6f86fdbeea 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AssignAccessModal.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AssignAccessModal.tsx
@@ -133,7 +133,7 @@ export const AssignAccessModal = ({
const { currentOrg } = useOrganization();
const { data: orgUsers } = useGetOrgUsers(currentOrg.id);
const { data: orgGroups } = useGetOrganizationGroups(currentOrg.id);
- const { data: orgIdentities } = useGetIdentityMembershipOrgs({ organizationId: currentOrg.id });
+ const { data: orgIdentities } = useGetIdentityMembershipOrgs({ organizationId: currentOrg.id, limit: 1000 });
const { data: productMembers } = useListPamProductMembers();
const { data: productGroups } = useListPamProductGroups();
const { data: productIdentities } = useListPamProductIdentities();
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderDetailSheet.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderDetailSheet.tsx
index 7ca1a88ec2..990a72288f 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderDetailSheet.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderDetailSheet.tsx
@@ -326,7 +326,7 @@ const PermissionsTab = ({ folderId }: { folderId: string }) => {
<Badge variant="pam">{resolvedMembers.length}</Badge>
</CardTitle>
<CardDescription>
- Users and groups with access to this folder and its accounts.
+ Users, groups, and identities with access to this folder and its accounts.
</CardDescription>
<CardAction>
<Button size="sm" variant="pam" onClick={() => setIsAssignOpen(true)}>