| Class | Symbiosis::Firewall::Template |
| In: |
firewall/lib/symbiosis/firewall/template.rb
|
| Parent: | Object |
This class encapsulates a single firewall (iptables) template
| address | [R] | The address (if any) this rule is applied to. |
| chain | [R] | The name of the chain this rule will be used in. |
| direction | [R] | The direction of the rule. |
| name | [R] | The name of the rule (usually the same as the template filename) |
| port | [R] | The port (if any) this rule applies to. |
| template_file | [R] | The filename of the template used. |
Set which directories are searched for templates.
The argument is a string, prepend it to the array of directries. If it is an array, overwrite the list.
Return the correct iptables command determined if this rule can apply to IPv4, or IPv6, or both IPv4 and IPv6 addresses.
The meat of the code. This is designed to return the actual "iptables" command which this rule can be used to generate.
This can cope with new ERB-based templates, as well as older ones with perl-style $SRC/$DEST statements.
For the old-style templates, any substitutions other than $SRC and $DEST will be removed, and warned about if the verbose flag is set.
TODO: this could be neater.