Building IDS RulesSetting Network Variables You must change the following variables to reflect your local network. You can specify it explicitly as: var HOME_NET 10.1.1.0/24 or use ôanyö.You can specify lists of IP addresses for HOME_NET by separating the IPs with commas like this: var HOME_NET [10.1.1.0/24,192.168.1.0/24]. MAKE SURE YOU DON'T PLACE ANY SPACES IN YOUR LIST! The default value for HOME_NET is: var HOME_NET any Set up the external network addresses as well. A good start may be "any" var EXTERNAL_NET any Set up your SMTP, web, sql and DNS servers, or simply configure them to HOME_NET: var SMTP $HOME_NET You need not to use SMTP, web, sql and DNS server rules if there arenÆt appropriate servers installed on client computers, since these rules are targeted for attacks to them and are meaningful only for IDS implementations on an internet gateway. Customize your rule set Up to date snort rules are available at http://www.snort.org. The snort web site has documentation about how to write your own custom snort rules. The rules included with default IDS blackbox generate alerts based on suspicious activity. Depending on your network environment, your security policies, and what you consider to be suspicious, some of these rules may either generate false positives ore may be detecting activity you consider to be acceptable; therefore, you are encouraged to comment out rules that are not applicable in your environment. Note that using all of the rules at the same time may lead to performance decrease on slower machines. Shell code, policy, info, backdoor, and virus rule sets should be disabled by default. These require tuning and maintenance. For example, the shell code rules require detailed inspection of each packet thus increasing the requirements for the computer computing power. The following rule set files are included by default: bad-traffic.rules We recommend to comment out (using #) all unnecessary rule sets at the end of snort.conf file before building the SNORT configuration blackbox to avoid false positives and increase performance. Please see appropriate *.rules file for further detailed description about particular rule set. Creating or Modifying Single SNORT Rules Example: alert tcp $HOME_NET 23 -> $EXTERNAL_NET any (msg:"TELNET root login"; content:"login\: root"; flags: A+; class type:suspicious-login; sid:719; rev:2;) The above rule issues monitoring (here named alert) of any attempt that telnet application on DSE client computer (local port 23) sends packet with TCP ack bit set (flags:A+) and there is the string "login\: root" contained in the packet. ôsidö is the unique id of this IDS rule û you must take care about that in your own rules, otherwise an error during building IDS blackbox will be issued. "TELNET root login" will be the message to be seen in the event reporting. ôclasstypeö and ôrevö fields are ignored. Please see for further details how to write single SNORT rules. Rule Options Details 1) COMMENTS 2) PREPROCESSOR - defines plug-in running between packet decoding and detection engine 3) INCLUDE syntax: - includes given file 4) VARIABLES - defines variable "name" and sets it to given value $name, $(name) replaces with the variable content 5) CONFIG - ignored, but "classification" directive temporarily 6) RULETYPE - defines user action 7) RULES actions: alert, log, pass ignored! protocol: ip, tcp, udp, icmp IP protocols addresses: any all IP addresses port numbers: any all port numbers 8) RULE OPTIONS sid:number - SNORT rule id msg:"message" - prints given message in case of alert ttl:[>|<]number - checks IP time-to-live value tos:[>|<]number - checks IP type-of-service value id:[>|<]number - checks IP id field ipopts:ipopt - checks presence of given IP option in packet rr record route fragbits:[!][R][D][M][+|*] - checks fragmentation control bits in IP packet ! negation ip_proto:[!]name|number - checks protocol number in IP packet sameip - checks if source IP is equal to the destination IP dsize:[>|<]number - checks packet payload size content:[!]"content_string" - finds given string in payload or URI portion of request ! negation - special characters in content_string: offset:number - modifies starting content search position from the beginning of packet payload depth:number - modifies length of the scanned payload region nocase - deactivates case-sensitivity in a content rule regex - turns on wildcards resolving in content string flags:[!]<[F][S][R][P][A][U][2][1]>|0[+|*] - checks TCP packet flags ! negation seq:[>|<]number - checks TCP sequence number ack:[>|<]number - checks TCP acknowledge number itype:[>|<]number - checks ICMP type number icode:[>|<]number - checks ICMP code number icmp_id:[>|<]number - checks ICMP ECHO identifier icmp_seq:[>|<]number - checks ICMP ECHO sequence number rpc:[>|<]app_num,[proc_num|*],[ver_num|*] - looks at RPC requests, decodes and checks the application, procedure and program version temporaly ignored options: content-list:[!]"file_name" ignored options: logto:"file_name" | |||