Skip to content

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

Merge branch 'main' into feat/showWarningOnImportedSecretDeletion

carlosmonastyrskiab566bcbe418
diff --cc backend/src/server/routes/v1/dashboard-router.ts
index d27e53bb50,bcb0a949a5..60ec9143c1
--- a/backend/src/server/routes/v1/dashboard-router.ts
+++ b/backend/src/server/routes/v1/dashboard-router.ts
@@@ -470,19 -575,8 +575,20 @@@ export const registerDashboardRouter =
totalFolderCount: z.number().optional(),
totalDynamicSecretCount: z.number().optional(),
totalSecretCount: z.number().optional(),
- totalCount: z.number(),
+ importedBy: z
+ .object({
+ envName: z.string(),
+ folders: z
+ .object({
+ folderName: z.string(),
+ secrets: z.array(z.string()).optional()
+ })
+ .array()
+ })
+ .array()
- .optional()
++ .optional(),
+ totalSecretRotationCount: z.number().optional(),
+ totalCount: z.number()
})
}
},
@@@ -711,15 -835,39 +847,48 @@@
}
}
+ const importedBy = await server.services.secretImport.getFolderIsImportedBy({
+ path: secretPath,
+ environment,
+ projectId,
+ actor: req.permission.type,
+ actorId: req.permission.id,
+ actorAuthMethod: req.permission.authMethod,
+ actorOrgId: req.permission.orgId
+ });
+ if (secrets?.length || secretRotations?.length) {
+ const secretCount =
+ (secrets?.length ?? 0) +
+ (secretRotations?.flatMap((rotation) => rotation.secrets.filter((secret) => Boolean(secret))).length ?? 0);
+
+ await server.services.auditLog.createAuditLog({
+ projectId,
+ ...req.auditLogInfo,
+ event: {
+ type: EventType.GET_SECRETS,
+ metadata: {
+ environment,
+ secretPath,
+ numberOfSecrets: secretCount
+ }
+ }
+ });
+
+ if (getUserAgentType(req.headers["user-agent"]) !== UserAgentType.K8_OPERATOR) {
+ await server.services.telemetry.sendPostHogEvents({
+ event: PostHogEventTypes.SecretPulled,
+ distinctId: getTelemetryDistinctId(req),
+ properties: {
+ numberOfSecrets: secretCount,
+ workspaceId: projectId,
+ environment,
+ secretPath,
+ channel: getUserAgentType(req.headers["user-agent"]),
+ ...req.auditLogInfo
+ }
+ });
+ }
+ }
return {
imports,
@@@ -730,9 -879,13 +900,14 @@@
totalFolderCount,
totalDynamicSecretCount,
totalSecretCount,
+ totalSecretRotationCount,
++ importedBy,
totalCount:
- (totalImportCount ?? 0) + (totalFolderCount ?? 0) + (totalDynamicSecretCount ?? 0) + (totalSecretCount ?? 0),
- importedBy
+ (totalImportCount ?? 0) +
+ (totalFolderCount ?? 0) +
+ (totalDynamicSecretCount ?? 0) +
+ (totalSecretCount ?? 0) +
+ (totalSecretRotationCount ?? 0)
};
}
});
diff --cc frontend/src/hooks/api/dashboard/types.ts
index 4dc2ac8f76,6a3e9ba7c1..4b74b5f4ed
--- a/frontend/src/hooks/api/dashboard/types.ts
+++ b/frontend/src/hooks/api/dashboard/types.ts
@@@ -30,8 -39,8 +39,9 @@@ export type DashboardProjectSecretsDeta
totalFolderCount?: number;
totalDynamicSecretCount?: number;
totalSecretCount?: number;
+ totalSecretRotationCount?: number;
totalCount: number;
+ importedBy?: { envName: string; folders: { folderName: string; secrets?: string[] }[] }[];
};
export type DashboardProjectSecretsByKeys = {
diff --cc frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
index e9f212eae2,cd2a1aee1e..9be9f291fd
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
@@@ -207,7 -219,7 +219,8 @@@ const Page = () =>
totalDynamicSecretCount = 0,
totalSecretCount = 0,
totalCount = 0,
- importedBy
++ importedBy,
+ totalSecretRotationCount = 0
} = data ?? {};
useResetPageHelper({