Ulogd2, Advanced firewall logging



Similar documents
Network Security Management

Innominate mguard Version 6


Vuurmuur - iptables manager

Perdix: A Query Language for Security Logs

Linux Firewall. Linux workshop #2.

Netfilter. GNU/Linux Kernel version 2.4+ Setting up firewall to allow NIS and NFS traffic. January 2008

+ iptables. packet filtering && firewall

TECHNICAL NOTES. Security Firewall IP Tables

Intro to Linux Kernel Firewall

Suricata 2.0, Netfilter and the PRC

Main functions of Linux Netfilter

Fault tolerant stateful firewalling with GNU/Linux. Pablo Neira Ayuso Proyecto Netfilter University of Sevilla

Firewalls. Chien-Chung Shen

Netfilter s connection tracking system

Linux firewall. Need of firewall Single connection between network Allows restricted traffic between networks Denies un authorized users

Firewall. IPTables and its use in a realistic scenario. José Bateira ei10133 Pedro Cunha ei05064 Pedro Grilo ei09137 FEUP MIEIC SSIN

Firewall Implementation

Course Title: Penetration Testing: Security Analysis

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

Emerald. Network Collector Version 4.0. Emerald Management Suite IEA Software, Inc.

Attack Detection and Response with Linux Firewalls

Network Monitoring and Management NetFlow Overview

Optimisacion del ancho de banda (Introduccion al Firewall de Linux)

Netfilter / IPtables

Network Virtualization Based on Flows

Module: Firewalls. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

CSC574 - Computer and Network Security Module: Firewalls

Software Defined Networking (SDN) OpenFlow and OpenStack. Vivek Dasgupta Principal Software Maintenance Engineer Red Hat

Chapter 7. Firewalls

CIT 480: Securing Computer Systems. Firewalls

Introduction to Netflow

CSE543 - Computer and Network Security Module: Firewalls

Snort Installation - Ubuntu FEUP. SSI - ProDEI Paulo Neto and Rui Chilro. December 7, 2010

Definition of firewall

Watch your Flows with NfSen and NFDUMP 50th RIPE Meeting May 3, 2005 Stockholm Peter Haag

Linux MDS Firewall Supplement

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

CIT 480: Securing Computer Systems. Firewalls

CS Computer and Network Security: Firewalls

Advanced routing scenarios POLICY BASED ROUTING: CONCEPTS AND LINUX IMPLEMENTATION

Linux Network Security

Stateful Firewalls. Hank and Foo

GregSowell.com. Mikrotik Security

CIS 433/533 - Computer and Network Security Firewalls

Flow-based network accounting with Linux

How To Understand A Firewall

Firewalls, NAT and Intrusion Detection and Prevention Systems (IDS)

CSE331: Introduction to Networks and Security. Lecture 12 Fall 2006

CS Computer and Network Security: Firewalls

Firewalls P+S Linux Router & Firewall 2013

ICS 351: Today's plan. IP addresses Network Address Translation Dynamic Host Configuration Protocol Small Office / Home Office configuration

Linux Firewall Wizardry. By Nemus

Linux Home Networking II Websites At Home

Focus on Security. Keeping the bad guys out

Building a Home Gateway/Firewall with Linux (aka Firewalling and NAT with iptables )

Firewalls. Ingress Filtering. Ingress Filtering. Network Security. Firewalls. Access lists Ingress filtering. Egress filtering NAT

Protecting and controlling Virtual LANs by Linux router-firewall

Network packet capture in Linux kernelspace

Distributed Systems. Firewalls: Defending the Network. Paul Krzyzanowski

Telematics. 14th Tutorial - Proxies, Firewalls, P2P

nfdump and NfSen 18 th Annual FIRST Conference June 25-30, 2006 Baltimore Peter Haag 2006 SWITCH

IPv6/IPv4 Automatic Dual Authentication Technique for Campus Network

Linux Routers and Community Networks

Firewalls and System Protection

Firewall Firewall August, 2003

Linux: 20 Iptables Examples For New SysAdmins

Michal Ludvig, SUSE Labs, 01/30/2004, Secure networking, 1

Firewall implementation and testing

Snapt Balancer Manual

Linux Firewalls (Ubuntu IPTables) II

Linux Virtual Server Tutorial

Computer Firewalls. The term firewall was originally used with forest fires, as a means to describe the

Netfilter Performance Testing

FIREWALL AND NAT Lecture 7a

PAN-OS Syslog Integration

Netfilter Failover. Connection Tracking State Replication. Krisztián Kovács

Stateful Connection Tracking & Stateful NAT

IP Address: the per-network unique identifier used to find you on a network

Worksheet 9. Linux as a router, packet filtering, traffic shaping

Firewalls. Chapter 3

Software Defined Networking

Improving DNS performance using Stateless TCP in FreeBSD 9

VENKATAMOHAN, BALAJI. Automated Implementation of Stateful Firewalls in Linux. (Under the direction of Ting Yu.)

An Open Source IPS. IIT Network Security Project Project Team: Mike Smith, Sean Durkin, Kaebin Tan

Network Security Monitoring and Behavior Analysis Pavel Čeleda, Petr Velan, Tomáš Jirsík

Intrusion Detection Systems (IDS)

tcpdump: network traffic capture

Introduction to Passive Network Traffic Monitoring

Packet filtering with Linux

7. Firewall - Concept

Firewall Testing. Cameron Kerr Telecommunications Programme University of Otago. May 16, 2005

Linux MPS Firewall Supplement

Understanding and Configuring NAT Tech Note PAN-OS 4.1

Solution of Exercise Sheet 5

From traditional to alternative approach to storage and analysis of flow data. Petr Velan, Martin Zadnik

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Transcription:

Ulogd2, Advanced firewall logging INL 172 rue de Charonne 75011 Paris, France RMLL 2009, July 8, Nantes Ulogd2, Netfilter logging reloaded 1/ 38

Some words about me NuFW main developper INL co-founder Netfilter hacker some kernel stuff userspace library ulogd2 organizer of Netfilter Workshop 2008 Ulogd2, Netfilter logging reloaded 2/ 38

Netfilter logging history At the beginning was syslog Pre Netfilter days Flat packet logging One line per packet A lot of information Non searchable INPUT DROP IN=eth0 OUT= MAC=00:1a:92:05:ee:68:00:b0:8e:83:3b:f0:08:00 SRC=62.212.121.211 \ DST=91.121.73.151 LEN=60 TOS=0x00 PREC=0x00 TTL=58 ID=35342 DF PROTO=TCP SPT=59261 \ DPT=113 WINDOW=5440 RES=0x00 SYN URGP=0 Ulogd2, Netfilter logging reloaded 3/ 38

Netfilter logging history Ulogd days Netfilter introduces ULOG target iptables -A INPUT -p tcp -j ULOG --ulog-prefix "bad packet" Communication via a netlink socket Special type of socket used for kernel userspace bidirectionnal communication Ulogd, a logging daemon Syslog and file output SQL output: PGSQL, MySQL, SQLite Ulogd2, Netfilter logging reloaded 4/ 38

Netfilter logging history Linux 2.6.14: Netfilter userspace reloaded Netfilter introduces NFnetlink Rewrote userspace interaction For logging, queueing and connection tracking Multiple communication on a single netlink socket Three new libraries libnetfilter_queue: userspace decision libnetfilter_log: logging libnetfilter_conntrack: connection tracking handling Ulogd2, Netfilter logging reloaded 5/ 38

Netfilter logging history Ulogd2: an ulogd generalisation Interact with the new libraries Rewrite of ulogd libnetfilter_log Packet logging IPv6 ready Few structural modification libnetfilter_conntrack Connection tracking logging Accounting, logging Completely new Ulogd2, Netfilter logging reloaded 6/ 38

1 Introduction 2 Connection tracking 3 Ulogd2 Architecture 4 Using Ulogd2 5 Conclusion Ulogd2, Netfilter logging reloaded 7/ 38

Some words about connection tracking Stateful filtering Original IP packet filter: Filter only on IP header fields Have no idea of the packet history Stateful filtering is: follow the history of connection Is packet part of an existing connection? Is packet correct relatively to the protocol? to determine the validity of a packet Ulogd2, Netfilter logging reloaded 8/ 38

Some words about connection tracking Netfilter connection tracking Netfilter maintains a connection table Valid for "all" protocols For flow-oriented protocol: TCP, SCTP For protocol without state: UDP Support both IPv4 and IPv6 Ulogd2, Netfilter logging reloaded 9/ 38

Some words about connection tracking Network Address Translation Private Network can t go to internet Firewall has to modify packet to show its address Two way of seeing a connection From inside From outside Conntrack keep track of the correspondance tcp 6 431996 ESTABLISHED src=192.168.1.131 dst=91.121.73.151 sport=52964 dport=22\ packets=13 bytes=772 src=91.121.73.151 dst=192.168.1.131 sport=22 dport=52964 \ packets=11 bytes=7548 [ASSURED] mark=0 secmark=0 use=1 \ Ulogd2, Netfilter logging reloaded 10/ 38

Some words about connection tracking libnetfilter_conntrack: Connection tracking handling library Interrogation: Connections listing Retrieve information about a connection IP information Accounting statistics Modification: Create new entry Change or fix timeout Change mark Destruction Ulogd2, Netfilter logging reloaded 11/ 38

Some words about connection tracking Connection tracking events Send all significative connection related events to userspace : NEW: connection creation ESTABLISHED: Switch from NEW to ESTABLISHED connection DESTROY: connection destruction Make possible to maintain a connection history in userspace Accounting information NAT decision history Ulogd2, Netfilter logging reloaded 12/ 38

Netfilter logging Ulogd2, a modular daemon Able to use multiple entries Support for packet logging Support for flow logging And multiple output Text based DB based Plugin based architecture Entry Output Filters Ulogd2, Netfilter logging reloaded 13/ 38

Netfilter logging Ulogd2, schema of architecture Ulogd2, Netfilter logging reloaded 14/ 38

Netfilter logging Packet logging Compatible with old kernel IPv4 support: ULOG NFLOG IPv6 support: NFLOG only Hardware information: Network interfaces Hardware header Ulogd2, Netfilter logging reloaded 15/ 38

Netfilter logging Connection tracking event logging libnetfilter_conntrack based IPv4 and IPv6 Listen to events Contains the two IP tuples Orig IP header Reply IP header Ulogd2, Netfilter logging reloaded 16/ 38

From input to output The stack concept Workflow based configuration: stack Choose an input Describe treatment and transformation to apply Choose an output Based on key value propagation trough the stack stack=log1:nflog,base1:base,ifi1:ifindex,ip2str1:ip2str,print1:printpkt,emu1:logemu stack=ct1:nfct,mark1:mark,ip2str1:ip2str,pgsql2:pgsql Ulogd2, Netfilter logging reloaded 17/ 38

From input to output The stack concept: plugin Each plugin has : Input keys Output keys Plugin structure # /opt/ulogd2/sbin/ulogd --info /opt/ulogd2/lib/ulogd/ulogd_filter_ip2str.so Name: IP2STR Input keys: Key: oob.family (unsigned int 8) Key: oob.protocol (unsigned int 16) Key: ip.saddr (IP addr) Key: ip.daddr (IP addr) [...] Output keys: Key: ip.saddr.str (string) Key: ip.daddr.str (string) [...] Ulogd2, Netfilter logging reloaded 18/ 38

From input to output Ulogd2, the stack concept Ulogd2, Netfilter logging reloaded 19/ 38

From input to output Ulogd2, the stack concept Ulogd2, Netfilter logging reloaded 20/ 38

From input to output Various output plugin File-based Syslog File PCAP Databases PGSQL MySQL Sqlite (TODO) Ulogd2, Netfilter logging reloaded 21/ 38

From input to output Treatment and filtering Treatment plugins: Decoding plugins: BASE, IFINDEX Conversion plugins: IP2STR, IP2BIN, MAC2STR Filtering: Decide if treatment has to be continued MARK plugin: stop propagation through stack if there is no match on mark Multiplexing: Reusing INPUT data Multiple logging Ulogd2, Netfilter logging reloaded 22/ 38

SQL output Really use databases Let dababase work to the database Use database capability Procedure for insertion Extensible schemas Optimize schema Avoid empty fields Index on most frequent request Autoconfiguration ulogd calls a procedure params are taken from field name in a table no need to recompile ulogd if we change the DB Ulogd2, Netfilter logging reloaded 23/ 38

SQL output Easy modification Procedure can do different things with data Provided procedure Insertion of all available data in DB For connection tracking For packet logging Possible extension Arbitrary accounting Statistics Ulogd2, Netfilter logging reloaded 24/ 38

SQL output Extensible database schemas Ulogd2, Netfilter logging reloaded 25/ 38

SQL output Extensible database schemas Easy to extend Add table with your custom field link ID of the new table with ulog2 ID. Ulogd2, Netfilter logging reloaded 26/ 38

SQL output Use VIEW for usage ease VIEW can be built for common task TCP quad view CREATE OR REPLACE VIEW view_tcp_quad AS SELECT ulog2._id,ulog2.ip_saddr_str,tcp.tcp_sport, ulog2.ip_daddr_str,tcp.tcp_dport FROM ulog2 INNER JOIN tcp ON ulog2._id = tcp._tcp_id; and provide easy select TCP quad select ulog2=> SELECT ip_saddr_str,tcp_dport FROM view_tcp_quad; ip_saddr_str tcp_dport ---------------+----------- 148.60.18.179 1194 148.60.18.179 1194 Ulogd2, Netfilter logging reloaded 27/ 38

Packet logging Security interest Analysed dropped traffic Attack attempt Scans Worms or trojan traffic Analyse authorized traffic Keep a trace of access to critical data Forensic on succesful attack Work with other security subsystem Ulogd2, Netfilter logging reloaded 28/ 38

Packet logging Production interest A firewall block some packets Packet necessary for network services Logging is critical when setting up a new firewall and detect misconfiguration Packet necessary for network services Packets revealing improper configuration of service Ulogd2, Netfilter logging reloaded 29/ 38

Packet logging Nulog: displaying packet data Display SQL data (Ulogd1 format) Ulogd2 support in progress Ulogd2, Netfilter logging reloaded 30/ 38

Connection event logging Security interest Advantages of logging flow over logging packet Start time End time Volume information Better view of severity of the event Duration information Data volume NAT information Ulogd2, Netfilter logging reloaded 31/ 38

Connection event logging Recover internal IP from external data Connection logging contains Orig IP tuple Reply IP tuple Someone from outside asks you information about an attack: Extern world only knows the Reply tuple Connection logging lead you to the IP at the origin of an attack Ulogd2, Netfilter logging reloaded 32/ 38

Connection event logging Accounting Each connection logging contains: bytes usage packet usage Summing usage lead you to global statistic Using any IP criteria (per port or per IP bandwith) Or using external information (per user bandwith) Ulogd2, Netfilter logging reloaded 33/ 38

NF3D NF3D Data visualisation tryout Represent both packet and connection on a graph Link packet to their corresponding connection Connections are displayed in a GANTT fashion Ulogd2, Netfilter logging reloaded 34/ 38

NF3D NF3D: SSH brute force Ulogd2, Netfilter logging reloaded 35/ 38

NF3D NF3D: Demonstration Let s pray Murphy. Ulogd2, Netfilter logging reloaded 36/ 38

A complete logging system ulogd2 is a complete logging tool for Netfilter Packet logging Connection logging Easy to extend Via plugin Via database modification Ulogd2, Netfilter logging reloaded 37/ 38

Questions? Contacts: Directly: eric@inl.fr Mailling List: netfilter-devel@vger.kernel.org References: Ulogd2: http://netfilter.org/projects/ulogd/index.html Ulogd2 documentation: http://software.inl.fr/trac/wiki/ulogd2/user Nulog: http://software.inl.fr/trac/wiki/edenwall/nulog NF3D: http://software.inl.fr/trac/wiki/nf3d Ulogd2, Netfilter logging reloaded 38/ 38