-c, --config<configurationfile>
By default fwsnort makes use of the configuration file /etc/fwsnort/fwsnort.conf for almost all
configuration parameters. fwsnort can be made to override this path by specifying a different
file on the command line with the --config option. When fwsnort is not executed as root, then a
path to a readable fwsnort.conf file is required.
--update-rules
Download the latest Emerging Threats rules from http://www.emergingthreats.net This will overwrite
the emerging-all.rules file in the /etc/fwsnort/snort_rules/ directory. Note that the automatic
downloading of Snort rules from http://www.snort.org/ as of March, 2005 is only offered as a pay
service.
--rules-url<url>
Specify the URL to use when updating the Emerging Threats rule set (or any other rule set). The
default URL is: http://rules.emergingthreats.net/open/snort-2.9.0/emerging-all.rules-6, --ip6tables
Enable ip6tables mode so that the fwsnort rule set is built into an ip6tables policy instead of
the iptables policy. This allows fwsnort controls to apply to IPv6 traffic.
--include-type<rulestype>
Restrict to processing snort rules of <rules type>. Example rule types would include "ddos",
"backdoor", and "web-attacks". This option also supports a comma-separated list of types, e.g.
"ddos,backdoor".
--exclude-type<rulestype>
Exclude all Snort rules from of type <rules type> from the translation process. For example, if
you don't want any rules from the file emerging-all.rules to be translated, then use "emerging-
all" as the argument to this option. A comma-separated list of types to exclude can be specified.
--include-regex<regex>
Only translate Snort rules that match the specified regular expression. This is useful to build
fwsnort policies for Snort rules that have a common characteristic (such as a string match on the
word "Storm" for the Storm worm for example).
--exclude-regex<regex>
Translate all Snort rules except those that match the specified regular expression. This is
useful to omit Snort rules from fwsnort policies that have a common characteristic (such as a
string match on "HTTP_PORTS" for example).
--include-re-caseless
Make the rule matching regular expression specified with --include-regex match case insensitively.
--exclude-re-caseless
Make the rule matching regular expression specified with --exclude-regex match case insensitively.
--snort-rdir<snort-rules-directory>
Manually specify the directory where the snort rules files are located. The default is
/etc/fwsnort/snort_rules. Multiple directories are supported as a comma-separated list.
--snort-rfile<snort-rules-file>
Manually specify a Snort rules file to translated into iptables rules. Multiple files are also
supported as a comma-separated list.
--snort-sid<sid>
Generate an iptables ruleset for a single snort rule specified by <sid>. A comma-separated list
of sids can be specified, e.g. "2001842,1834".
--exclude-sid<sid>
Provide a list of Snort ID's to be excluded from the translation process.
--include-perl-triggers
Include 'perl-eprint...' commands as comments in the fwsnort.sh script. These commands allow
payloads that are designed to trigger snort rules to easily be built, and when combined with
netcat (or other software that can send bytes over the wire) it becomes possible to test whether
an fwsnort policy appropriately triggers on matching traffic.
--ipt-script<scriptfile>
Specify the path to the iptables script generated by fwsnort. The default location is
/var/lib/fwsnort/fwsnort.sh.
--ipt-check-capabilities
Check iptables capabilities and exit.
--Last-cmd
Run fwsnort with the same command line arguments as the previous execution. This is a convenient
way of rebuilding the /var/lib/fwsnort/fwsnort.sh script without having to remember what the last
command line args were.
--NFQUEUE
Build an fwsnort policy that sends packets that match Snort content or uricontent fields to
userspace via the iptables NFQUEUE target for further analysis. This is a mechanism for reducing
the signature inspection load placed on snort_inline. A parallel set of Snort rules that are
successfully translated are placed in the /etc/fwsnort/snort_rules_queue directory. This requires
CONFIG_NETFILTER_XT_TARGET_NFQUEUE support in the Linux kernel.
--QUEUE
Same as the --NFQUEUE command line argument except that the older QUEUE target is used instead of
the NFQUEUE target. This requires CONFIG_IP_NF_QUEUE support in the Linux kernel.
--queue-num<num>
Specify a queue number in --NFQUEUE mode.
--queue-pre-match-max<num>
In --QUEUE or --NFQUEUE mode, limit the number of content matches that are performed within the
kernel before sending a matching packet to a userspace Snort instance. This allows a level of
tuning with respect to how much work the kernel does to qualify a packet based on a signature
match before having Snort do the same thing. The default is to perform all specified content
matches in the signature before queuing the packet to userspace because the multiple in-kernel
content matches is probably less expensive than sending a packet to userspace by default.
--string-match-alg<alg>
Specify the string matching algorithm to use with the kernel. By default, this is 'bm' for the
'Boyer-Moore' string matching algorithm, but 'kmp' may also be specified (short for the
'Knuth–Morris–Pratt' algorithm).
--ipt-apply
Execute the iptables script generated by fwsnort.
--ipt-exec
Synonym for --ipt-apply.
--ipt-revert
Revert to a version of the iptables policy without any fwsnort rules. Note that this reverts to
the iptables policy as it was when fwsnort was originally executed. So, it is not recommended to
use this option if there is a large amount of time between when fwsnort is run to translate Snort
rules vs. running it with this option. For most purposes it is better to use the --ipt-flush
option below.
--ipt-flush
Flush all fwsnort currently active iptables rules (flushes the fwsnort chains).
--ipt-list
List all fwsnort currently active iptables rules (lists the fwsnort chains).
--ipt-drop
For each logging rule generated by fwsnort add a corresponding DROP rule. Note that for TCP
sessions using this option will cause retransmissions as packets that are part of established
sessions selectively dropped. Remember that false positives are common occurrences for intrusion
detection systems, and so using this or the --ipt-reject option may break things on your network!
You have been warned.
--ipt-reject
For each logging rule generated by fwsnort add a corresponding REJECT rule. Reset packets will be
generated for TCP sessions through the use of the "--reject-with tcp-reset" option, and ICMP port
unreachable messages will be generated for UDP packets through the use of the "--reject-with icmp-
port-unreachable" option.
-C, --Conntrack-state<state>
Specify a conntrack state in place of the "established" state that commonly accompanies the Snort
"flow" keyword. By default, fwsnort uses the conntrack state of "ESTABLISHED" for this. In
certain corner cases, it might be useful to use "ESTABLISHED,RELATED" instead to apply application
layer inspection to things like ICMP port unreachable messages that are responses to real
attempted communications.
--no-ipt-log
By default fwsnort generates an iptables script that implements a logging rule for each
successfully translated snort rule. This can be disabled with the --no-ipt-log option, but --ipt-
drop must also be specified.
--no-ipt-sync
This is a deprecated option since the default behavior is to translate as many Snort rules into
iptables rules as possible. With fwsnort able to produce iptables rules in iptables-save format,
it is extremely fast to instantiate a large set of translated Snort rules into an iptables policy.
A new --ipt-sync option has been added to reverse this behavior (not recommended).
--ipt-sync
Consult the iptables policy currently running on the machine for applicable snort rules.
--no-ipt-test
Do not test the iptables build for existence of support for the LOG and REJECT targets, and ascii
and hex string matching.
--no-ipt-jumps
Do not jump packets from the built-in iptables INPUT, OUTPUT, and FORWARD chains to the custom
fwsnort chains. This options is mostly useful to make it easy to manually alter the placement of
the jump rules in the iptables ruleset.
--no-ipt-rule-nums
By default fwsnort includes the rule number within the logging prefix for each of the rules it
adds to the fwsnort chains. E.g. the logging prefix for rule 34 would look something like "[34]
SID1242 ESTAB". Use this option to not include the rule number.
--no-ipt-comments
If the iptables "comment" match exists, then fwsnort puts the Snort "msg", "classtype",
"reference", "priority", and "rev" fields within a comment for each iptables rule. Use this
option to disable this.
--no-ipt-INPUT
Do not jump packets from the iptables INPUT chain to the fwsnort chains.
--no-ipt-OUTPUT
Do not jump packets from the iptables OUTPUT chain to the fwsnort chains.
--no-ipt-FORWARD
Do not jump packets from the iptables FORWARD chain to the fwsnort chains.
--no-fast-pattern-ordering
Cause fwsnort to not try to reorder pattern matches to process the longest pattern first. The
Snort fast_pattern keyword is also ignored if this option is specified.
-H, --Home-net<network/mask>
Specify the internal network instead of having fwsnort derive it from the HOME_NET keyword in the
fwsnort.conf configuration file.
-E, --External-net<network/mask>
Specify the external network instead of having fwsnort derive it from the EXTERNAL_NET keyword in
the fwsnort.conf configuration file.
--no-addresses
Disable all checks against the output of ifconfig for proper IP addresses. This is useful if
fwsnort is running on a bridging firewall.
--Dump-conf
Print the fwsnort configuration on STDOUT and exit.
--debug
Run in debug mode. This will cause all parse errors which are normally written to the fwsnort
logfile /var/log/fwsnort.log to be written to STDOUT instead.
--strict
Run fwsnort in "strict" mode. This will prevent fwsnort from translating snort rules that contain
the keywords "offset", "uricontent", and "depth".
-U, --Ulog
Force the usage of the ULOG target for all log messages instead of the default LOG target.
--ulog-nlgroup
Specify the netlink group for ULOG rules. Such rules are only added for Snort rules that have an
action of "log", or when fwsnort is run in --Ulog mode.
-l, --logfile<logfile>
By default fwsnort logs all parse errors to the logfile /var/log/fwsnort.log. This path can be
manually changed with the --logfile option.
-v, --verbose
Run fwsnort in verbose mode. This will cause fwsnort to add the original snort rule as a comment
to the fwsnort.sh script for each successfully translated rule.
-V, --Version
Print the fwsnort version and exit.
-h, --help
Print usage information on STDOUT and exit.