Skip to content

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

fix(audit-log): remove organization ID from audit log metrics

Victor Hugo dos Santosed034480eb1a
diff --git a/backend/src/ee/services/audit-log/audit-log-queue.ts b/backend/src/ee/services/audit-log/audit-log-queue.ts
index 867e6451fe..09f67773a4 100644
--- a/backend/src/ee/services/audit-log/audit-log-queue.ts
+++ b/backend/src/ee/services/audit-log/audit-log-queue.ts
@@ -132,8 +132,7 @@ export const auditLogQueueServiceFactory = async ({
await keyStore.streamAdd(AUDIT_LOG_STREAM_KEY, "*", { data: JSON.stringify(entry) });
auditLogEnqueuedCounter.add(1, {
"audit_log.event_type": entry.event?.type ?? "unknown",
- "audit_log.actor_type": entry.actor?.type ?? "unknown",
- "infisical.organization.id": entry.orgId
+ "audit_log.actor_type": entry.actor?.type ?? "unknown"
});
};
diff --git a/backend/src/services/super-admin/super-admin-service.ts b/backend/src/services/super-admin/super-admin-service.ts
index d8145a422f..dacbaae5f2 100644
--- a/backend/src/services/super-admin/super-admin-service.ts
+++ b/backend/src/services/super-admin/super-admin-service.ts
@@ -541,7 +541,11 @@ export const superAdminServiceFactory = ({
orgName: initialOrganizationName
});
- await updateServerCfg({ initialized: true }, userInfo.user.id);
+ const shouldDisableSignUp = !appCfg.isCloud;
+ await updateServerCfg(
+ { initialized: true, ...(shouldDisableSignUp ? { allowSignUp: false } : {}) },
+ userInfo.user.id
+ );
const token = await authService.generateUserTokens({
userId: userInfo.user.id,
authMethod: AuthMethod.EMAIL,
@@ -669,7 +673,15 @@ export const superAdminServiceFactory = ({
return { identity: newIdentity, auth: tokenAuth, credentials: { token: generatedAccessToken } };
});
- await updateServerCfg({ initialized: true, adminIdentityIds: [identity.id] }, userInfo.user.id);
+ const shouldDisableSignUp = !appCfg.isCloud;
+ await updateServerCfg(
+ {
+ initialized: true,
+ adminIdentityIds: [identity.id],
+ ...(shouldDisableSignUp ? { allowSignUp: false } : {})
+ },
+ userInfo.user.id
+ );
return {
user: userInfo,
diff --git a/docs/self-hosting/guides/production-hardening.mdx b/docs/self-hosting/guides/production-hardening.mdx
index 7f8d6e0592..be92761c1b 100644
--- a/docs/self-hosting/guides/production-hardening.mdx
+++ b/docs/self-hosting/guides/production-hardening.mdx
@@ -143,6 +143,30 @@ Set proper site URL for your Infisical instance:
SITE_URL="https://app.infisical.com"
```
+#### Public Signups Are Disabled After Admin Setup
+
+<Warning>
+ Leaving self-service signups open on a publicly reachable instance means anyone
+ can create an account without an invitation, which widens your attack surface.
+ Several features let an authenticated user configure outbound requests to
+ destinations they supply (App Connections, Webhooks, Audit Log Streams, Dynamic
+ Secrets, and similar). Infisical already routes these through an SSRF-safe
+ client that blocks internal and private IP ranges by default (see
+ [SSRF Protection](#server-side-request-forgery-ssrf-protection) above).
+ Restricting who can reach those features limits exposure if that protection is ever relaxed (for example a
+ permissive `ALLOW_INTERNAL_IP_CONNECTIONS`).
+</Warning>
+
+On a self-hosted instance, self-service signups are **disabled by default** once
+the first super admin account is created. No configuration is required to get this
+hardened default. You can still invite users to your organization, and to
+provision additional users, prefer organization invitations over public signup.
+
+If you operate a trusted, internal instance and deliberately want open signups,
+re-enable them from the **Admin Console → Authentication** settings by setting
+**Allow user signups** to **Anyone**. The same control lets you disable signups
+again at any time.
+
#### SMTP Security
Use TLS for email communications: