

These directives can be used to replace many command line options as well. Examples include the location of log files, the order ofĪpplying rules and so on. The config directives in the nf file allow a user to configure many general settings for Snort. While installing Snort, you need to modify these variables according to your There are many variables defined in the nf file that come with the Snort distribution. It matches to everything, just as it does in rules (such as addresses and port numbers).įor example, if you want to test packets regardless of their source, you can define a variable like the following for EXTERNAL_NET. This arrangement is more convenient since you can change IP addresses on the interfaces without modifying rules or even variables themselves. The HOME_NET variable uses the IP address and network mask value assigned to interface eth0 and EXTERNAL_NET uses the IP address and network mask assigned to network interface eth1. The following two statements define HOME_NET and EXTERNAL_NET variables You can also use interface names in defining variables. 3.7.1.2 Using Interface Names in Variables Var HOME_NET Īll networks in the variable name are separated by a comma. The following variable shows that HOME_NETWORK consists of two networks, 192.168.1.0/24 and 192.168.10.0/24. You can define a variable as a list of all Your intrusionĭetection system is right behind the company firewall connecting to the Internet. Consider that you have multiple networks in the company. You can also define variables that contain multiple items. ForĮxample, you don't need to modify all rules when you copy rules from one network to another you just need to modify a singleģ.7.1.1 Using a List of Networks in Variables Later on you can use this variable HOME_NET in your rules:Īlert ip any any -> $HOME_NET any (ipopts: lsrr msg: "Loose source routing attempt" sid: 1000001 )Īs you can see, using variables makes it very convenient to adapt the configuration file and rules to any environment. For example, you can defineĪ variable HOME_NET in the configuration file. This is a very convenient way of creating rules. In the configuration file, you can use variables. This keyword will be discussed later in this chapter.Īlthough the out-of-the-box configuration file works, you need to modify it to adapt it to your environment. These files are then included inside the main configuration file Although you can add any rules in the main nf file, the convention is to use separate files for rules. If the predefined action types are not sufficient for your environment, you can define custom action Output modules control how Snort data will be logged.ĭefining new action types. Preprocessors are used to perform certain actions before a packet is operated by the main Snort Some of them can also be used on the command These parameters specify different Snort configuration options. Like specifying the location of rule files.Ĭonfig parameters. These variables are used in Snort rules as well as for other purposes, Variable definitions, where you define different variables. Network interfaces with different configuration. For example, it is possible to invoke multiple Snort instances on different There are other advantages to using the configurationįile name as a command line argument to Snort. snortrc, but specifying it on the command line is the most widely used method. You can also save the configuration file in your home directory as. The following command uses /opt/snort/nf as the configuration file. You use the -c command line switch to specify the name of the configuration file. You can use any name for the configuration file, however nf is the conventional name.

A sample configuration file nf is included in the Snort distribution. Snort uses a configuration file at startup time. Learn More Buy 3.7 The Snort Configuration File Intrusion Detection with SNORT: Advanced IDS Techniques Using SNORT, Apache, MySQL, PHP, and ACID
