
Pulled Pork for Snort 및 Suricata 규칙 관리 (Google code 출신)
Snort 및 Suricata 규칙 관리를 위한 PulledPork (Google 코드에서)
Libera.Chat(IRC)에서 우리를 찾아보세요 #pulledpork
저작권 (C) 2009-2021 JJ Cummings, Michael Shirk 및 PulledPork 팀!
PulledPork를 선택해 주셔서 감사합니다! 이 파일은 PulledPork 사용에 대한 기본적인 지침을 제공합니다. 놓치는 부분이 없도록 이 파일을 철저히 읽어 주시기 바랍니다.
Usage: pulledpork.pl [-dEgklnRTPVvv? -help] -c <config filename> -o <rule output path>
-O <oinkcode> -s <so_rule output directory> -D <Distro> -S <SnortVer>
-p <path to your snort binary> -C <path to your snort.conf> -t <sostub output path>
-h <changelog path> -H <signal_name> -I (security|connectivity|balanced) -i <path to disablesid.conf>
-b <path to dropsid.conf> -e <path to enablesid.conf> -M <path to modifysid.conf>
-r <path to docs folder> -K <directory for separate rules files>
Options:
-help/? Print this help info.
-b Where the dropsid config file lives.
-C Path to your snort.conf
-c Where the pulledpork config file lives.
-d Do not verify signature of rules tarball, i.e. downloading fron non VRT or ET locations.
-D What Distro are you running on, for the so_rules
For latest supported options see http://www.snort.org/snort-rules/shared-object-rules
Valid Distro Types:
Alpine-3-10
Centos-6, Centos-7, Centos-8
Debian-8, Debian-9, Debian-10
FC-27, FC-30
FreeBSD-11, FreeBSD-12
OpenBSD-6-2, OpenBSD-6-4, OpenBSD-6-5
OpenSUSE-15-0, OpenSUS-15-1, OpenSUSE-42-3
RHEL-6, RHEL-7, RHEL-8
Slackware-14-2
Ubuntu-14-4, Ubuntu-16-4, Ubuntu-17-10, Ubuntu-18-4
-e Where the enablesid config file lives.
-E Write ONLY the enabled rules to the output files.
-g grabonly (download tarball rule file(s) and do NOT process)
-h path to the sid_changelog if you want to keep one?
-H Send signal_name to the pids listed in the config file (SIGHUP or SIGUSR2)
-I Specify a base ruleset( -I security,connectivity,or balanced, see README.RULESET)
-i Where the disablesid config file lives.
-k Keep the rules in separate files (using same file names as found when reading)
-K Where (what directory) do you want me to put the separate rules files?
-l Log Important Info to Syslog (Errors, Successful run etc, all items logged as WARN or higher)
-L Where do you want me to read your local.rules for inclusion in sid-msg.map
-m where do you want me to put the sid-msg.map file?
-M where the modifysid config file lives.
-n Do everything other than download of new files (disablesid, etc)
-o Where do you want me to put generic rules file?
-O Define the oinkcode on the command line (necessary for some users)
-p Path to your Snort binary
-P Process rules even if no new rules were downloaded
-R When processing enablesid, return the rules to their ORIGINAL state
-r Where do you want me to put the reference docs (xxxx.txt)
-S What version of snort are you using (2.8.6 or 2.9.0) are valid values
-s Where do you want me to put the so_rules?
-T Process text based rules files only, i.e. DO NOT process so_rules
-u Where do you want me to pull the rules tarball from
** E.g., ET, Snort.org. See pulledpork config rule_url option for value ideas
-V Print Version and exit
-v Verbose mode, you know.. for troubleshooting and such nonsense.
-vv EXTRA Verbose mode, you know.. for in-depth troubleshooting and other such nonsense.
-w Skip the SSL verification (if there are issues pulling down rule files)
-W Where you want to work around the issue where some implementations of LWP do not work with pulledpork's proxy configuration.
PulledPork를 사용하는 간단한 예제는 모든 구성 지시어를 PulledPork.conf 파일 내에 지정하는 것입니다. 최소 기능(공유 객체 규칙 처리 없음)을 위해서는 최소한 rule_file, oinkcode, temp_path, tar_path, rule_path 값을 정의해야 합니다. 아래는 몇 가지 예제입니다.
./pulledpork.pl -o /usr/local/etc/snort/rules/ -O 12345667778523452344234234 \
-u http://www.snort.org/reg-rules/snortrules-snapshot-2973.tar.gz \
-i disablesid.conf -T -H
위 명령은 지정된 oinkcode 12345667778523452344234234를 사용하여 snort.org에서 snortrules-snapshot-2973.tar.gz tarball을 가져오고, 해당 tarball의 규칙 파일을 /usr/local/etc/snort/rules/ 출력 경로에 넣습니다. -i 옵션은 pulledpork에 disablesid.conf 파일의 위치를 알려주고, -T 옵션은 공유 객체 규칙을 처리하지 않도록 지시하며, 마지막 -H 옵션은 pulledpork.conf에 정의된 snort PID에 Hangup 신호를 보내도록 지시합니다.
./pulledpork.pl -c pulledpork.conf -i disablesid.conf -T -H
첫 번째 예제와 비슷하지만, 모든 옵션이 pulledpork.conf 파일에 지정되어 있습니다(disablesid 및 -H 제외).
./pulledpork.pl -c pulledpork.conf -i disablesid.conf \
-m /usr/local/etc/snort/sid-msg.map -Hn
위 명령은 정의된 대로 disablesid를 읽고 비활성화한 다음, 아무것도 다운로드하지 않고 지정된 위치에 sid-msg.map을 생성한 후 Hangup 신호를 보냅니다. 튜닝이나 변경 작업 시 매우 유용합니다.
다음 예제는, 드롭 및 비활성화하려는 규칙이 포함된 인라인 snort를 사용하고, sid-msg.map을 생성한 후 변경 정보를 sid_changes.log에 기록한 다음 데몬에 HUP 신호를 보냅니다!
./pulledpork.pl -c pulledpork.conf -i disablesid.conf -b dropsid.conf \
-m /usr/local/etc/snort/sid-msg.map -h /var/log/sid_changes.log -H
다음 예제는 위와 동일하지만, 기본 "security" 기반 규칙 세트를 사용하고 enablesid.conf에 지정된 규칙을 활성화하도록 지정합니다.
./pulledpork.pl -c pulledpork.conf -i disablesid.conf -b dropsid.conf \
-e enablesid.conf -m /usr/local/etc/snort/sid-msg.map \
-h /var/log/sid_changes.log -I security -H
다음 예제는 위와 동일하지만, 원본 tarball 이름을 유지(-K)하고 /usr/local/etc/snort/rules/에 쓰도록 지정합니다.
./pulledpork.pl -c pulledpork.conf -i disablesid.conf -b dropsid.conf \
-e enablesid.conf -m /usr/local/etc/snort/sid-msg.map \
-h /var/log/sid_changes.log -I security -H -K /usr/local/etc/snort/rules/
Suricata 사용자의 경우, 설치 파일이 있는 위치에 대해 동일한 단계가 필요하지만, pulledpork가 규칙 파일을 처리하는 데 필요한 것은 -S 플래그를 suricata-3.1.3 또는 사용 중인 suricata 버전으로 설정하는 것입니다.
./pulledpork.pl -c pulledpork.conf -S suricata-3.1.3
Pulledpork는 Suricata 및 ET/ETPro 규칙과 "함께 작동해야 합니다". 그러나 Suricata에서 Talos 규칙을 실행하는 것은 지원되지 않습니다.
pulledpork는 기본적으로 다음 순서로 규칙 수정(활성화, 드롭, 비활성화, 수정)을 수행합니다.
즉, 비활성화 규칙이 항상 우선합니다. 따라서 enable 및 disable 구성 파일에 동일한 gid:sid를 지정하면 해당 sid가 비활성화됩니다. 범위에도 유의하시기 바랍니다! 하지만 마스터 구성 파일에서 state_order 키워드를 사용하여 다른 순서를 지정할 수 있습니다.
나중에 더 많은 정보를 추가할 수도 있습니다. --help 또는 --?를 사용하면 모든 런타임 옵션이 표시되고, pulledpork.conf에는 꽤 잘 주석이 달려 있습니다... 그러니 이해가 안 된다면... 더 노력해 보세요! 그리고 이해가 되면, 추가 readme/help 문서를 기여해 주시기 바랍니다. 감사합니다!
덧붙여, PulledPork의 이름을 지을 때 도움을 준 친구 Bruce에게 감사의 인사를 전합니다! "이걸로 그를 잠재울 수 있길 바랍니다 ;-)"
J