Just a small comments cleanups... --- func/minion/modules/iptables/__init__.py | 2 +- func/minion/modules/iptables/port.py | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/func/minion/modules/iptables/__init__.py b/func/minion/modules/iptables/__init__.py index 11a9333..937fe4b 100644 --- a/func/minion/modules/iptables/__init__.py +++ b/func/minion/modules/iptables/__init__.py @@ -94,7 +94,7 @@ class Iptables(func_module.FuncModule): def reject_to(self, ip): """ - Drop all outgoing traffic to IP. Example: + Reject all outgoing traffic to IP. Example: > func '*' call iptables reject_to 192.168.0.10 """ clear_all("-D OUTPUT -d %s -j ACCEPT" % ip) diff --git a/func/minion/modules/iptables/port.py b/func/minion/modules/iptables/port.py index 49e5970..370123b 100644 --- a/func/minion/modules/iptables/port.py +++ b/func/minion/modules/iptables/port.py @@ -22,7 +22,7 @@ class Port(func_module.FuncModule): def drop_from(self, port, ip="0.0.0.0", prot="tcp", dir="dst"): """ - Drop all traffic comming from/to PORT. Arguments: + Drop all incomming traffic from/to selected port. Arguments: * port - destination/source port * ip - source IP * prot - protocol (e.g. tcp/udp) @@ -30,7 +30,7 @@ class Port(func_module.FuncModule): Examples: * Drop all incoming traffic to local TCP port 80: > func '*' call iptables.port drop_from 80 - * Drop incomming traffic to local UDP port 53 from 192.168.0.0/24: + * Drop all incomming traffic to local UDP port 53 from 192.168.0.0/24: > func '*' call iptables.port drop_from 80 192.168.0.0/24 udp """ dir=parse_dir(dir) @@ -40,16 +40,16 @@ class Port(func_module.FuncModule): def reject_from(self, port, ip="0.0.0.0", prot="tcp", dir="dst"): """ - Drop all traffic comming from/to PORT. Arguments: + Reject all outgoing traffic from/to port. Arguments: * port - destination/source port * ip - source IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port Examples: - * Drop all incoming traffic to local TCP port 80: - > func '*' call iptables.port drop_from 80 - * Drop incomming traffic to local UDP port 53 from 192.168.0.0/24: - > func '*' call iptables.port drop_from 80 192.168.0.0/24 udp + * Reject all incoming traffic to local TCP port 80: + > func '*' call iptables.port reject_from 80 + * Reject incomming traffic to local UDP port 53 from 192.168.0.0/24: + > func '*' call iptables.port reject_from 80 192.168.0.0/24 udp """ dir=parse_dir(dir) clear_all("-D INPUT -p %s --%sport %s -s %s -j ACCEPT" % (prot, dir, port, ip) ) @@ -58,7 +58,7 @@ class Port(func_module.FuncModule): def accept_from(self, port, ip="0.0.0.0", prot="tcp", dir="dst"): """ - Accept all traffic comming from/to PORT. Arguments: + Accept all incomming traffic from/to port. Arguments: * port - destination/source port * ip - source IP * prot - protocol (e.g. tcp/udp) @@ -76,7 +76,7 @@ class Port(func_module.FuncModule): def drop_to(self, port, ip="0.0.0.0", prot="tcp", dir="dst"): """ - Drop all outgoing traffic going from/to PORT. Arguments: + Drop all outgoing traffic going from/to port. Arguments: * port - destination/source port * ip - destination IP * prot - protocol (e.g. tcp/udp) @@ -94,16 +94,16 @@ class Port(func_module.FuncModule): def reject_to(self, port, ip="0.0.0.0", prot="tcp", dir="dst"): """ - Drop all outgoing traffic going from/to PORT. Arguments: + Reject all outgoing traffic going from/to PORT. Arguments: * port - destination/source port * ip - destination IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port Examples: - * Drop outgoing traffic to TCP port 80 on 192.168.0.1: - > func '*' call iptables.port drop_to 80 192.168.0.1 - * Drop outgoing traffic from UDP port 53 to 192.168.0.0/24: - > func '*' call iptables.port drop_to 53 192.168.0.0/24 udp src + * Reject outgoing traffic to TCP port 80 on 192.168.0.1: + > func '*' call iptables.port reject_to 80 192.168.0.1 + * Reject outgoing traffic from UDP port 53 to 192.168.0.0/24: + > func '*' call iptables.port reject_to 53 192.168.0.0/24 udp src """ dir=parse_dir(dir) clear_all("-D OUTPUT -p %s --%sport %s -d %s -j ACCEPT" % (prot, dir, port, ip) ) -- --- func/minion/modules/iptables/__init__.py | 29 ++++++++--------------------- func/minion/modules/iptables/port.py | 30 ------------------------------ 2 files changed, 8 insertions(+), 51 deletions(-) diff --git a/func/minion/modules/iptables/__init__.py b/func/minion/modules/iptables/__init__.py index 937fe4b..efe80df 100644 --- a/func/minion/modules/iptables/__init__.py +++ b/func/minion/modules/iptables/__init__.py @@ -24,20 +24,13 @@ class Iptables(func_module.FuncModule): def run(self, args): """ - Run 'iptables' command with arguments given. For example: - > func '*' call iptables run "-L INPUT" + Run 'iptables' command with arguments given. """ return run_iptables(args) def policy(self, chain="INPUT", policy=None): """ - Check/set default policy for the chain. Examples: - * Check default policy for INPUT chain: - > func '*' call iptables policy - or - > func '*' call iptables policy INPUT - * Set default policy for OUTPUT: - > func '*' call iptables policy OUTPUT DROP + Check/set default policy for the chain. """ if policy==None: return check_policy(chain) @@ -58,8 +51,7 @@ class Iptables(func_module.FuncModule): def drop_from(self, ip): """ - Drop all incomming traffic from IP. Example: - > func '*' call iptables drop_from 192.168.0.10 + Drop all incomming traffic from IP. """ clear_all("-D INPUT -s %s -j ACCEPT" % ip) clear_all("-D INPUT -s %s -j REJECT" % ip) @@ -67,8 +59,7 @@ class Iptables(func_module.FuncModule): def reject_from(self, ip): """ - Reject all incoming traffic from IP. Example: - > func '*' call iptables reject_from 192.168.0.10 + Reject all incoming traffic from IP. """ clear_all("-D INPUT -s %s -j ACCEPT" % ip) clear_all("-D INPUT -s %s -j DROP" % ip) @@ -76,8 +67,7 @@ class Iptables(func_module.FuncModule): def accept_from(self, ip): """ - Accept all incoming traffic from IP. Example: - > func '*' call iptables accept_from 192.168.0.10 + Accept all incoming traffic from IP. """ clear_all("-D INPUT -s %s -j DROP" % ip) clear_all("-D INPUT -s %s -j REJECT" % ip) @@ -85,8 +75,7 @@ class Iptables(func_module.FuncModule): def drop_to(self, ip): """ - Drop all outgoing traffic to IP. Example: - > func '*' call iptables drop_to 192.168.0.10 + Drop all outgoing traffic to IP. """ clear_all("-D OUTPUT -d %s -j ACCEPT" % ip) clear_all("-D OUTPUT -d %s -j REJECT" % ip) @@ -94,8 +83,7 @@ class Iptables(func_module.FuncModule): def reject_to(self, ip): """ - Reject all outgoing traffic to IP. Example: - > func '*' call iptables reject_to 192.168.0.10 + Reject all outgoing traffic to IP. """ clear_all("-D OUTPUT -d %s -j ACCEPT" % ip) clear_all("-D OUTPUT -d %s -j DROP" % ip) @@ -103,8 +91,7 @@ class Iptables(func_module.FuncModule): def accept_to(self, ip): """ - Accept all outgoing traffic to IP. Example: - > func '*' call iptables accept_to 192.168.0.10 + Accept all outgoing traffic to IP. """ clear_all("-D OUTPUT -d %s -j DROP" % ip) clear_all("-D OUTPUT -d %s -j REJECT" % ip) diff --git a/func/minion/modules/iptables/port.py b/func/minion/modules/iptables/port.py index 370123b..0d157af 100644 --- a/func/minion/modules/iptables/port.py +++ b/func/minion/modules/iptables/port.py @@ -27,11 +27,6 @@ class Port(func_module.FuncModule): * ip - source IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port - Examples: - * Drop all incoming traffic to local TCP port 80: - > func '*' call iptables.port drop_from 80 - * Drop all incomming traffic to local UDP port 53 from 192.168.0.0/24: - > func '*' call iptables.port drop_from 80 192.168.0.0/24 udp """ dir=parse_dir(dir) clear_all("-D INPUT -p %s --%sport %s -s %s -j ACCEPT" % (prot, dir, port, ip) ) @@ -45,11 +40,6 @@ class Port(func_module.FuncModule): * ip - source IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port - Examples: - * Reject all incoming traffic to local TCP port 80: - > func '*' call iptables.port reject_from 80 - * Reject incomming traffic to local UDP port 53 from 192.168.0.0/24: - > func '*' call iptables.port reject_from 80 192.168.0.0/24 udp """ dir=parse_dir(dir) clear_all("-D INPUT -p %s --%sport %s -s %s -j ACCEPT" % (prot, dir, port, ip) ) @@ -63,11 +53,6 @@ class Port(func_module.FuncModule): * ip - source IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port - Examples: - * Accept all incoming traffic to local TCP port 80: - > func '*' call iptables.port accept_from 80 - * Accept incomming traffic to local UDP port 53 from 192.168.0.0/24: - > func '*' call iptables.port accept_from 80 192.168.0.0/24 udp """ dir=parse_dir(dir) clear_all("-D INPUT -p %s --%sport %s -s %s -j DROP" % (prot, dir, port, ip) ) @@ -81,11 +66,6 @@ class Port(func_module.FuncModule): * ip - destination IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port - Examples: - * Drop outgoing traffic to TCP port 80 on 192.168.0.1: - > func '*' call iptables.port drop_to 80 192.168.0.1 - * Drop outgoing traffic from UDP port 53 to 192.168.0.0/24: - > func '*' call iptables.port drop_to 53 192.168.0.0/24 udp src """ dir=parse_dir(dir) clear_all("-D OUTPUT -p %s --%sport %s -d %s -j ACCEPT" % (prot, dir, port, ip) ) @@ -99,11 +79,6 @@ class Port(func_module.FuncModule): * ip - destination IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port - Examples: - * Reject outgoing traffic to TCP port 80 on 192.168.0.1: - > func '*' call iptables.port reject_to 80 192.168.0.1 - * Reject outgoing traffic from UDP port 53 to 192.168.0.0/24: - > func '*' call iptables.port reject_to 53 192.168.0.0/24 udp src """ dir=parse_dir(dir) clear_all("-D OUTPUT -p %s --%sport %s -d %s -j ACCEPT" % (prot, dir, port, ip) ) @@ -117,11 +92,6 @@ class Port(func_module.FuncModule): * ip - destination IP * prot - protocol (e.g. tcp/udp) * dir - direction, "dst" for matching destination port or "src" for matching source port - Examples: - * Accept outgoing traffic to TCP port 80 on 192.168.0.1: - > func '*' call iptables.port accept_to 80 192.168.0.1 - * Accept outgoing traffic from UDP port 53 to 192.168.0.0/24: - > func '*' call iptables.port accept_to 53 192.168.0.0/24 udp src """ dir=parse_dir(dir) clear_all("-D OUTPUT -p %s --%sport %s -d %s -j DROP" % (prot, dir, port, ip) ) -- _______________________________________________ Func-list mailing list Func-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/func-list