Skip to content

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

Initialize TrustedIP upon creating a new workspace

Tuan Dang9913b2fb6cc4
diff --git a/backend/src/helpers/workspace.ts b/backend/src/helpers/workspace.ts
index d79d6c4537..0f4e5dc6b8 100644
--- a/backend/src/helpers/workspace.ts
+++ b/backend/src/helpers/workspace.ts
@@ -5,6 +5,10 @@ import {
Secret,
Workspace,
} from "../models";
+import {
+ IPType,
+ TrustedIP
+} from "../ee/models";
import { createBot } from "../helpers/bot";
import { EELicenseService } from "../ee/services";
import { SecretService } from "../services";
@@ -40,6 +44,16 @@ export const createWorkspace = async ({
await SecretService.createSecretBlindIndexData({
workspaceId: workspace._id,
});
+
+ // initialize default trusted ip of 0.0.0.0/0
+ await new TrustedIP({
+ workspace: workspace._id,
+ ipAddress: "0.0.0.0",
+ type: IPType.IPV4,
+ prefix: 0,
+ isActive: true,
+ comment: ""
+ }).save()
await EELicenseService.refreshPlan(organizationId);