ãµã€ããŒã»ãã¥ãªãã£ã®äžçã¯ãåžžã«é²åããè åšãšã®æŠãã§ãããã®æåç·ã§æŽ»èºããããŒã«ã®1ã€ããSnort (ã¹ããŒã) ã§ãããã®èšäºã§ã¯ãSnortãšã¯äœãããã®ä»çµã¿ãæ©èœããããŠææ°ããŒãžã§ã³ã§ããSnort 3ã«ã€ããŠãåå¿è ã®æ¹ã«ãåããããã解説ããŠãããŸããðª
ð Snortãšã¯ïŒ ãã®æŽå²ãšéèŠæ§
Snortã¯ã1998幎ã«Martin Roeschæ°ã«ãã£ãŠéçºãããããªãŒãã³ãœãŒã¹ã®ãããã¯ãŒã¯äŸµå ¥æ€ç¥ã·ã¹ãã ïŒNIDS: Network Intrusion Detection SystemïŒããã³äŸµå ¥é²æ¢ã·ã¹ãã ïŒNIPS: Network Intrusion Prevention SystemïŒã§ããéçºåœåã¯Sourcefire瀟ãææããŠããŸãããã2013幎ã«å瀟ãCisco Systems瀟ã«è²·åããããããçŸåšã¯CiscoãéçºãåŒãç¶ãã§ããŸãã
ãªãŒãã³ãœãŒã¹ã§ããããã誰ã§ãç¡åã§å©çšã§ããäžçäžã®éçºè ãã»ãã¥ãªãã£å°é家ã«ãã£ãŠæ¹è¯ãç¶ããããŠããŸãããã®æè»æ§ãšåŒ·åãªæ©èœãããå人å©çšãã倧äŒæ¥ã®ãããã¯ãŒã¯ã»ãã¥ãªãã£ãŸã§ãå¹ åºãç°å¢ã§æ¡çšãããŠãããIDS/IPSã®ããã¡ã¯ãã¹ã¿ã³ããŒããšãèšããååšã§ããå€ãã®åçšIDS/IPS補åããå éšã§Snortãšã³ãžã³ãå©çšããŠããããšããããŸãã
ãã€ã³ãïŒ
- ãªãŒãã³ãœãŒã¹ã®IDS/IPSãœãããŠã§ã¢
- 1998幎ã«éçºãããçŸåšã¯Ciscoãéçºãäž»å°
- ç¡æã§å©çšå¯èœãäžçäžã§åºã䜿ãããŠãã
- ãããã¯ãŒã¯ãã©ãã£ãã¯ãç£èŠããäžæ£ãªã¢ã¯ãã£ããã£ãæ€ç¥ã»é²åŸ¡
âïž Snortã®äž»ãªæ©èœãšä»çµã¿
Snortã¯ããããã¯ãŒã¯äžãæµãããã±ããããªã¢ã«ã¿ã€ã ã§è§£æããå®çŸ©ãããã«ãŒã«ïŒã·ã°ããã£ïŒã«åºã¥ããŠäžæ£ãªéä¿¡ãæ»æã®å åãæ€ç¥ããŸãããã®äž»èŠãªæ§æèŠçŽ ãšä»çµã¿ãèŠãŠãããŸãããã
- ãã±ãããã£ãã㣠(Packet Capture): ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹ãééãããã¹ãŠã®ãã±ãããæç²ããŸããããã¯libpcapïŒLinux/Unixç³»ïŒãWinPcapïŒWindowsïŒãšãã£ãã©ã€ãã©ãªãå©çšããŠè¡ãããŸãã
- ããªããã»ããµ (Preprocessor): ãã£ããã£ãããã±ããã解æããããããããã«ååŠçãè¡ããŸããäŸãã°ãIPãã©ã°ã¡ã³ãã®åæ§æãTCPã¹ããªãŒã ã®åæ§ç¯ãHTTPãã©ãã£ãã¯ã®æ£èŠåãªã©ãè¡ããŸããããã«ãããæ€ç¥ãšã³ãžã³ãããå¹ççã«ããã€æ£ç¢ºã«ãã±ãããåæã§ããããã«ãªããŸãã
- æ€ç¥ãšã³ãžã³ (Detection Engine): Snortã®å¿èéšã§ããããªããã»ããµã§åŠçããããã±ããããèšå®ãããã«ãŒã«ã»ãããšç §åããŸããã«ãŒã«ã«åèŽãããã±ãããèŠã€ãããšãæ€ç¥ã€ãã³ããçºçããŸãã
- ã«ãŒã«ã»ãã (Rule Set): äžæ£ãªéä¿¡ãã¿ãŒã³ãæ»æã·ã°ããã£ãå®çŸ©ãããã®ã§ããSnortã³ãã¥ããã£ãCisco TalosïŒã»ãã¥ãªãã£ã€ã³ããªãžã§ã³ã¹ããŒã ïŒã«ãã£ãŠæäŸãããå ¬åŒã«ãŒã«ã»ããïŒã³ãã¥ããã£çã¯ç¡æããµãã¹ã¯ã©ã€ãçã¯ææã§ææ°æ å ±ãæ©ãæäŸãããïŒã®ã»ãããŠãŒã¶ãŒãç¬èªã®ã«ãŒã«ãäœæããããšãå¯èœã§ãã
- åºåã¢ãžã¥ãŒã« (Output Module): æ€ç¥ãšã³ãžã³ãã«ãŒã«ã«åèŽãããã±ãããçºèŠããå Žåããã®æ å ±ãã©ã®ããã«åŠçã»éç¥ãããã決å®ããŸãããã°ãã¡ã€ã«ãžã®èšé²ãããŒã¿ããŒã¹ãžã®ä¿åãSyslogãµãŒããŒãžã®éä¿¡ãã¢ã©ãŒãã®è¡šç€ºãªã©ãæ§ã ãªåºå圢åŒã«å¯Ÿå¿ããŠããŸãã
ð Snortã®3ã€ã®åäœã¢ãŒã
Snortã¯ãèšå®ã«ãã£ãŠäž»ã«3ã€ã®ã¢ãŒãã§åäœãããããšãã§ããŸããçšéã«å¿ããŠé©åãªã¢ãŒããéžæããŸãã
ã¢ãŒãå | æ©èœ | äž»ãªçšé | ã³ãã³ãäŸ (ç°¡æ) |
---|---|---|---|
ã¹ããã¡ã¢ãŒã (Sniffer Mode) | ãããã¯ãŒã¯ãã±ãããèªã¿åããã³ã³ãœãŒã«ã«ãªã¢ã«ã¿ã€ã ã§è¡šç€ºããŸããTCP/IPãããæ å ±ãªã©ã確èªã§ããŸãã | ãããã¯ãŒã¯ãã©ãã£ãã¯ã®ç°¡æçãªç£èŠããããã° | snort -v |
ãã±ãããã¬ãŒã¢ãŒã (Packet Logger Mode) | ãããã¯ãŒã¯ãã±ãããæå®ãããã£ã¬ã¯ããªã«ãã°ãã¡ã€ã«ãšããŠèšé²ããŸããtcpdump圢åŒïŒãã€ããªïŒãªã©ã§ä¿åå¯èœã§ãã | åŸã§è©³çŽ°ãªåæãè¡ãããã®ãã±ããåéããããã¯ãŒã¯ãã©ãã£ãã¯ã®èšé² | snort -dev -l ./log |
ãããã¯ãŒã¯äŸµå ¥æ€ç¥/é²æ¢ (NIDS/NIPS) ã¢ãŒã | å®çŸ©ãããã«ãŒã«ã»ããã«åºã¥ããŠãããã¯ãŒã¯ãã©ãã£ãã¯ãåæããäžæ£ãªãã±ãããæ€ç¥ïŒIDSïŒãŸãã¯æ€ç¥ããŠç Žæ£ïŒIPSïŒããŸããæ€ç¥çµæã¯ãã°ãã¡ã€ã«ãã¢ã©ãŒããšããŠåºåãããŸãã | ãªã¢ã«ã¿ã€ã ã®äžæ£ã¢ã¯ã»ã¹æ€ç¥ãæ»æã®é²åŸ¡ | snort -c /etc/snort/snort.conf -l /var/log/snort -A console (IDSã¢ãŒãäŸ)snort -c /etc/snort/snort.conf -l /var/log/snort -A fast -Q (IPSã¢ãŒãäŸ, èŠèšå®) |
NIDS (Network Intrusion Detection System) ã¯ãäžæ£ãªéä¿¡ããæ€ç¥ãããŠç®¡çè ã«éç¥ããã·ã¹ãã ã§ããéä¿¡èªäœãé®æããæ©èœã¯ãããŸãããäžæ¹ãNIPS (Network Intrusion Prevention System) ã¯ãäžæ£ãªéä¿¡ãæ€ç¥ããããã«ãã®éä¿¡ããé®æïŒç Žæ£ïŒãããããšã§äŸµå ¥ãæªç¶ã«é²ãã·ã¹ãã ã§ããSnortã¯èšå®ã«ãããã©ã¡ãã®ã¢ãŒãã§ãåäœãããããšãå¯èœã§ããNIPSã¢ãŒãïŒã€ã³ã©ã€ã³ã¢ãŒããšãåŒã°ããïŒã§åäœãããå ŽåãSnortããããã¯ãŒã¯çµè·¯ã®éäžã«é 眮ãããééãããã±ãããæ€æ»ã»å¶åŸ¡ããŸãã
ð Snort ã«ãŒã«ã®åºæ¬
Snortã®æ€ç¥èœåã®æ žãšãªãã®ããã«ãŒã«ãã§ããã«ãŒã«ã¯ç¹å®ã®ãã©ãã£ãã¯ãã¿ãŒã³ãèå¥ããããã«å¯ŸããŠã©ã®ãããªã¢ã¯ã·ã§ã³ïŒèŠåããã°èšé²ãç Žæ£ãªã©ïŒãåãããå®çŸ©ããŸããã«ãŒã«ã¯ãã«ãŒã«ãããããšãã«ãŒã«ãªãã·ã§ã³ãã®2ã€ã®éšåããæ§æãããŸãã
ã«ãŒã«æ§æã®åºæ¬åœ¢:
<ã¢ã¯ã·ã§ã³> <ãããã³ã«> <éä¿¡å
IP> <éä¿¡å
ããŒã> <æ¹å> <å®å
IP> <å®å
ããŒã> (<ã«ãŒã«ãªãã·ã§ã³>)
ã«ãŒã«ããã (Rule Header)
- ã¢ã¯ã·ã§ã³ (Action): ã«ãŒã«ã«ãããããå Žåã«å®è¡ããåäœã
alert
: ã¢ã©ãŒããçæãããã±ããããã°ã«èšé²ãããlog
: ãã±ããããã°ã«èšé²ãããpass
: ãã±ãããç¡èŠããïŒä»ã®ã«ãŒã«ãããåªå ãããïŒãdrop
: ãã±ãããç Žæ£ãããã°ã«èšé²ããïŒIPSã¢ãŒãïŒãreject
: ãã±ãããç Žæ£ãããã°ã«èšé²ããTCPã®å Žåã¯TCP RSTãUDPã®å Žåã¯ICMP port unreachableãéä¿¡ããïŒIPSã¢ãŒãïŒãsdrop
: ãã±ãããç Žæ£ãããããã°ã«ã¯èšé²ããªãïŒIPSã¢ãŒãïŒã
- ãããã³ã« (Protocol): æ€æ»å¯Ÿè±¡ã®ãããã³ã« (äŸ:
tcp
,udp
,icmp
,ip
)ã - éä¿¡å
IP (Source IP): éä¿¡å
IPã¢ãã¬ã¹ãŸãã¯ãããã¯ãŒã¯ã¢ãã¬ã¹ (äŸ:
192.168.1.100
,192.168.0.0/24
,any
)ã - éä¿¡å
ããŒã (Source Port): éä¿¡å
ããŒãçªå· (äŸ:
80
,1024:
,any
)ã - æ¹å (Direction): ãã©ãã£ãã¯ã®æ¹å (
->
: å·Šããå³ãž,<>
: åæ¹å)ã - å®å IP (Destination IP): å®å IPã¢ãã¬ã¹ãŸãã¯ãããã¯ãŒã¯ã¢ãã¬ã¹ã
- å®å ããŒã (Destination Port): å®å ããŒãçªå·ã
ã«ãŒã«ãªãã·ã§ã³ (Rule Options)
ã«ãŒã«ãããã®æ¡ä»¶ã«äžèŽãããã±ããã«å¯ŸããŠãããã«è©³çŽ°ãªæ€æ»æ¡ä»¶ãæå®ããŸããã»ãã³ãã³(;
)ã§åºåãããããŒã¯ãŒããšå€ã®ãã¢ã§èšè¿°ãããŸãã
- msg: ã¢ã©ãŒãããã°ã«åºåãããã¡ãã»ãŒãžã
msg:"<ã¡ãã»ãŒãžå 容>";
- content: ãã±ããã®ãã€ããŒãïŒããŒã¿éšåïŒã«å«ãŸããã¹ãç¹å®ã®ãã€ãåã
content:"|FF D8|";
(JPEGç»åã®éå§ããŒã«ãŒ) - sid (Snort Rule ID): ã«ãŒã«ãäžæã«èå¥ããããã®IDã1,000,000以äžã®å€ãã«ã¹ã¿ã ã«ãŒã«çšã«äºçŽãããŠããŸãã
sid:1000001;
- rev (Revision Number): ã«ãŒã«ã®ãªããžã§ã³çªå·ãã«ãŒã«ãä¿®æ£ãããã³ã«ã€ã³ã¯ãªã¡ã³ãããŸãã
rev:1;
- classtype: ã«ãŒã«ãå±ããæ»æã®ã«ããŽãªã
classtype:web-application-attack;
(classification.configã§å®çŸ©) - priority: ã¢ã©ãŒãã®åªå
床ã
priority:2;
(æ°å€ãå°ããã»ã©é«åªå 床) - ãã®ä»ã
flow
,flags
,dsize
,pcre
(æ£èŠè¡šçŸ),http_*
(HTTPé¢é£) ãªã©å€æ°ã
ã«ãŒã«èšè¿°äŸ
äŸ1: å€éšããå éšãããã¯ãŒã¯ãžã®SSHæ¥ç¶è©Šè¡ãæ€ç¥ããŠèŠåãã
alert tcp any any -> $HOME_NET 22 (msg:"SSH connection attempt"; flow:to_server,established; sid:1000001; rev:1; classtype:attempted-recon;)
alert tcp
: TCPãããã³ã«ã§èŠåãåºãany any
: ä»»æã®éä¿¡å IPãä»»æã®éä¿¡å ããŒã-> $HOME_NET 22
: HOME_NET (éåžžã¯å éšãããã¯ãŒã¯) ã®ããŒã22ãž(msg:"..."; flow:...; sid:...; rev:...; classtype:...;)
: ã«ãŒã«ãªãã·ã§ã³msg
: ãã°ã¡ãã»ãŒãžflow
: ãµãŒããžã®ç¢ºç«æžã¿æ¥ç¶sid
: ã«ãŒã«IDrev
: ãªããžã§ã³çªå·classtype
: æ»æåé¡
äŸ2: HTTPãã©ãã£ãã¯å ã«ç¹å®ã®æåå “evil.exe” ãå«ãŸããŠãããèŠåãã
alert tcp any any -> any 80 (msg:"Detected evil.exe download attempt"; content:"evil.exe"; nocase; sid:1000002; rev:1; classtype:trojan-activity;)
content:"evil.exe"
: ãã€ããŒãå ã« “evil.exe” ããããnocase
: 倧æåå°æåãåºå¥ããªã
ð Snort 3 vs Snort 2: é²åã®ãã€ã³ã
é·å¹Žã«ãããå©çšãããŠããSnort 2ç³»ãããå€§å¹ ãªã¢ãŒããã¯ãã£å€æŽãšæ©èœåŒ·åãè¡ãããSnort 3 ãç»å ŽããŸãããSnort 3ã¯ãããã©ãŒãã³ã¹ãã¹ã±ãŒã©ããªãã£ãèšå®ã®å®¹æããªã©ãåäžããŠããŸããææ°ããŒãžã§ã³ã¯ 3.1.81.0 (2024幎2æ16æ¥æç¹) ã§ãã
Snort 2ãšSnort 3ã®äž»ãªéããæ¯èŒããŠã¿ãŸãããã
æ©èœ/ç¹åŸŽ | Snort 2.x (Legacy) | Snort 3.x |
---|---|---|
ã¢ãŒããã¯ã㣠| ã·ã³ã°ã«ã¹ã¬ããåŠçãåºæ¬ | ãã«ãã¹ã¬ããå¯Ÿå¿ ð |
èšå®ãã¡ã€ã« | ç¬èªã®æ§æ (snort.conf) | LuaããŒã¹ã®æ°ããèšå®æ§æ (ããã·ã³ãã«ã§æè») âš |
ããã©ãŒãã³ã¹ | CPUã³ã¢æ°ã«äŸå (ããã»ã¹æ°å) | ãã«ãã¹ã¬ããåã«ããé«éåãèµ·åæéççž® |
ã¡ã¢ãªäœ¿çšé | ããã»ã¹ããšã«èšå®ã¡ã¢ãªãå¿ èŠ | èšå®ã¡ã¢ãªãå ±æãå¹çå |
èšå®ã®ãªããŒã | ããã»ã¹ããšã«ãªããŒããæéããããå Žåããã | åäžã¹ã¬ããã§é«éã«ãªããŒãå¯èœ |
ãã©ã°ã€ã³ã·ã¹ãã | ããªããã»ããµãã¢ãŠãããããã©ã°ã€ã³ãªã©éå®ç | å æ¬çãªãã©ã°ã€ã³ã·ã¹ãã (200以äžã®ãã©ã°ã€ã³)ãLuaJITã«ããã«ã¹ã¿ã ãã©ã°ã€ã³äœæã容æã« ð§ |
ã«ãŒã«æ§æ | åŸæ¥ã®æ§æ | ããç°¡æœã§åãããããæ§æã«æŽæ° (äžéšäºææ§ãã) |
HTTP/2 ãµããŒã | éå®çãŸãã¯ç¡ã | HTTP/2ã€ã³ã¹ãã¯ã·ã§ã³å¯Ÿå¿ ð |
èªåæ€åº | æåèšå®ãå¿ èŠãªå Žåãå€ã | ããŒãã¬ã¹èšå®ã®ãµãŒãã¹ãèªåæ€åºããæ©èœ |
Snort 3ãžã®ç§»è¡ã¯ãç¹ã«é«ãã©ãã£ãã¯ç°å¢ãææ°ã®ãããã³ã«ãžã®å¯Ÿå¿ãå¿ èŠãªå Žåã«å€§ããªã¡ãªããããããŸããèšå®æ¹æ³ãã«ãŒã«æ§æã«éããããããã移è¡ã«ã¯åŠç¿ãšæ€èšŒãå¿ èŠã§ãããå°æ¥æ§ãããã©ãŒãã³ã¹ãèãããšSnort 3ã®å©çšãæšå¥šãããŸãã
ð ïž ã€ã³ã¹ããŒã«ãšåºæ¬çãªèšå®
Snortã®ã€ã³ã¹ããŒã«æ¹æ³ã¯OSã«ãã£ãŠç°ãªããŸããå€ãã®Linuxãã£ã¹ããªãã¥ãŒã·ã§ã³ã§ã¯ããã±ãŒãžãããŒãžã£ (apt, yumãªã©) ãå©çšããŠã€ã³ã¹ããŒã«ã§ããŸãããåžžã«ææ°çãæäŸããããšã¯éããŸãããææ°çãç¹å®ã®æ©èœãå©çšãããå Žåã¯ãå ¬åŒãµã€ããããœãŒã¹ã³ãŒããããŠã³ããŒãããŠã³ã³ãã€ã«ã»ã€ã³ã¹ããŒã«ããæ¹æ³ããããŸãã
äžè¬çãªã€ã³ã¹ããŒã«æé (LinuxäŸ)
- äŸåé¢ä¿ã®ã€ã³ã¹ããŒã«: Snortã®ãã«ããå®è¡ã«å¿
èŠãªã©ã€ãã©ãª (libpcap-dev, pcre-dev, libdnet-dev, zlib1g-dev, openssl, libssl-dev ãªã©ãSnort 3ã§ã¯ããã«å€ãã®äŸåé¢ä¿ãå¿
èŠ) ãã€ã³ã¹ããŒã«ããŸãã
# Ubuntu/Debian ç³» (äŸ) sudo apt update sudo apt install -y build-essential libpcap-dev libpcre3-dev libnet1-dev zlib1g-dev luajit hwloc libdnet-dev libdumbnet-dev bison flex liblzma-dev openssl libssl-dev pkg-config libhwloc-dev cmake cpputest libsqlite3-dev uuid-dev libcmocka-dev libnetfilter-queue-dev libmnl-dev autotools-dev libluajit-5.1-dev libunwind-dev # Snort 3 ã®äŸåé¢ä¿äŸ
- DAQã®ã€ã³ã¹ããŒã« (Snort 3): Snort 3ã§ã¯Data Acquisition library (DAQ) ãå¥éå¿ èŠã«ãªãå ŽåããããŸãããœãŒã¹ãããã«ãã»ã€ã³ã¹ããŒã«ããŸãã
- Snortã®ããŠã³ããŒããšã³ã³ãã€ã«: å
¬åŒãµã€ãããSnortã®ãœãŒã¹ã³ãŒããããŠã³ããŒãããå±éããŠã³ã³ãã€ã«ãã€ã³ã¹ããŒã«ãè¡ããŸãã
wget https://www.snort.org/downloads/snort/snort-<version>.tar.gz tar -xzf snort-<version>.tar.gz cd snort-<version> ./configure # ãªãã·ã§ã³ãæå®ããå Žåãã (äŸ: --enable-sourcefire) make sudo make install
â» Snort 3ã®å Žåã¯CMakeã䜿çšãããªã©ãæé ãç°ãªããŸãã
- èšå®ãã¡ã€ã«ã®é 眮: èšå®ãã¡ã€ã« (`snort.conf`ãªã©) ãã«ãŒã«ãã¡ã€ã«ãé©åãªãã£ã¬ã¯ã㪠(äŸ: `/etc/snort/`) ã«é 眮ããŸãããœãŒã¹ããã€ã³ã¹ããŒã«ããå ŽåããœãŒã¹ãã£ã¬ã¯ããªå ã® `etc` ãã£ã¬ã¯ããªã«ãããµã³ãã«ãã¡ã€ã«ãã³ããŒããããšãå€ãã§ãã
- ãŠãŒã¶ãŒ/ã°ã«ãŒãäœæ: Snortãå°çšã®éç¹æš©ãŠãŒã¶ãŒ (äŸ: `snort`) ã§å®è¡ããããšãæšå¥šãããŸãã
- ãã£ã¬ã¯ããªäœæãšæš©éèšå®: ãã°ãã£ã¬ã¯ã㪠(äŸ: `/var/log/snort`) ãªã©ãäœæããSnortå®è¡ãŠãŒã¶ãŒãæžã蟌ããããã«æš©éãèšå®ããŸãã
åºæ¬çãªèšå® (`snort.conf`)
Snortã®åäœã¯äž»ã« `snort.conf` (Snort 3ã§ã¯ `snort.lua` ãªã©) ãšããèšå®ãã¡ã€ã«ã§å¶åŸ¡ãããŸãã以äžã¯ `snort.conf` (Snort 2ç³») ã®éèŠãªèšå®é ç®ã®äžéšã§ãã
- `ipvar HOME_NET …` / `ipvar EXTERNAL_NET …`: ä¿è·å¯Ÿè±¡ã®å
éšãããã¯ãŒã¯ (HOME_NET) ãšããã以å€ã®å€éšãããã¯ãŒã¯ (EXTERNAL_NET) ãå®çŸ©ããŸããéåžžã`EXTERNAL_NET` 㯠`!$HOME_NET` (HOME_NET以å€ãã¹ãŠ) ãšèšå®ããŸãã
ipvar HOME_NET 192.168.1.0/24 ipvar EXTERNAL_NET !$HOME_NET
- `var RULE_PATH …`: ã«ãŒã«ãã¡ã€ã«ãæ ŒçŽãããŠãããã£ã¬ã¯ããªãã¹ãæå®ããŸãã
- `var SO_RULE_PATH …` / `var PREPROC_RULE_PATH …`: å ±æãªããžã§ã¯ãã«ãŒã«ãããªããã»ãã·ã³ã°ã«ãŒã«ã®ãã¹ãæå®ããŸãã
- `var WHITE_LIST_PATH …` / `var BLACK_LIST_PATH …`: ãã¯ã€ããªã¹ã/ãã©ãã¯ãªã¹ããã¡ã€ã«ã®ãã¹ãæå®ããŸãã
- `preprocessor …`: 䜿çšããããªããã»ããµãšãã®èšå®ãèšè¿°ããŸãããã©ã°ã¡ã³ãåæ§æãã¹ããªãŒã åæ§ç¯ãåçš®ãããã³ã«ãã³ãŒã (http_inspect, ftp_telnet, smtpãªã©) ã®èšå®ãå«ãŸããŸãã
- `output …`: ã¢ã©ãŒãããã°ã®åºåæ¹æ³ãšèšå®ãèšè¿°ããŸã (äŸ: `output alert_fast: alert.fast`, `output log_tcpdump: tcpdump.log`)ãSyslogãžã®åºåèšå® (`output alert_syslog: …`) ãå¯èœã§ãã
- `include $RULE_PATH/…`: èªã¿èŸŒãã«ãŒã«ãã¡ã€ã«ãæå®ããŸãã`local.rules` ãªã©ãã«ã¹ã¿ã ã«ãŒã«çšã®ãã¡ã€ã«ãå«ããããšãéèŠã§ãã
snort -c /etc/snort/snort.conf -T
â¶ïž Snortã®å®è¡
Snortã¯ã³ãã³ãã©ã€ã³ããå®è¡ããŸããåºæ¬çãªå®è¡ã³ãã³ããšãªãã·ã§ã³ãèŠãŠã¿ãŸãããã
- èšå®ãã¡ã€ã«ã®ãã¹ã:
sudo snort -c /etc/snort/snort.conf -T
- NIDSã¢ãŒãã§èµ·å (ã³ã³ãœãŒã«ã«ç°¡æã¢ã©ãŒã衚瀺):
sudo snort -c /etc/snort/snort.conf -A console -i eth0
-c <èšå®ãã¡ã€ã«>
: 䜿çšããèšå®ãã¡ã€ã«ãæå®ã-A console
: ã¢ã©ãŒããã³ã³ãœãŒã«ã«ç°¡æ衚瀺ãä»ã«fast
(é«éã¢ã©ãŒã圢åŒ),full
(å®å šãã±ããããã衚瀺),syslog
,none
ãªã©ã-i <ã€ã³ã¿ãŒãã§ãŒã¹>
: ç£èŠãããããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹ãæå®ã
- NIDSã¢ãŒãã§èµ·å (ããã¯ã°ã©ãŠã³ãå®è¡ããã°ãã¡ã€ã«åºå):
sudo snort -c /etc/snort/snort.conf -l /var/log/snort -D -i eth0 -u snort -g snort
-l <ãã°ãã£ã¬ã¯ããª>
: ãã°ãåºåãããã£ã¬ã¯ããªãæå®ã-D
: ããŒã¢ã³ã¢ãŒãïŒããã¯ã°ã©ãŠã³ãïŒã§å®è¡ã-u <ãŠãŒã¶ãŒ>
: Snortãå®è¡ãããŠãŒã¶ãŒãæå®ã-g <ã°ã«ãŒã>
: Snortãå®è¡ããã°ã«ãŒããæå®ã
- ã€ã³ã©ã€ã³ã¢ãŒã (NIPS) ã§èµ·å (èŠèšå®):
sudo snort -c /etc/snort/snort.conf -l /var/log/snort -Q --daq afpacket --daq-mode inline -i eth0:eth1 -u snort -g snort
-Q
: ã€ã³ã©ã€ã³ã¢ãŒããæå¹åã--daq <type>
: 䜿çšããDAQã¢ãžã¥ãŒã«ãæå® (äŸ: afpacket, ipfw, pcap)ã--daq-mode inline
: DAQã®ã¢ãŒããæå®ã-i eth0:eth1
: ã€ã³ã©ã€ã³ã¢ãŒãã§äœ¿çšãã2ã€ã®ã€ã³ã¿ãŒãã§ãŒã¹ãæå®ã
- pcapãã¡ã€ã«ã®èªã¿èŸŒã¿åæ:
snort -c /etc/snort/snort.conf -r traffic.pcap -l ./log
-r <pcapãã¡ã€ã«>
: åæããpcapãã¡ã€ã«ãæå®ã
éåžžãNIDS/NIPSã¢ãŒãã§éçšããå Žåã¯ãSystemdãªã©ã®ãµãŒãã¹ç®¡çã·ã¹ãã ã䜿ã£ãŠãã·ã¹ãã ã®èµ·åæã«èªåçã«Snortãèµ·åããããã«èšå®ããŸãã
ð¯ Snortã®ãŠãŒã¹ã±ãŒã¹ãšã¡ãªãã
Snortã¯ãã®æè»æ§ãšåŒ·åãªæ©èœã«ãããæ§ã ãªå Žé¢ã§æŽ»çšãããŠããŸãã
- äžæ£ã¢ã¯ã»ã¹æ€ç¥: ããŒãã¹ãã£ã³ãè匱æ§ãçã£ãæ»æããã«ãŠã§ã¢ææã®éä¿¡ãªã©ããªã¢ã«ã¿ã€ã ã§æ€ç¥ããŸãã
- äŸµå ¥é²æ¢: NIPSã¢ãŒãã§éçšããããšã§ãæ€ç¥ããæ»æéä¿¡ãèªåçã«é®æãã被害ãæªç¶ã«é²ããŸãã
- ãããã¯ãŒã¯ãã©ã¬ã³ãžãã¯: ãã±ãããã¬ãŒã¢ãŒãã§åéãããã±ããããŒã¿ãåæããã€ã³ã·ãã³ãçºçæã®åå 調æ»ã蚌æ ä¿å šã«åœ¹ç«ãŠãŸãã
- ããªã·ãŒæºæ ã®ç£èŠ: çµç¹å ã®ãããã¯ãŒã¯ããªã·ãŒã«éåããéä¿¡ïŒèš±å¯ãããŠããªããããã³ã«ã®äœ¿çšãªã©ïŒãç£èŠããŸãã
- ãã©ãã£ãã¯åæ: ãããã¯ãŒã¯äžãæµãããã©ãã£ãã¯ã®çš®é¡ãåŸåãææ¡ãããããã¯ãŒã¯ç®¡çãæé©åã«åœ¹ç«ãŠãŸãã
Snortãå©çšããã¡ãªãã:
- â ãªãŒãã³ãœãŒã¹ & ç¡æ: ã©ã€ã»ã³ã¹è²»çšããããããå°å ¥ã³ã¹ããæããããŸãã
- â é«ãã«ã¹ã¿ãã€ãºæ§: ã«ãŒã«ãèšå®ãèªç±ã«ã«ã¹ã¿ãã€ãºã§ããç¹å®ã®ç°å¢ã«æé©åã§ããŸãã
- â 掻çºãªã³ãã¥ããã£: äžçäžã®ãŠãŒã¶ãŒãéçºè ã«ãããµããŒããæ å ±å ±æã掻çºã§ããã«ãŒã«ã»ãããé »ç¹ã«æŽæ°ãããŸãã
- â è±å¯ãªå®çžŸ: é·å¹Žã«ãããå€ãã®ç°å¢ã§å©çšãããŠãããä¿¡é Œæ§ãšå®å®æ§ãé«ãã§ãã
- â åŠç¿ãªãœãŒã¹: IDS/IPSã®ä»çµã¿ããããã¯ãŒã¯ã»ãã¥ãªãã£ãåŠã¶ããã®åªããææãšãªããŸãã
ð ãŸãšã
Snortã¯ããããã¯ãŒã¯ã»ãã¥ãªãã£ã®åéã§éåžžã«åŒ·åãã€æè»ãªãªãŒãã³ãœãŒã¹IDS/IPSããŒã«ã§ãããããã¯ãŒã¯ãã©ãã£ãã¯ãç£èŠããã«ãŒã«ã«åºã¥ããŠè åšãæ€ç¥ã»é²åŸ¡ããåºæ¬çãªä»çµã¿ãããSnort 3ã§ã®å€§å¹ ãªæ©èœåŒ·åãŸã§ããã®æŠèŠã解説ããŸããã
å°å ¥ãšèšå®ã«ã¯ããçšåºŠã®ç¥èãšæéãå¿ èŠã§ãããé©åã«èšå®ã»éçšããã°ããããã¯ãŒã¯ã®å®å šæ§ãå€§å¹ ã«åäžãããããšãã§ããŸãããªãŒãã³ãœãŒã¹ã§ãããããã³ã¹ããæãã€ã€é«åºŠãªã»ãã¥ãªãã£å¯Ÿçãå®çŸãããå Žåãããããã¯ãŒã¯ã»ãã¥ãªãã£ã®åŠç¿ãæ·±ãããå Žåã«ãSnortã¯æé©ãªéžæè¢ã®äžã€ãšãªãã§ããããð¡ïž
ãã®èšäºããSnortã®äžçãžã®ç¬¬äžæ©ãšãªãå©ãã«ãªãã°å¹žãã§ãããã²ãå®éã«è©ŠããŠã¿ãŠããã®ãã¯ãã«ãªæ©èœãäœéšããŠãã ããïŒð
ã³ã¡ã³ã