From 50a361209b218483f5162d41b90ce0045a852f37 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 19 May 2016 14:25:09 +0900 Subject: add GroupOwner and NotDestination iptables Rules --- src/Propellor/Property/Firewall.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Firewall.hs b/src/Propellor/Property/Firewall.hs index ce0befcd..3ea19ffa 100644 --- a/src/Propellor/Property/Firewall.hs +++ b/src/Propellor/Property/Firewall.hs @@ -79,6 +79,12 @@ toIpTableArg (TCPFlags m c) = , intercalate "," (map show c) ] toIpTableArg TCPSyn = ["--syn"] +toIpTableArg (GroupOwner (Group g)) = + [ "-m" + , "owner" + , "--gid-owner" + , g + ] toIpTableArg (Source ipwm) = [ "-s" , intercalate "," (map fromIPWithMask ipwm) @@ -87,6 +93,11 @@ toIpTableArg (Destination ipwm) = [ "-d" , intercalate "," (map fromIPWithMask ipwm) ] +toIpTableArg (NotDestination ipwm) = + [ "!" + , "-d" + , intercalate "," (map fromIPWithMask ipwm) + ] toIpTableArg (NatDestination ip mport) = [ "--to-destination" , fromIPAddr ip ++ maybe "" (\p -> ":" ++ fromPort p) mport @@ -179,8 +190,10 @@ data Rules | RateLimit Frequency | TCPFlags TCPFlagMask TCPFlagComp | TCPSyn + | GroupOwner Group | Source [ IPWithMask ] | Destination [ IPWithMask ] + | NotDestination [ IPWithMask ] | NatDestination IPAddr (Maybe Port) | Rules :- Rules -- ^Combine two rules deriving (Eq, Show) -- cgit v1.2.3