Ulogd (and also ulogd2) is a powerful and flexible logging system for
Netfilter/Iptables, based on a plugin system. It allows, for example, to
log packets in a SQL database, and have some interface to analyze it
(see Nulog2)
Architecture
Ulogd2 combines plugins to create a stack, where each plugin is chained
to another. There are three types of plugins:
A stack must have only one source, and one output (yet it can
have several filters). It is possible to define several stacks in
the configuration.
Each plugin has a type (for ex, PGSQL), and must be instanciated
(using a name chosen by the user). Each instance is a particular version
of the plugin, defining parameters. This way, we will be able to output
data in several formats using different stacks.
For ex, the following stack :
stack=log1:NFLOG,base1:BASE,ifi1:IFINDEX,print1:PRINTPKT,pgsql1:PGSQL
defines a stack with the following properties:
- input plugin is NFLOG, this means we’ll use the
-j NFLOG
target of iptables as source
- filters are BASE, IFINDEX, and PRINTPKT (we’ll cover what they do later)
- output plugin is of type PGSQL, so data will be logged to a …
read more