diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-19 14:25:09 +0900 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-19 14:25:09 +0900 |
| commit | 50a361209b218483f5162d41b90ce0045a852f37 (patch) | |
| tree | 08ff4e0b8b71512a0870f1d2cc899bf776ed1007 /src | |
| parent | 101fd0f882df8137c3d8ae1345b25801b180d2ac (diff) | |
add GroupOwner and NotDestination iptables Rules
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Firewall.hs | 13 |
1 files changed, 13 insertions, 0 deletions
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) |
