• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

contrib/H03-May-2022-6231

doc/H01-Sep-2020-542475

etc/H03-May-2022-39818

.perltidyrcH A D01-Sep-20201.3 KiB6554

CONTRIBUTING.mdH A D01-Sep-2020224 32

LICENSEH A D01-Sep-202014.7 KiB278236

README.mdH A D01-Sep-20208.3 KiB186149

SECURITY.mdH A D01-Sep-2020468 1711

pulledpork.plH A D03-May-202286.7 KiB2,4472,093

README.md

1PulledPork
2==========
3
4PulledPork for Snort and Suricata rule management (from Google code)
5
6Find us on Freenode (IRC) [`#ppork`](https://webchat.freenode.net/?channels=ppork)
7
8Copyright (C) 2009-2020 JJ Cummings, Michael Shirk and the PulledPork Team!
9
10Thank you for choosing to use PulledPork!  This file provides some basic
11guidance on the usage of PulledPork.  Please be sure to read this file
12thoroughly so that you don't overlook something!
13
14
15## Features and Capabilities
16
17 * Automated downloading, parsing, state modification and rule modification
18   for all of your snort rulesets.
19 * Checksum verification for all major rule downloads
20 * Automatic generation of updated sid-msg.map file
21 * Capability to include your local.rules in sid-msg.map file
22 * Capability to pull rules tarballs from custom urls
23 * Complete Shared Object support
24 * Complete IP Reputation List support
25 * Capability to download multiple disparate rulesets at once
26 * Maintains accurate changelog
27 * Capability to HUP processes after rules download and process
28 * Aids in tuning of rulesets
29 * Verbose output so that you know EXACTLY what is happening
30 * Minimal Perl Module dependencies
31 * Support for Suricata, and ETOpen/ETPro rulesets
32 * A sweet smokey flavor throughout the pork!
33
34
35## Command Usage Reference
36
37```
38Usage: pulledpork.pl [-dEgklnRTPVvv? -help] -c <config filename> -o <rule output path>
39 -O <oinkcode> -s <so_rule output directory> -D <Distro> -S <SnortVer>
40 -p <path to your snort binary> -C <path to your snort.conf> -t <sostub output path>
41 -h <changelog path> -H <signal_name> -I (security|connectivity|balanced) -i <path to disablesid.conf>
42 -b <path to dropsid.conf> -e <path to enablesid.conf> -M <path to modifysid.conf>
43 -r <path to docs folder> -K <directory for separate rules files>
44
45 Options:
46 -help/? Print this help info.
47 -b Where the dropsid config file lives.
48 -C Path to your snort.conf
49 -c Where the pulledpork config file lives.
50 -d Do not verify signature of rules tarball, i.e. downloading fron non VRT or ET locations.
51 -D What Distro are you running on, for the so_rules
52    For latest supported options see http://www.snort.org/snort-rules/shared-object-rules
53    Valid Distro Types:
54	Alpine-3-10
55	Centos-6, Centos-7, Centos-8
56	Debian-8, Debian-9, Debian-10
57	FC-27, FC-30
58	FreeBSD-11, FreeBSD-12
59	OpenBSD-6-2, OpenBSD-6-4, OpenBSD-6-5
60	OpenSUSE-15-0, OpenSUS-15-1, OpenSUSE-42-3
61	RHEL-6, RHEL-7, RHEL-8
62	Slackware-14-2
63	Ubuntu-14-4, Ubuntu-16-4, Ubuntu-17-10, Ubuntu-18-4
64 -e Where the enablesid config file lives.
65 -E Write ONLY the enabled rules to the output files.
66 -g grabonly (download tarball rule file(s) and do NOT process)
67 -h path to the sid_changelog if you want to keep one?
68 -H Send signal_name to the pids listed in the config file (SIGHUP or SIGUSR2)
69 -I Specify a base ruleset( -I security,connectivity,or balanced, see README.RULESET)
70 -i Where the disablesid config file lives.
71 -k Keep the rules in separate files (using same file names as found when reading)
72 -K Where (what directory) do you want me to put the separate rules files?
73 -l Log Important Info to Syslog (Errors, Successful run etc, all items logged as WARN or higher)
74 -L Where do you want me to read your local.rules for inclusion in sid-msg.map
75 -m where do you want me to put the sid-msg.map file?
76 -M where the modifysid config file lives.
77 -n Do everything other than download of new files (disablesid, etc)
78 -o Where do you want me to put generic rules file?
79 -O Define the oinkcode on the command line (necessary for some users)
80 -p Path to your Snort binary
81 -P Process rules even if no new rules were downloaded
82 -R When processing enablesid, return the rules to their ORIGINAL state
83 -r Where do you want me to put the reference docs (xxxx.txt)
84 -S What version of snort are you using (2.8.6 or 2.9.0) are valid values
85 -s Where do you want me to put the so_rules?
86 -T Process text based rules files only, i.e. DO NOT process so_rules
87 -u Where do you want me to pull the rules tarball from
88    ** E.g., ET, Snort.org. See pulledpork config rule_url option for value ideas
89 -V Print Version and exit
90 -v Verbose mode, you know.. for troubleshooting and such nonsense.
91 -vv EXTRA Verbose mode, you know.. for in-depth troubleshooting and other such nonsense.
92 -w Skip the SSL verification (if there are issues pulling down rule files)
93 -W Where you want to work around the issue where some implementations of LWP do not work with pulledpork's proxy configuration.
94 ```
95
96
97## Basic Usage Examples
98
99A simple example of how to use PulledPork would be to specify all of your configuration directives inside of the
100`PulledPork.conf` file.  Specifically for minimal function, i.e. NO Shared Object rule processing you must define
101at a minimum the `rule_file`, `oinkcode`, `temp_path`, `tar_path`, and `rule_path` values.  Below are some examples of this.
102
103```bash
104./pulledpork.pl -o /usr/local/etc/snort/rules/ -O 12345667778523452344234234 \
105  -u http://www.snort.org/reg-rules/snortrules-snapshot-2973.tar.gz \
106  -i disablesid.conf -T -H
107```
108
109The above will fetch the `snortrules-snapshot-2973.tar.gz` tarball from snort.org using the specified `oinkcode` of
110`12345667778523452344234234` and put the rules files from that tarball into the output path of
111`/usr/local/etc/snort/rules/` while the `-i` option tells pulledpork where the
112`disablesid.conf` lives, and the `-T` option tells pulledpork to not process for any shared object rules and the final
113`-H` option tells pulledpork to send a `Hangup` signal to the snort pid that you defined in the `pulledpork.conf`.
114
115```bash
116./pulledpork.pl -c pulledpork.conf -i disablesid.conf -T -H
117```
118
119Similar to the first example but all options specified in the `pulledpork.conf` file (other than `disablesid` and `-H`)...
120
121```bash
122./pulledpork.pl -c pulledpork.conf -i disablesid.conf \
123  -m /usr/local/etc/snort/sid-msg.map -Hn
124```
125
126The above will simply read the disablesid and disable as defined, then send a `Hangup` signal after generating the `sid-msg.map`
127at the specified location without downloading anything.
128Highly useful when tuning / making changes etc..
129
130Next example, snort inline with rules that we want to drop and disable, then `HUP` our daemons after creating a `sid-msg.map`
131and writing change info to `sid_changes.log`!
132
133```bash
134./pulledpork.pl -c pulledpork.conf -i disablesid.conf -b dropsid.conf \
135  -m /usr/local/etc/snort/sid-msg.map -h /var/log/sid_changes.log -H
136```
137
138Next example, same as the previous but specifying that we want to run the default "security" based ruleset
139and that we want to enable rules specified in `enablesid.conf`.
140
141```bash
142./pulledpork.pl -c pulledpork.conf -i disablesid.conf -b dropsid.conf \
143  -e enablesid.conf -m /usr/local/etc/snort/sid-msg.map \
144  -h /var/log/sid_changes.log -I security -H
145```
146
147Next example, same as the previous but specifying that we want to `-K` (Keep) the originationg tarball names.
148and write them to `/usr/local/etc/snort/rules/`
149
150```bash
151./pulledpork.pl -c pulledpork.conf -i disablesid.conf -b dropsid.conf \
152  -e enablesid.conf -m /usr/local/etc/snort/sid-msg.map \
153  -h /var/log/sid_changes.log -I security -H -K /usr/local/etc/snort/rules/
154```
155
156For users of Suricata, the same steps are necessary for where your installation files reside, but all that pulledpork needs to process
157rule files is the `-S` flag being set to `suricata-3.1.3` or whatever version of suricata you are using
158
159```bash
160./pulledpork.pl -c pulledpork.conf -S suricata-3.1.3
161```
162
163Pulledpork "should" work with Suricata and ET/ETPro rules. However there is no support for Talos rules to run on Suricata.
164
165## Special Notes Section
166
167Please note that pulledpork runs rule modification (enable, drop, disable, modify) in that order by default..
168
1691. enable
1702. drop
1713. disable
172
173This means that disable rules will always take precedence.. thusly if you specify the same `gid:sid`
174in enable and disable configuration files, then that sid will be disabled.. keep this in mind
175for ranges also!  However, you can specify a different order using the state_order keyword in the
176master config file.
177
178I'll probably add more info later, the `--help` or `--?` will display all runtime options and the `pulledpork.conf` is
179pretty well annotated... so if you can't figure it out... try harder!  And once you figure it out, please feel
180free to contribute with additional readme / help foo.. thx!
181
182As a side note, I would like to give a shout-out to my buddy Bruce for aiding in the naming of PulledPork!
183"hopefully that will shut him up ;-)"
184
185J
186