From defe7b8f0b0ce3985ad9dd19cf13fd1683527ae9 Mon Sep 17 00:00:00 2001 From: carlosmonastyrski Date: Fri, 27 Jun 2025 13:37:57 -0300 Subject: [PATCH] feat(secret-sync): add blockLocalAndPrivateIpAddresses on secret-sync fns functions --- backend/src/services/secret-sync/zabbix/zabbix-sync-fns.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/services/secret-sync/zabbix/zabbix-sync-fns.ts b/backend/src/services/secret-sync/zabbix/zabbix-sync-fns.ts index a0e8a9e4f..6de70def8 100644 --- a/backend/src/services/secret-sync/zabbix/zabbix-sync-fns.ts +++ b/backend/src/services/secret-sync/zabbix/zabbix-sync-fns.ts @@ -1,4 +1,5 @@ import { request } from "@app/lib/config/request"; +import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator"; import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors"; import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns"; import { TSecretMap } from "@app/services/secret-sync/secret-sync-types"; @@ -184,6 +185,8 @@ export const ZabbixSyncFns = { syncSecrets: async (secretSync: TZabbixSyncWithCredentials, secretMap: TSecretMap) => { const { connection, environment, destinationConfig } = secretSync; const { apiToken, instanceUrl } = connection.credentials; + await blockLocalAndPrivateIpAddresses(instanceUrl); + const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined; let secrets: TZabbixSecret[] = []; try { @@ -226,6 +229,8 @@ export const ZabbixSyncFns = { removeSecrets: async (secretSync: TZabbixSyncWithCredentials, secretMap: TSecretMap) => { const { connection, destinationConfig } = secretSync; const { apiToken, instanceUrl } = connection.credentials; + await blockLocalAndPrivateIpAddresses(instanceUrl); + const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined; try { @@ -247,6 +252,7 @@ export const ZabbixSyncFns = { getSecrets: async (secretSync: TZabbixSyncWithCredentials) => { const { connection, destinationConfig } = secretSync; const { apiToken, instanceUrl } = connection.credentials; + await blockLocalAndPrivateIpAddresses(instanceUrl); const hostId = destinationConfig.scope === ZabbixSyncScope.Host ? destinationConfig.hostId : undefined; try {