From 4fab8e1e24da93ae1ec93358445921c50f9c6c1a Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Thu, 29 Jan 2026 16:35:55 +0100 Subject: [PATCH 1/2] feat(ips): unify bypass types Simplify the configuration: the bypass is now valid both for source and destination --- .../security/ips/IpsCreateBypassDrawer.vue | 19 +------------------ .../security/ips/IpsDeleteBypassModal.vue | 9 ++------- .../security/ips/IpsFilterBypass.vue | 17 ++--------------- src/i18n/en.json | 4 ++-- src/i18n/it.json | 4 ++-- src/i18n/ta.json | 2 +- 6 files changed, 10 insertions(+), 45 deletions(-) diff --git a/src/components/standalone/security/ips/IpsCreateBypassDrawer.vue b/src/components/standalone/security/ips/IpsCreateBypassDrawer.vue index daffb3137..b4e5d667d 100644 --- a/src/components/standalone/security/ips/IpsCreateBypassDrawer.vue +++ b/src/components/standalone/security/ips/IpsCreateBypassDrawer.vue @@ -9,10 +9,7 @@ import { useI18n } from 'vue-i18n' import { ref, watch } from 'vue' import { ubusCall, ValidationError } from '@/lib/standalone/ubus' import { MessageBag } from '@/lib/validation' -import type { - AddressType, - Direction -} from '@/components/standalone/security/ips/IpsFilterBypass.vue' +import type { AddressType } from '@/components/standalone/security/ips/IpsFilterBypass.vue' import type { RadioOption } from '@nethesis/vue-components' const { t } = useI18n() @@ -31,7 +28,6 @@ watch( (value) => { if (value) { protocol.value = 'ipv4' - direction.value = 'src' ip.value = '' description.value = '' validationErrors.value.clear() @@ -44,13 +40,7 @@ const protocolOptions: RadioOption[] = [ { label: 'IPv6', id: 'ipv6' } ] -const directionOptions: RadioOption[] = [ - { label: t('standalone.ips.source_bypass'), id: 'src' }, - { label: t('standalone.ips.destination_bypass'), id: 'dst' } -] - const protocol = ref('ipv4') -const direction = ref('src') const ip = ref('') const description = ref('') const validationErrors = ref(new MessageBag()) @@ -64,7 +54,6 @@ function save() { validationErrors.value.clear() ubusCall('ns.snort', 'create-bypass', { protocol: protocol.value, - direction: direction.value, ip: ip.value, description: description.value }) @@ -109,12 +98,6 @@ function closeHandler() { :invalid-message="t(validationErrors.getFirstI18nKeyFor('ip'))" :label="t('standalone.ips.ip_address')" /> - { emit('deleted') @@ -94,11 +93,7 @@ function deleteBypass() { diff --git a/src/components/standalone/security/ips/IpsFilterBypass.vue b/src/components/standalone/security/ips/IpsFilterBypass.vue index f26f461a7..3d217fa46 100644 --- a/src/components/standalone/security/ips/IpsFilterBypass.vue +++ b/src/components/standalone/security/ips/IpsFilterBypass.vue @@ -35,11 +35,9 @@ import IpsEnabledBadge from '@/components/standalone/security/ips/IpsEnabledBadg import IpsDeleteBypassModal from '@/components/standalone/security/ips/IpsDeleteBypassModal.vue' import type { SortEvent } from '@nethesis/vue-components' -export type Direction = 'src' | 'dst' export type AddressType = 'ipv4' | 'ipv6' export type Bypass = { - direction: Direction protocol: AddressType ip: string description: string @@ -170,9 +168,6 @@ function handleDeleted() { {{ t('standalone.ips.bypass_address') }} - - {{ t('standalone.ips.bypass_direction') }} - {{ t('standalone.ips.description') }} @@ -180,7 +175,7 @@ function handleDeleted() { - + - + {{ item.ip }} - - - - {{ item.description }} diff --git a/src/i18n/en.json b/src/i18n/en.json index 6eca090ef..e23c2592e 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -2533,7 +2533,7 @@ "verify_oinkcode": "Test code", "oinkcode_invalid": "Invalid Oinkcode", "oinkcode_verified": "Verified", - "filter_bypass_description": "All traffic passing through the firewall is inspected by the IPS. Create a bypass to exclude specific source or destination IP addresses from IPS inspection.", + "filter_bypass_description": "All traffic passing through the firewall is inspected by the IPS. Create a bypass to exclude an IP address from IPS inspection.", "ips_enabled": "IPS enabled", "ips_disabled": "IPS disabled", "no_filter_bypass": "No filter bypass", @@ -2553,7 +2553,7 @@ "destination_bypass": "Destination bypass", "delete_bypass_modal_title": "Delete bypass", "delete_bypass_modal_w_description": "Delete bypass '{description}'?", - "delete_bypass_modal_wo_description": "Delete bypass with IP address '{ip}' and direction '{direction}'?", + "delete_bypass_modal_wo_description": "Delete bypass for IP address '{ip}'?", "delete_bypass_error": "Cannot delete bypass", "disabled_rules_description": "In some scenarios, rules may be too strict or cause too many false positives. To prevent this, you can disable specific rules. Disabled rules are not included in the Snort rule set.", "error_loading_disabled_rules": "Cannot load disabled rules", diff --git a/src/i18n/it.json b/src/i18n/it.json index 15513d13e..62c667e70 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -2469,7 +2469,7 @@ "destination_bypass": "Bypass destinazione", "suppressed_alerts_description": "Una regola di silenziamento dice all'IPS di ignorare una regola specifica per un indirizzo IP particolare o CIDR, pur valutandola per tutti gli altri indirizzi IP. Questo è utile quando una regola è generalmente efficace, ma genera falsi avvisi positivi per host specifici.", "security_description": "Massimizza la protezione con un alto numero di regole", - "delete_bypass_modal_wo_description": "Eliminare il bypass con l'indirizzo IP '{ip}' e direzione '{direction}?", + "delete_bypass_modal_wo_description": "Eliminare il bypass per l'indirizzo IP '{ip}'?", "delete_bypass_modal_title": "Elimina bypass", "no_rules_found": "Nessuna regola trovata", "enable_rule_error": "Impossibile abilitare la regola", @@ -2480,7 +2480,7 @@ "error_loading_events": "Impossibile caricare gli eventi", "ips_is_disabled_description": "Attivarlo nella pagina Impostazioni per avviare il monitoraggio di rete", "add_bypass": "Aggiungi bypass", - "filter_bypass_description": "Tutto il traffico che passa attraverso il firewall è ispezionato dall'IPS. Creare un bypass per escludere dall'IP indirizzi IP specifici per sorgente o destinazione.", + "filter_bypass_description": "Tutto il traffico che passa attraverso il firewall viene ispezionato dall'IPS. Crea un bypass per escludere un indirizzo IP dall'analisi dell'IPS.", "delete_bypass_modal_w_description": "Eliminare bypass '{description}'?", "delete_suppressed_alert_modal_title": "Elimina la regola di silenziamento", "sid_label": "Rule Signature ID (SID)", diff --git a/src/i18n/ta.json b/src/i18n/ta.json index b786af0a4..e4f71f745 100644 --- a/src/i18n/ta.json +++ b/src/i18n/ta.json @@ -2538,7 +2538,7 @@ "destination_bypass": "இலக்கு பைபாச்", "delete_bypass_modal_title": "பைபாசை நீக்கு", "delete_bypass_modal_w_description": "'{description}' பைபாசை நீக்கவா?", - "delete_bypass_modal_wo_description": "ஐபி முகவரி '{ip}' மற்றும் திசை '{direction}' உடன் பைபாசை நீக்கவா?", + "delete_bypass_modal_wo_description": "ஐபி முகவரி '{ip}' உடன் பைபாசை நீக்கவா?", "delete_bypass_error": "பைபாசை நீக்க முடியாது", "disabled_rules_description": "சில சூழ்நிலைகளில், விதிகள் மிகவும் கண்டிப்பானதாக இருக்கலாம் அல்லது பல தவறான நேர்மறைகளை ஏற்படுத்தலாம். இதைத் தடுக்க, நீங்கள் குறிப்பிட்ட விதிகளை முடக்கலாம். முடக்கப்பட்ட விதிகள் Snort விதி தொகுப்பில் சேர்க்கப்படவில்லை.", "error_loading_disabled_rules": "முடக்கப்பட்ட விதிகளை ஏற்ற முடியாது", From f37478aa82461e281885a0be0a399fc29e7f0f90 Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Thu, 29 Jan 2026 17:33:58 +0100 Subject: [PATCH 2/2] feat(snort): allow home net configuration --- .../standalone/security/ips/IpsSettings.vue | 66 ++++++++++++++++++- src/i18n/en.json | 5 +- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/components/standalone/security/ips/IpsSettings.vue b/src/components/standalone/security/ips/IpsSettings.vue index 2eb9bfc07..3b2451f43 100644 --- a/src/components/standalone/security/ips/IpsSettings.vue +++ b/src/components/standalone/security/ips/IpsSettings.vue @@ -5,6 +5,7 @@