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
Merge remote-tracking branch 'origin/main' into pam-revamp
bernie-g2b8a5789a0e4
diff --cc backend/src/@types/fastify.d.tsindex ad8c731cb2,a7a0bec039..0f3c99388d--- a/backend/src/@types/fastify.d.ts+++ b/backend/src/@types/fastify.d.ts@@@ -403,6 -408,8 +406,7 @@@ declare module "fastify"microsoftTeams: TMicrosoftTeamsServiceFactory;assumePrivileges: TAssumePrivilegeServiceFactory;insights: TInsightsServiceFactory;+ auditReport: TAuditReportServiceFactory;- pamInsights: TPamInsightsServiceFactory;relay: TRelayServiceFactory;gatewayV2: TGatewayV2ServiceFactory;gatewayPool: TGatewayPoolServiceFactory;diff --cc backend/src/ee/services/audit-log/audit-log-types.tsindex cebdf472ab,0374d8b944..0b046ee80d--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@@ -7655,7 -8061,16 +7720,11 @@@ export type Event| ViewSecretManagementInsightsSummaryEvent| ViewInsightsSecretsDuplicationEvent| ViewSecretManagementInsightsCountsEvent+ | CreateAuditReportEvent+ | GetAuditReportsEvent+ | GetAuditReportEvent+ | DeleteAuditReportEvent| ViewAuditLogsEvent- | ViewPamInsightsSummaryEvent- | ViewPamInsightsSessionActivityEvent- | ViewPamInsightsTopActorsEvent- | ViewPamInsightsResourceBreakdownEvent- | ViewPamInsightsRotationCalendarEvent| ProjectRoleCreateEvent| ProjectRoleUpdateEvent| ProjectRoleDeleteEventdiff --cc backend/src/ee/services/permission/project-permission.tsindex e122e2c9b0,83d45ee860..bce922a4ce--- a/backend/src/ee/services/permission/project-permission.ts+++ b/backend/src/ee/services/permission/project-permission.ts@@@ -266,9 -266,45 +266,11 @@@ export enum ProjectPermissionAuditLogsA}export enum ProjectPermissionInsightsActions {- Read = "read"+ Read = "read",+ GenerateReport = "generate-report",+ DeleteReport = "delete-report"}-export enum ProjectPermissionPamAccountActions {- Access = "access",- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete",- TriggerRotation = "trigger-rotation",- ReadCredentials = "read-credentials"-}--export enum ProjectPermissionPamSessionActions {- Read = "read",- Terminate = "terminate"-}--export enum ProjectPermissionPamAccountPolicyActions {- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete"-}--export enum ProjectPermissionPamInsightsActions {- Read = "read"-}--export enum ProjectPermissionPamDiscoveryActions {- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete",- RunScan = "run-scan"-}-export enum ProjectPermissionMcpEndpointActions {Read = "read",Create = "create",@@@ -534,6 -585,32 +543,11 @@@ export type HoneyTokenSubjectFields =secretPath: string;};+ export type ProjectFolderGrantSubjectFields = {+ environment: string;+ secretPath: string;+ };+-export type PamAccountSubjectFields = {- resourceName?: string;- resourceType?: string;- domainName?: string;- domainType?: string;- accountName: string;- metadata?: { key: string; value: string }[];-};--export type PamResourceSubjectFields = {- name: string;- resourceType: string;- metadata?: { key: string; value: string }[];-};--export type PamDomainSubjectFields = {- name: string;- domainType: string;- metadata?: { key: string; value: string }[];-};-export type ProjectPermissionSet =| [ProjectPermissionSecretActions,diff --cc backend/src/queue/queue-service.tsindex 131da114d5,86bf9b8626..f240ef2f0d--- a/backend/src/queue/queue-service.ts+++ b/backend/src/queue/queue-service.ts@@@ -99,7 -100,9 +99,8 @@@ export enum QueueNameInvalidateCache = "invalidate-cache",SecretScanningV2 = "secret-scanning-v2",UserNotification = "user-notification",+ AuditReportGeneration = "audit-report-generation",PamSessionExpiration = "pam-session-expiration",- PamSessionAiSummary = "pam-session-ai-summary",PkiAcmeChallengeValidation = "pki-acme-challenge-validation",PkiDiscoveryScan = "pki-discovery-scan",AppConnectionCredentialRotation = "app-connection-credential-rotation",@@@ -162,9 -166,12 +163,10 @@@ export enum QueueJobsDailyReminders = "daily-reminders",SecretReminderMigration = "secret-reminder-migration",UserNotification = "user-notification-job",+ GenerateAuditReport = "generate-audit-report-job",HealthAlert = "health-alert",CertificateV3DailyAutoRenewal = "certificate-v3-daily-auto-renewal",- PamAccountRotation = "pam-account-rotation",PamSessionExpiration = "pam-session-expiration",- PamSessionAiSummary = "pam-session-ai-summary-job",PkiAcmeChallengeValidation = "pki-acme-challenge-validation",PkiDiscoveryRunScan = "pki-discovery-run-scan",PkiDiscoveryScheduledScan = "pki-discovery-scheduled-scan",diff --cc backend/src/server/routes/index.tsindex 3e858dc931,171ef8d466..d21e82d52d--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@@ -3767,6 -3938,8 +3821,7 @@@ export const registerRoutes = asyncmicrosoftTeams: microsoftTeamsService,assumePrivileges: assumePrivilegeService,insights: insightsService,+ auditReport: auditReportService,- pamInsights: pamInsightsService,githubOrgSync: githubOrgSyncConfigService,gitHubApp: gitHubAppService,honeyTokenConfig: honeyTokenConfigService,diff --cc frontend/src/helpers/project.tsindex 3c6beaf2f8,7770a06ea5..a39283e60e--- a/frontend/src/helpers/project.ts+++ b/frontend/src/helpers/project.ts@@@ -140,7 -139,8 +140,8 @@@ export const getProjectTitle = (type: P[ProjectType.CertificateManager]: "Certificate Manager",[ProjectType.SSH]: "SSH",[ProjectType.SecretScanning]: "Secret Scanning",- [ProjectType.PAM]: "Privileged Access Manager"- [ProjectType.PAM]: "PAM",++ [ProjectType.PAM]: "Privileged Access Manager",+ [ProjectType.AI]: "AI"};return titleConvert[type] || type;};diff --cc frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsxindex 4daedd925a,49dfc7b99b..67b681e3f4--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx@@@ -78,17 -83,124 +96,130 @@@ const PRODUCT_DEFINITIONS: ProductDefinisSingleton: true,roles: CERT_MANAGER_ROLES},- { type: ProjectType.KMS, name: "KMS", isSingleton: false },- { type: ProjectType.SSH, name: "SSH", isSingleton: false },- { type: ProjectType.SecretScanning, name: "Secret Scanning", isSingleton: false },- { type: ProjectType.PAM, name: "Privileged Access Manager", isSingleton: true, roles: PAM_ROLES },- { type: ProjectType.AI, name: "AI", isSingleton: false }+ { type: ProjectType.KMS, name: getProjectTitle(ProjectType.KMS), isSingleton: false },+ { type: ProjectType.SSH, name: getProjectTitle(ProjectType.SSH), isSingleton: false },+ {+ type: ProjectType.SecretScanning,+ name: getProjectTitle(ProjectType.SecretScanning),+ isSingleton: false++ },++ {++ type: ProjectType.PAM,++ name: getProjectTitle(ProjectType.PAM),++ isSingleton: true,++ roles: PAM_ROLES+ }];+ // Render each product with its shared project icon (getProjectLucideIcon) so the select matches the+ // Projects pages and the org sidebar.+ const ProductOption = ({ isSelected, children, ...props }: OptionProps<ProductDefinition>) => {+ const Icon = getProjectLucideIcon(props.data.type);+ return (+ <components.Option isSelected={isSelected} {...props}>+ <div className="flex flex-row items-center gap-2">+ <Icon className="size-4 shrink-0 text-muted" />+ <p className="mr-auto truncate">{children}</p>+ {isSelected && <CheckIcon className="ml-2 size-4 shrink-0" />}+ </div>+ </components.Option>+ );+ };++ const ProductSingleValue = ({ children, ...props }: SingleValueProps<ProductDefinition>) => {+ const Icon = getProjectLucideIcon(props.data.type);+ return (+ <components.SingleValue {...props}>+ <div className="flex flex-row items-center gap-2">+ <Icon className="size-4 shrink-0 text-muted" />+ <span className="truncate">{children}</span>+ </div>+ </components.SingleValue>+ );+ };+const EmailSchema = z.string().email().min(1).trim().toLowerCase();+ // Zod's .email() accepts addresses the backend/DB reject: domain labels over 63 chars+ // (backend/src/lib/validator/validate-email.ts) and emails longer than the users table's+ // varchar(255) email/username columns. Mirror both here so oversized/malformed addresses are+ // caught inline instead of failing with a 400 (bad domain) or 500 (too long) from the API.+ const MAX_EMAIL_LENGTH = 255;+ const MAX_DOMAIN_LABEL_LENGTH = 63;+ const DOMAIN_LABEL_REGEX = /^[a-zA-Z0-9-]+$/;+ const TLD_REGEX = /^[a-zA-Z0-9]+$/;++ const isValidEmailDomain = (domain: string) => {+ const labels = domain.split(".");+ if (labels.length < 2) return false;++ const tld = labels[labels.length - 1];+ if (tld.length < 2 || !TLD_REGEX.test(tld)) return false;++ return labels.every(+ (label) =>+ label.length > 0 &&+ label.length <= MAX_DOMAIN_LABEL_LENGTH &&+ !label.startsWith("-") &&+ !label.endsWith("-") &&+ DOMAIN_LABEL_REGEX.test(label)+ );+ };++ const isValidEmail = (email: string) =>+ email.length <= MAX_EMAIL_LENGTH &&+ EmailSchema.safeParse(email).success &&+ isValidEmailDomain(email.slice(email.indexOf("@") + 1));++ // Mirror the backend cap (inviteeEmails.array().max(100)) so oversized invites are rejected inline+ // before hitting the API.+ const MAX_INVITE_EMAILS = 100;++ const parseEmailList = (value: string) =>+ value+ .split(",")+ .map((email) => email.trim())+ .filter(Boolean);+const addMemberFormSchema = z.object({- emails: z.string().min(1).trim().toLowerCase(),+ emails: z+ .string()+ .trim()+ .toLowerCase()+ .superRefine((value, ctx) => {+ const emails = parseEmailList(value);++ if (!emails.length) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ message: "Please enter at least one email address."+ });+ return;+ }++ if (emails.length > MAX_INVITE_EMAILS) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ message: `You can invite up to ${MAX_INVITE_EMAILS} users at a time.`+ });+ }++ const invalidEmails = emails.filter((email) => !isValidEmail(email));++ if (invalidEmails.length) {+ const preview = invalidEmails+ .slice(0, 3)+ .map((email) => (email.length > 40 ? `${email.slice(0, 40)}...` : email))+ .join(", ");+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ message:+ invalidEmails.length > 3+ ? `${invalidEmails.length} invalid email addresses (e.g. ${preview}).`+ : `Invalid email address${invalidEmails.length > 1 ? "es" : ""}: ${preview}.`+ });+ }+ }),product: z.object({type: z.nativeEnum(ProjectType),