mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
feat(server): removed local ip check for self hosted users in secret rotation
This commit is contained in:
+9
-5
@@ -90,16 +90,20 @@ export const secretRotationDbFn = async ({
|
|||||||
const appCfg = getConfig();
|
const appCfg = getConfig();
|
||||||
|
|
||||||
const ssl = ca ? { rejectUnauthorized: false, ca } : undefined;
|
const ssl = ca ? { rejectUnauthorized: false, ca } : undefined;
|
||||||
|
const isCloud = Boolean(appCfg.LICENSE_SERVER_KEY); // quick and dirty way to check if its cloud or not
|
||||||
const dbHost = appCfg.DB_HOST || getDbConnectionHost(appCfg.DB_CONNECTION_URI);
|
const dbHost = appCfg.DB_HOST || getDbConnectionHost(appCfg.DB_CONNECTION_URI);
|
||||||
|
|
||||||
|
if (
|
||||||
|
isCloud &&
|
||||||
|
// internal ips
|
||||||
|
(host === "host.docker.internal" || host.match(/^10\.\d+\.\d+\.\d+/) || host.match(/^192\.168\.\d+\.\d+/))
|
||||||
|
)
|
||||||
|
throw new Error("Invalid db host");
|
||||||
if (
|
if (
|
||||||
host === "localhost" ||
|
host === "localhost" ||
|
||||||
host === "127.0.0.1" ||
|
host === "127.0.0.1" ||
|
||||||
// database infisical uses
|
// database infisical uses
|
||||||
dbHost === host ||
|
dbHost === host
|
||||||
// internal ips
|
|
||||||
host === "host.docker.internal" ||
|
|
||||||
host.match(/^10\.\d+\.\d+\.\d+/) ||
|
|
||||||
host.match(/^192\.168\.\d+\.\d+/)
|
|
||||||
)
|
)
|
||||||
throw new Error("Invalid db host");
|
throw new Error("Invalid db host");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user