csf utility
See http://download.configserver.com/csf/install.txt for setup instructions.
Simply allow/deny rules:
csf.rule_present:
ip: 1.2.3.4
method: allow
Alias for csf.nics_skipped
Meaningless arg, but required for state.
A list of nics to skip.
Boolean. Set to true if you want to skip the ipv6 interface. Default false (ipv4).
Ensure the state of a particular option/setting in csf.
The option name in csf.conf
The value it should be set to.
Boolean. If set to true, csf will be reloaded after.
Ensure ports are open for a protocol, in a direction. e.g. - proto='tcp', direction='in' would set the values for TCP_IN in the csf.conf file.
A list of ports that should be open.
The protocol. May be one of 'tcp', 'udp', 'tcp6', or 'udp6'.
Choose 'in', 'out', or both to indicate the port should be opened for inbound traffic, outbound traffic, or both.
Ensure iptable is not present.
The ip address or CIDR for the rule.
The type of rule. Either 'allow' or 'deny'.
Optional port to be open or closed for the iptables rule.
The protocol. Either 'tcp', 'udp'. Only applicable if port is specified.
The diretion of traffic to apply the rule to. Either 'in', or 'out'. Only applicable if port is specified.
Specifies either the source or destination port is relevant for this rule. Only applicable if port is specified. Either 's', or 'd'.
Specifies whether the ip in this rule refers to the source or destination ip. Either 's', or 'd'. Only applicable if port is specified.
How long the rule should exist. If supplied, csf.tempallow() or csf.tempdeny()` are used.
Reload the csf service after applying this rule. Default false.
Ensure iptable rule exists.
The ip address or CIDR for the rule.
The type of rule. Either 'allow' or 'deny'.
Optional port to be open or closed for the iptables rule.
The protocol. Either 'tcp', or 'udp'. Only applicable if port is specified.
The diretion of traffic to apply the rule to. Either 'in', or 'out'. Only applicable if port is specified.
Specifies either the source or destination port is relevant for this rule. Only applicable if port is specified. Either 's', or 'd'.
Specifies whether the ip in this rule refers to the source or destination ip. Either 's', or 'd'. Only applicable if port is specified.
How long the rule should exist. If supplied, csf.tempallow() or csf.tempdeny()` are used.
An optional comment to appear after the rule as a #comment .
Reload the csf service after applying this rule. Default false.
Ensure testing mode is enabled in csf.
Reload CSF after changing the testing status. Default false.
Ensure testing mode is enabled in csf.
Reload CSF after changing the testing status. Default false.