Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat(insights): simplify the secret access sheet: table first, no score panel or ghost readers
Dimitris Staratzis1b1c6fa63c4a
diff --git a/frontend/src/components/secrets/SecretAccessGraph/SecretAccessGraph.tsx b/frontend/src/components/secrets/SecretAccessGraph/SecretAccessGraph.tsxindex c2a1dec841..a671def45d 100644--- a/frontend/src/components/secrets/SecretAccessGraph/SecretAccessGraph.tsx+++ b/frontend/src/components/secrets/SecretAccessGraph/SecretAccessGraph.tsx@@ -17,12 +17,11 @@ import { MaximizeIcon, MinusIcon, PlusIcon } from "lucide-react";import { IconButton } from "@app/components/v3";import { buildAccessGraph, TAccessGraphInput } from "./buildAccessGraph";-import { BandLabelNode, GhostNode, LaneEdge, ReaderNode, SecretNode } from "./nodes";+import { BandLabelNode, LaneEdge, ReaderNode, SecretNode } from "./nodes";const NODE_TYPES = {reader: ReaderNode,secret: SecretNode,- ghost: GhostNode,bandLabel: BandLabelNode};@@ -121,7 +120,7 @@ const SecretAccessGraphContent = ({ input }: Props) => {onPaneClick={() => setFocusedId(undefined)}nodeTypes={NODE_TYPES}edgeTypes={EDGE_TYPES}- proOptions={{ hideAttribution: true }}+ proOptions={{ hideAttribution: false }}nodesDraggable={false}nodesConnectable={false}edgesFocusable={false}@@ -145,11 +144,12 @@ const SecretAccessGraphContent = ({ input }: Props) => {);};-// Outside the scrolling element, so the controls stay put however tall the graph gets.+// Outside the scrolling element, so the controls stay put however tall the graph gets; top right, clear of the+// readers and of the React Flow attribution in the bottom right.const ZoomControls = () => {const { zoomIn, zoomOut, setViewport } = useReactFlow();return (- <div className="absolute right-3 bottom-3 z-10 flex flex-col overflow-hidden rounded-md border border-border bg-card">+ <div className="absolute top-3 right-3 z-10 flex flex-col overflow-hidden rounded-md border border-border bg-card"><IconButton variant="ghost" size="xs" aria-label="Zoom in" onClick={() => zoomIn()}><PlusIcon /></IconButton>diff --git a/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.test.ts b/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.test.tsindex 86f9ede9ce..92e46af0f1 100644--- a/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.test.ts+++ b/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.test.ts@@ -48,7 +48,6 @@ const input: TAccessGraphInput = {{ id: "devs", name: "devs", memberCount: 2 },{ id: "ops", name: "ops", memberCount: 1 }],- ghosts: [{ id: "gone", name: null, type: "identity", lastReadAt: "2026-10-10T00:00:00.000Z" }],hasReadActivity: true,trackedSince: "2026-09-19T00:00:00.000Z"};@@ -59,17 +58,14 @@ describe("buildAccessGraph", () => {const readerNode = (type: "user" | "identity", id: string) =>nodeById.get(readerNodeId({ type, id }))!;- test("lays readers and the secret out in two columns with ghosts under the readers, and no group boxes", () => {+ test("lays readers and the secret out in two columns, with no other boxes", () => {const secret = nodeById.get(SECRET_NODE_ID)!;- const ghost = nodeById.get("ghost-identity-gone")!;- expect(readerNode("user", "alice").position.x).toBeLessThan(secret.position.x);- expect(ghost.position.x).toBe(readerNode("user", "alice").position.x);- expect(ghost.position.y).toBeGreaterThan(- Math.max(...input.readers.map((entry) => readerNode(entry.type, entry.id).position.y))+ input.readers.forEach((entry) => {+ expect(readerNode(entry.type, entry.id).position.x).toBeLessThan(secret.position.x);+ });+ expect(nodes.every((node) => ["reader", "secret", "bandLabel"].includes(node.type ?? ""))).toBe(+ true);- expect(- nodes.every((node) => ["reader", "secret", "ghost", "bandLabel"].includes(node.type ?? ""))- ).toBe(true);});test("puts unused access first, then readers too new to judge, then readers, then admins", () => {@@ -87,7 +83,6 @@ describe("buildAccessGraph", () => {expect(readerNode("identity", "ci").data.groupNames).toEqual(["devs", "ops"]);expect(readerNode("user", "bob").data.groupNames).toEqual(["devs"]);expect(readerNode("user", "alice").data.groupNames).toEqual([]);- expect(edges.some((edge) => edge.source.startsWith("ghost-"))).toBe(false);});test("bends each line in its own lane, in the gap before the secret", () => {diff --git a/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.ts b/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.tsindex 5c0d0eb141..c32259004a 100644--- a/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.ts+++ b/frontend/src/components/secrets/SecretAccessGraph/buildAccessGraph.ts@@ -25,14 +25,6 @@ export type TAccessGraphGroup = {memberCount: number;};-export type TAccessGraphGhost = {- id: string;- // Null when the reader has since been deleted.- name: string | null;- type: TAccessGraphActorType;- lastReadAt: string;-};-export type TAccessGraphSecret = {key: string;environment: string;@@ -44,7 +36,6 @@ export type TAccessGraphInput = {secret: TAccessGraphSecret;readers: TAccessGraphReader[];groups: TAccessGraphGroup[];- ghosts: TAccessGraphGhost[];// False when the viewer cannot see read activity, so no edge claims a read or its absence.hasReadActivity: boolean;trackedSince?: string;@@ -57,16 +48,13 @@ export type TReaderNodeData = {};export type TSecretNodeData = { secret: TAccessGraphSecret };-export type TGhostNodeData = { ghost: TAccessGraphGhost };export type TBandLabelNodeData = { label: string; detail: string; tone?: "neutral" | "warning" };export type TLaneEdgeData = { centerX: number };export const NODE_WIDTH = 240;const READER_NODE_HEIGHT = 74;const SECRET_NODE_HEIGHT = 104;-const GHOST_NODE_HEIGHT = 74;const BAND_LABEL_HEIGHT = 36;-const BAND_GAP = 24;const HEADER_GAP = 8;const COLUMN_GAP = 160;const ROW_GAP = 14;@@ -139,7 +127,6 @@ export const buildAccessGraph = ({secret,readers,groups,- ghosts,hasReadActivity}: TAccessGraphInput) => {const nodes: Node[] = [];@@ -216,37 +203,7 @@ export const buildAccessGraph = ({data: { secret } satisfies TSecretNodeData});- // No edges from here on: a ghost reader has no current path to the secret, and drawing one would say- // they can still read the value.- const firstGhostY = readersBottom + BAND_GAP + BAND_LABEL_HEIGHT + HEADER_GAP;- const ghostY = stackColumn(firstGhostY, GHOST_NODE_HEIGHT);- if (ghosts.length) {- nodes.push(- bandLabelNode("band-ghosts", MARGIN, firstGhostY, {- label: `Ghost readers · ${ghosts.length}`,- detail: "read it, but have no path to it now",- tone: "warning"- })- );- ghosts.forEach((ghost, index) => {- nodes.push({- id: `ghost-${ghost.type}-${ghost.id}`,- type: "ghost",- position: { x: MARGIN, y: ghostY(index) },- width: NODE_WIDTH,- height: GHOST_NODE_HEIGHT,- selectable: false,- data: { ghost } satisfies TGhostNodeData- });- });- }-- const contentHeight =- Math.max(- readersBottom,- secretY + SECRET_NODE_HEIGHT,- ghosts.length ? firstGhostY + columnHeight(ghosts.length, GHOST_NODE_HEIGHT) : 0- ) + MARGIN;+ const contentHeight = Math.max(readersBottom, secretY + SECRET_NODE_HEIGHT) + MARGIN;const contentWidth = secretColumnX + NODE_WIDTH + MARGIN;return { nodes, edges, contentHeight, contentWidth };diff --git a/frontend/src/components/secrets/SecretAccessGraph/nodes.tsx b/frontend/src/components/secrets/SecretAccessGraph/nodes.tsxindex eb7b21623b..cc0a155fa4 100644--- a/frontend/src/components/secrets/SecretAccessGraph/nodes.tsx+++ b/frontend/src/components/secrets/SecretAccessGraph/nodes.tsx@@ -8,7 +8,7 @@ import {Position} from "@xyflow/react";import { format } from "date-fns";-import { HardDriveIcon, KeyIcon, UserIcon } from "lucide-react";+import { HardDriveIcon, KeyIcon, UserIcon, UsersIcon } from "lucide-react";import { SecretExposureBadge } from "@app/components/secrets/SecretExposureScore";import { formatReadDay } from "@app/components/secrets/SecretReadStatusBadge";@@ -18,7 +18,6 @@ import { cn } from "@app/components/v3/utils";import {TAccessGraphActorType,TBandLabelNodeData,- TGhostNodeData,TLaneEdgeData,TReaderNodeData,TSecretNodeData@@ -45,6 +44,7 @@ const AccessPath = ({ isDirect, groupNames }: { isDirect: boolean; groupNames: s<Tooltip><TooltipTrigger asChild><span className="flex min-w-0 items-center gap-1 text-xs text-muted">+ <UsersIcon className="size-3 shrink-0 text-accent" aria-label="group" /><span className="truncate">{isDirect ? "Direct · via" : "Via"} {first}</span>@@ -93,7 +93,7 @@ export const ReaderNode = ({ data }: NodeProps & { data: TReaderNodeData }) => {)}><div className="flex min-w-0 items-center gap-1.5">- <TypeIcon className="size-3.5 shrink-0 text-muted" aria-label={TYPE_LABEL[reader.type]} />+ <TypeIcon className="size-3.5 shrink-0 text-accent" aria-label={TYPE_LABEL[reader.type]} /><p className="truncate text-xs font-medium text-foreground">{reader.name}</p>{reader.isAdmin && (<Badge variant="neutral" className="ml-auto shrink-0">@@ -129,34 +129,6 @@ export const SecretNode = ({ data }: NodeProps & { data: TSecretNodeData }) => {);};-// A reader of this value who cannot read it today. No handle on purpose: there is no current path from-// them to the secret, and an edge would say otherwise.-export const GhostNode = ({ data }: NodeProps & { data: TGhostNodeData }) => {- const { ghost } = data;- const TypeIcon = TYPE_ICON[ghost.type];- return (- <div className="flex h-full w-full flex-col justify-center gap-1 rounded-md border border-warning/40 bg-warning/5 px-3">- <div className="flex min-w-0 items-center gap-1.5">- <TypeIcon className="size-3.5 shrink-0 text-muted" aria-label={TYPE_LABEL[ghost.type]} />- <p- className={cn(- "truncate text-xs font-medium",- ghost.name ? "text-foreground" : "text-muted italic"- )}- >- {ghost.name ?? `Deleted ${TYPE_LABEL[ghost.type]}`}- </p>- </div>- <span className="truncate text-xs text-warning">- {ghost.name ? "Access removed" : "Deleted"}, still knows the value- </span>- <span className="truncate text-xs text-muted">- Read {formatReadDay(ghost.lastReadAt).toLowerCase()}- </span>- </div>- );-};-// A section heading inside the canvas, so it takes part in the same column math as the nodes it labels.export const BandLabelNode = ({ data }: NodeProps & { data: TBandLabelNodeData }) => (<div className="flex h-full w-full flex-col justify-end gap-0.5 whitespace-nowrap">diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretAccessInsights.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretAccessInsights.tsxindex 3656e26c02..07d28188cb 100644--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretAccessInsights.tsx+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretAccessInsights.tsx@@ -23,7 +23,6 @@ import {import { createNotification } from "@app/components/notifications";import { SecretAccessGraph, TAccessGraphInput } from "@app/components/secrets/SecretAccessGraph";-import { SecretExposurePanel } from "@app/components/secrets/SecretExposureScore";import {SecretReadStatusBadge,TReaderReadStatus@@ -566,8 +565,7 @@ export function SecretAccessInsights({readActivityDescription = `Reads by users and machine identities since ${format(new Date(readActivity.trackedSince), "PP")}, including reads through imports and references.`;}- // Readers connect to the secret directly, or through the groups that grant them the value; ghost readers- // hang below with no path to it.+ // Every reader who can read the value, directly or through a group, with one line each to the secret.const graphInput = useMemo<TAccessGraphInput | undefined>(() => {if (!secretAccessList) return undefined;const groups = secretAccessList.groups.filter((group) => grantsReadValue(group.allowedActions));@@ -637,12 +635,6 @@ export function SecretAccessInsights({name: group.name,memberCount: group.userIds.length + group.identityIds.length})),- ghosts: (readActivity?.ghostReaders ?? []).map((ghost) => ({- id: ghost.actorId,- name: ghost.actorName,- type: ghost.actorType,- lastReadAt: ghost.lastReadAt- })),hasReadActivity: Boolean(canReadInsights && readActivity),trackedSince: readActivity?.trackedSince};@@ -800,20 +792,8 @@ export function SecretAccessInsights({return (<><div className="flex thin-scrollbar flex-col gap-4 overflow-y-auto p-4">- {canReadInsights && !readActivityError && (- <SecretExposurePanel exposure={readActivity?.exposure} />- )}<div className="flex items-center gap-2"><ButtonGroup>- <Button- size="xs"- variant={view === "graph" ? "project" : "outline"}- aria-pressed={view === "graph"}- onClick={() => setView("graph")}- >- <NetworkIcon />- Graph- </Button><Buttonsize="xs"variant={view === "table" ? "project" : "outline"}@@ -823,6 +803,15 @@ export function SecretAccessInsights({<TableIcon />Table</Button>+ <Button+ size="xs"+ variant={view === "graph" ? "project" : "outline"}+ aria-pressed={view === "graph"}+ onClick={() => setView("graph")}+ >+ <NetworkIcon />+ Graph+ </Button></ButtonGroup>{view === "table" && (<>@@ -882,12 +871,13 @@ export function SecretAccessInsights({</DropdownMenu></>)}- {view === "graph" && <div className="flex-1" />}- <AddMemberPopover- secretKey={secretKey}- environment={environment}- secretPath={secretPath}- />+ {view === "table" && (+ <AddMemberPopover+ secretKey={secretKey}+ environment={environment}+ secretPath={secretPath}+ />+ )}</div>{view === "graph" &&(isLoading || !graphInput ? (@@ -1100,53 +1090,6 @@ export function SecretAccessInsights({</TableBody></Table>)}- {canReadInsights && readActivity && readActivity.ghostReaders.length > 0 && (- <div className="flex flex-col gap-3">- <div>- <h3 className="text-sm font-medium">Ghost Readers</h3>- <p className="text-xs text-muted">- Read this secret since {format(new Date(readActivity.trackedSince), "PP")} but- can no longer access it. They still know the value.- </p>- </div>- <Table>- <TableHeader>- <TableRow>- <TableHead className="w-48">Type</TableHead>- <TableHead>Name</TableHead>- <TableHead className="w-40">Last Read</TableHead>- </TableRow>- </TableHeader>- <TableBody>- {readActivity.ghostReaders.map((reader) => {- const { icon: TypeIcon, label: typeLabel } = TYPE_CONFIG[reader.actorType];- return (- <TableRow key={`${reader.actorType}-${reader.actorId}`}>- <TableCell>- <span className="flex items-center gap-2">- <TypeIcon className="size-4 text-accent" />- {typeLabel}- </span>- </TableCell>- <TableCell isTruncatable className="max-w-[180px] font-medium">- {reader.actorName ?? (- <span className="text-muted italic">- Deleted {reader.actorType === "user" ? "user" : "machine identity"}- </span>- )}- </TableCell>- <TableCell className="w-40 whitespace-nowrap">- <SecretReadStatusBadge- status={{ kind: "read", lastReadAt: reader.lastReadAt }}- />- </TableCell>- </TableRow>- );- })}- </TableBody>- </Table>- </div>- )}</>)}</div>