Suricata is a network Intrusion Detection System, Intrusion Prevention System and Network Security Monitoring engine developed by the OISF and the Suricata community.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Eric Leblond 662dccd8a5 af-packet: IPS and TAP feature
This patch adds a new feature to AF_PACKET capture mode. It is now
possible to use AF_PACKET in IPS and TAP mode: all traffic received
on a interface will be forwarded (at the Ethernet level) to an other
interface. To do so, Suricata create a raw socket and sends the receive
packets to a interface designed in the configuration file.

This patch adds two variables to the configuration of af-packet
interface:
 copy-mode: ips or tap
 copy-iface: eth1 #the interface where packet are copied
If copy-mode is set to ips then the packet wth action DROP are not
copied to the destination interface. If copy-mode is set to tap,
all packets are copied to the destination interface.
Any other value of copy-mode results in the feature to be unused.
There is no default interface for copy-iface and the variable has
to be set for the ids or tap mode to work.

For now, this feature depends of the release data system. This
implies you need to activate the ring mode and zero copy. Basically
use-mmap has to be set to yes.

This patch adds a peering of AF_PACKET sockets from the thread on
one interface to the threads on another interface. Peering is
necessary as if we use an other socket the capture socket receives
all emitted packets. This is made using a new AFPPeer structure to
avoid direct interaction between AFPTreadVars.

There is currently a bug in Linux kernel (prior to 3.6) and it is
not possible to use multiple threads.

You need to setup two interfaces with equality on the threads
variable. copy-mode variable must be set on the two interfaces
and use-mmap must be set to activated.

A valid configuration for an IPS using eth0 and vboxnet1 interfaces
will look like:

af-packet:
  - interface: eth0
    threads: 1
    defrag: yes
    cluster-type: cluster_flow
    cluster-id: 98
    copy-mode: ips
    copy-iface: vboxnet1
    buffer-size: 64535
    use-mmap: yes
  - interface: vboxnet1
    threads: 1
    cluster-id: 97
    defrag: yes
    cluster-type: cluster_flow
    copy-mode: ips
    copy-iface: eth0
    buffer-size: 64535
    use-mmap: yes
13 years ago
benches Initial add of the files. 16 years ago
contrib/file_processor Included Action::Syslog by default in config 14 years ago
doc Add missing Makefile.am files for rules/ and doc/ dir. 14 years ago
libhtp spelling corrections documented in redmine bug#533 13 years ago
m4 Prelude plugin: add detection in configure script 16 years ago
qa Update coccinelle script to match syntax evolution. 14 years ago
rules decode: decode IPv6-in-IPv6 13 years ago
src af-packet: IPS and TAP feature 13 years ago
.gitignore Import .gitignore file. 15 years ago
COPYING Initial add of the files. 16 years ago
ChangeLog Update Changelog to include 1.3.1 changes. 13 years ago
LICENSE import of gplv2 LICENSE 16 years ago
Makefile.am Windows build and other misc fixes. 13 years ago
Makefile.cvs Initial add of the files. 16 years ago
acsite.m4 Added C99 defs/macros to acsite.m4 for CentOS 16 years ago
autogen.sh autotools: error on autoreconf is an error 13 years ago
classification.config Import of classification.config 16 years ago
configure.ac Update version number to reflect we're working towards 1.4 now. 13 years ago
doxygen.cfg doc: Include htp documentation. 14 years ago
mkinstalldirs Update autojunk.sh + build update. 16 years ago
reference.config Add md5 to reference.config. 14 years ago
suricata.yaml.in af-packet: IPS and TAP feature 13 years ago