next up previous contents
Next: GTP Decoder and Preprocessor Up: Reputation Preprocessor Previous: Events   Contents

Shared memory support

In order to minimize memory consumption when multiple Snort instances are running concurrently, we introduce the support of shared memory. After configured, all the snort instances share the same IP tables in shared memory.

System requirement
This feature is supported only in Linux.

Build configuration

A new option, -enable-shared-rep is introduced to ./configure command. This option enables the support for shared memory.
Configuration

shared_mem
If the build supports shared memory, this configuration will enable shared memory. If this option isn't set, standard memory is used. This option must specify a path or directory where IP lists will be loaded in shared memory. One snort instance will create and maintain the shared IP lists. We use instance ID 1, specified in the snort -G option to be the master snort. All the other snort instances are clients (readers).

Syntax
    shared_mem: path
Examples
          
    shared_mem  /user/reputation/iplists
shared_refresh

This option changes the period of checking new shared memory segment, in the unit of second. By default, the refresh rate is $60$ seconds.

Syntax
    
    shared_refresh <period>
    period = "1 - 4294967295"
Examples
            
    shared_refresh 60

Steps to configure shared memory

Reload IP lists using control socket
Using manifest file to manage loading (optional)
Using manifest file, you can control the file loading sequence, action taken, and support zone based detection. You can create a manifest file named ``zone.info'' in the IP list directory.

When Snort is signaled to load new lists, a manifest file is read first to determine which zones the IPs in each list are applicable to and what action to take per list (Block, White, Monitor).

Files listed in manifest are loaded from top to bottom. You should put files that have higher priority first. In manifest file, you can put up to 255 files. Without manifest file, files will be loaded in alphabet order.

Here's the format of the manifest file. Each line of the file has the following format:
 
     <filename>, <list id>,<action>[, <zone>]+
  
     <list id> ::= 32 bit integer
     <action> ::= "monitor"|"block"|"white"
     <zone>  ::= [0-1051]

Using manifest file, you can specify a new action called ``monitor'', which indicates a packet needs to be inspected, but does not disable detection. This is different from ``block'' action, which disables further detection. This new action helps users evaluate their IP lists before applying it.
An exmple manifest file:
 
     #ipreputation manifest file
     white.wlf, 111 ,white, 
     black1.blf, 1112, black,  3, 12
     black2.blf, 1113, black,  3, 12
     monitor.blf,2222, monitor, 0, 2, 8

next up previous contents
Next: GTP Decoder and Preprocessor Up: Reputation Preprocessor Previous: Events   Contents
Eugene Misnik 2013-05-08