doc:appunti:linux:sa:ulogd2

This is an old revision of the document!


Monitoraggio con ulogd2

apt install ulogd2

/etc/ulogd.conf

In the configuration file /etc/ulogd.conf we configure one plugin stack adding this line:

# Custom stack for logging connections metadata.
stack=ct1:NFCT,ip2str1:IP2STR,print1:PRINTFLOW,emu1:LOGEMU

This stack definition in the ulog2 configuration file defines a pipeline of processing modules that handle network flow data. Each module in the stack performs a specific transformation or logging function. Here's a breakdown of the components:

  1. ct1:NFCT
    • NFCT stands for Netfilter Connection Tracking.
    • This module extracts connection tracking (conntrack) information from packets, such as session state, source/destination IPs, and ports.
  2. ip2str1:IP2STR
    • IP2STR converts IP addresses into human-readable string representations.
    • This ensures that logs display IP addresses in standard notation instead of numerical or binary formats.
  3. print1:PRINTFLOW
    • PRINTFLOW formats and prints the logged packet or flow information.
    • This is useful for debugging or human-readable log output.
  4. emu1:LOGEMU
    • LOGEMU refers to a custom logging output (generally referred as a logging emulator).
    • This module is responsible for sending logs to a file, database, or another destination.

FIXME

[ct1]
event_mask=0x00000001
hash_enable=0

Plugin Stacks Explained

  • Input plugin
  • None, one or multiple filter plugins
  • One output plugin

In the example above we use the NFCT input plugin, which interfaces with the nfnetlink_conntrack kernel subsystem, and provides flow-based logging. FIXME

The option hash_enableFIXME

/etc/logrotate.d/ulogd2

systemctl enable ulogd2.service
systemctl start ulogd2.service
doc/appunti/linux/sa/ulogd2.1743673756.txt.gz · Last modified: 2025/04/03 11:49 by niccolo