From patchwork Fri Apr 26 03:31:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2213 Return-Path: Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail01.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web07.i.ipfire.org (Postfix) with ESMTPS id 6BE7285BD81 for ; Thu, 25 Apr 2019 18:31:56 +0100 (BST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 44qkkz0Sp9z55JnP; Thu, 25 Apr 2019 18:31:55 +0100 (BST) Received: from tuxedo.stevee (212095005098.public.telering.at [212.95.5.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 44qkkw10qRz5161y; Thu, 25 Apr 2019 18:31:52 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904rsa; t=1556213512; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:openpgp:autocrypt; bh=a+cct9SDhU45W9BMsI07B9eQ56FfQsdo5pHFD4ED870=; b=USVicrjd6810sTAL4BFBgQPh9TRZvalu1iYkg8pRNhpXJB4PIIwhpmPdPPbUPBNTgn4+Tx 24td8DtDKvoyK3MGz+mx1nc0PsJd9jr0wzXuaPepy1KqwZgw7GweKIdD2w4p10YgAMFRQ7 LIfF++Cs+rAjnAU5VGcX9CNy/qFmEGqktI8A/Cl89TYedCPj456PpHJRu7r2eDlCOVDOT2 v7ERHW1IPSn+Y+UZTx6gG9i0BbCDhC+UbVKxNktANrQXSW4eNDNyx2+qEXd2bEnl7ruExn fRgBEEjpeHgfwrAWZWwNwou2bWqcMWT5guTIfAFrCFFEahDVMAr0/XzTDtvrZQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904ed25519; t=1556213512; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:openpgp:autocrypt; bh=a+cct9SDhU45W9BMsI07B9eQ56FfQsdo5pHFD4ED870=; b=RC0aBKzZBo7Fx+JaIMIwP+ARc7zGWTQUsMoSF3cEkH1NzgHy+Qe0BSNqaf/J9fxwfX4FrX 4y9t9Oh1YA4PJpCQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 1/3] firewall: Use seperate firewall chains for passing traffic to the IPS Date: Thu, 25 Apr 2019 19:31:46 +0200 Message-Id: <20190425173148.3868-1-stefan.schantl@ipfire.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=stevee smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Create and use seperate iptables chain called IPS_INPUT, IPS_FORWARD and IPS_OUTPUT to be more flexible which kind of traffic should be passed to suricata. Reference #12062 Signed-off-by: Stefan Schantl --- src/initscripts/system/firewall | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/initscripts/system/firewall b/src/initscripts/system/firewall index be6c9169f..da89857d8 100644 --- a/src/initscripts/system/firewall +++ b/src/initscripts/system/firewall @@ -186,10 +186,12 @@ iptables_init() { iptables -A FORWARD -j GUARDIAN # IPS (suricata) chains - iptables -N IPS - iptables -A INPUT -j IPS - iptables -A FORWARD -j IPS - iptables -A OUTPUT -j IPS + iptables -N IPS_INPUT + iptables -N IPS_FORWARD + iptables -N IPS_OUTPUT + iptables -A INPUT -j IPS_INPUT + iptables -A FORWARD -j IPS_FORWARD + iptables -A OUTPUT -j IPS_OUTPUT # Block non-established IPsec networks iptables -N IPSECBLOCK