SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
SCALING YOUR
LOGGING INFRASTRUCTURE
WITH SYSLOG-NG
All Things Open 2016
Peter Czanik / Balabit
2
ABOUT ME
 Peter Czanik from Hungary
 Community Manager at Balabit: syslog-ng
upstream
 syslog-ng packaging, support, advocacy
Balabit is an IT security company with development
HQ in Budapest, Hungary
Over 200 employees: the majority are engineers
3
syslog-ng
Logging
Recording events, such as:
Jan 14 11:38:48 linux-0jbu sshd[7716]: Accepted publickey for root
from 127.0.0.1 port 48806 ssh2
syslog-ng
Enhanced logging daemon with a focus on high-performance
central log collection.
4
WHY CENTRAL LOGGING?
EASE OF USE
one place to check
instead of many
AVAILABILITY
even if the sender
machine is down
SECURITY
logs are available even
if sender machine
is compromised
5
MAIN SYSLOG-NG ROLES
collector processor filter storage
(or forwarder)
6
ROLE: DATA COLLECTOR
Collect system and application logs together:
contextual data for either side
A wide variety of platform-specific sources:
 /dev/log & co
 Journal, Sun streams
Receive syslog messages over the network:
 Legacy or RFC5424, UDP/TCP/TLS
Logs or any kind of data from applications:
 Through files, sockets, pipes, etc.
 Application output
7
ROLE: PROCESSING
Classify, normalize and structure logs with built-in parsers:
 CSV-parser, DB-parser (PatternDB), JSON parser, key=value
parser and more to come
Rewrite messages:
 For example anonymization
Reformatting messages using templates:
 Destination might need a specific format (ISO date, JSON, etc.)
Enrich data:
 GeoIP
 Additional fields based on message content
8
ROLE: DATA FILTERING
Main uses:
 Discarding surplus logs (not storing debug level messages)
 Message routing (login events to SIEM)
Many possibilities:
 Based on message content, parameters or macros
 Using comparisons, wildcards, regular expressions and
functions
 Combining all of these with Boolean operators
9
ROLE: DESTINATIONS
“TRADITIONAL”
● File, network, TLS, SQL, etc.
“BIG DATA”
● Distributed file systems:
● Hadoop
● NoSQL databases:
● MongoDB
● Elasticsearch
● Messaging systems:
● Kafka
10
WHICH SYSLOG-NG
VERSION IS THE FASTEST?
 Project started in 1998
 Version 3.3 added multi-threading in 2011
 Latest stable version is 3.8, released two
months ago
11
Kindle e-book reader
on a plane :)
Version 1.6
BMW i3 all electric car
Version 3.4
12
FREE-FORM LOG MESSAGES
Most log messages are: date + hostname + text
Mar 11 13:37:56 linux-6965 sshd[4547]: Accepted
keyboard-interactive/pam for root from 127.0.0.1 port
46048 ssh2
 Text = English sentence with some variable parts
 Easy to read by a human
 Difficult to process them with scripts
13
SOLUTION: STRUCTURED LOGGING
 Events represented as name-value pairs
 Example: an ssh login:
app=sshd user=root source_ip=192.168.123.45
 syslog-ng: name-value pairs inside
 Date, facility, priority, program name, pid, etc.
 Parsers in syslog-ng can turn unstructured and some structured data (CSV,
JSON) into name-value pairs
14
JSON PARSER
Turns JSON-based log messages into name-value pairs
{"PROGRAM":"prg00000","PRIORITY":"info","PID":"1234","MESSAGE":"seq:
0000000000, thread: 0000, runid: 1374490607, stamp: 2013-07-22T12:56:47
MESSAGE... ","HOST":"localhost","FACILITY":"auth","DATE":"Jul 22 12:56:47"}
15
CSV PARSER
Parses columnar data into fields
parser p_apache {
csv-parser(columns("APACHE.CLIENT_IP", "APACHE.IDENT_NAME", "APACHE.USER_NAME",
"APACHE.TIMESTAMP", "APACHE.REQUEST_URL", "APACHE.REQUEST_STATUS",
"APACHE.CONTENT_LENGTH", "APACHE.REFERER", "APACHE.USER_AGENT",
"APACHE.PROCESS_TIME", "APACHE.SERVER_NAME")
flags(escape-double-char,strip-whitespace) delimiters(" ") quote-pairs('""[]')
);
};
destination d_file { file("/var/log/messages-${APACHE.USER_NAME:-nouser}"); };
log { source(s_local); parser(p_apache); destination(d_file);};
16
KEY=VALUE PARSER
Finds key=value pairs in messages
Introduced in version 3.7.
Typical in firewalls, like:
2016-03-04T07:10:19-05:00 127.0.0.1 zorp/http[3486]: core.summary(4):
(svc/http#0/http/intraPLUGinter:267346): Connection summary; rule_id='51',
session_start='1451980783', session_end='1451980784', client_proto='TCP',
client_address='172.168.65.4', client_port='56084', client_zone='office',
server_proto='TCP', server_address='173.252.120.68', server_port='443',
server_zone='internet', client_local='173.252.120.68', client_local_port='443',
server_local='91.120.23.97', server_local_port='46472', verdict='ACCEPTED', info=''
17
PATTERNDB PARSER
PatternDB message parser
Can extract useful information from unstructured messages into name-value pairs
 Add status fields based on message text
 Message classification (like LogCheck)
Needs XML describing log messages
Example: an ssh login failure:
 Parsed: app=sshd, user=root, source_ip=192.168.123.45
 Added: action=login, status=failure
 Classified as “violation”
18
PARSERS WRITTEN IN RUST
Rust parsers
 Rust: https://www.rust-lang.org/
 Supported from 3.8
Example modules in separate repository: https://github.com/balabit/syslog-ng-rust-modules/
 Regexp parser
 Actiondb parser (similar to, but easier to use than patterndb)
 Correlation parser
19
ANONYMIZING MESSAGES
Many regulations about what can be logged
 PCI-DSS: credit card numbers
 Europe: IP addresses, user names
Locating sensitive information:
 Regular expression: slow, works also in unknown logs
 Patterndb: fast, works only in known log messages
Anonymizing:
 Overwrite it with a constant
 Overwrite it with a hash of the original
20
CONFIGURATION
 “Don't Panic”
 Simple and logical, even if it looks difficult at first
 Pipeline model:
 Many different building blocks (sources, destinations,
filters, parsers, etc.)
 Connected into a pipeline using “log” statements
21
syslog-ng.conf: global options
@version:3.7
@include "scl.conf"
# this is a comment :)
options {
flush_lines (0);
# [...]
keep_hostname (yes);
};
22
syslog-ng.conf: sources
source s_sys {
system();
internal();
};
source s_net {
udp(ip(0.0.0.0) port(514));
};
23
syslog-ng.conf: destinations
destination d_mesg { file("/var/log/messages"); };
destination d_es {
elasticsearch(
index("syslog-ng_${YEAR}.${MONTH}.${DAY}")
type("test")
cluster("syslog-ng")
template("$(format-json --scope rfc3164 --scope nv-pairs --exclude R_DATE --key ISODATE)n");
);
};
24
syslog-ng.conf: filters, parsers
filter f_nodebug { level(info..emerg); };
filter f_messages { level(info..emerg) and
not (facility(mail)
or facility(authpriv)
or facility(cron)); };
parser pattern_db {
db-parser(file("/opt/syslog-ng/etc/patterndb.xml") );
};
25
syslog-ng.conf: logpath
log { source(s_sys); filter(f_messages); destination(d_mesg); };
log {
source(s_net);
source(s_sys);
filter(f_nodebug);
parser(pattern_db);
destination(d_es);
flags(flow-control);
};
26
Patterndb & ElasticSearch & Kibana
27
SCALING SYSLOG-NG
 Client – Relay – Server instead of Client – Server
 Distribute some of the processing to Client/Relay
28
LOG ROUTING
 Based on filtering
 Send the right logs to the right places
 Message parsing can increase accuracy
 E-mail on root logins
 Can optimize SIEM / log analyzer tools
 Only relevant messages: cheaper licensing
 Throttling: evening out peaks
29
WHAT IS NEW IN SYSLOG-NG 3.8
 Disk-based buffering
 Grouping-by(): correlation independent
of patterndb
 Parsers written in Rust
 Elasticsearch 2.x support
 Curl (HTTP) destination
 Performance improvements
 Many more :-)
30
SYSLOG-NG BENEFITS
FOR LARGE ENVIRONMENTS
High-performance
reliable log collection
Simplified
architecture
Single application for both
syslog and application data
Easier-to-use data
Parsed and presented in a
ready-to-use format
Lower load on
destinations
Efficient message filtering
and routing
31
JOINING THE COMMUNITY
 syslog-ng: http://syslog-ng.org/
 Source on GitHub: https://github.com/balabit/syslog-ng
 Mailing list: https://lists.balabit.hu/pipermail/syslog-ng/
 IRC: #syslog-ng on freenode
32
QUESTIONS?
My blog: http://czanik.blogs.balabit.com/
My e-mail: peter.czanik@balabit.com
Twitter: https://twitter.com/PCzanik
33
SAMPLE XML
● <?xml version='1.0' encoding='UTF-8'?>
● <patterndb version='3' pub_date='2010-07-13'>
● <ruleset name='opensshd' id='2448293e-6d1c-412c-a418-a80025639511'>
● <pattern>sshd</pattern>
● <rules>
● <rule provider="patterndb" id="4dd5a329-da83-4876-a431-ddcb59c2858c" class="system">
● <patterns>
● <pattern>Accepted @ESTRING:usracct.authmethod: @for @ESTRING:usracct.username: @from @ESTRING:usracct.device: @port @ESTRING::
@@ANYSTRING:usracct.service@</pattern>
● </patterns>
● <examples>
● <example>
● <test_message program="sshd">Accepted password for bazsi from 127.0.0.1 port 48650 ssh2</test_message>
● <test_values>
● <test_value name="usracct.username">bazsi</test_value>
● <test_value name="usracct.authmethod">password</test_value>
● <test_value name="usracct.device">127.0.0.1</test_value>
● <test_value name="usracct.service">ssh2</test_value>
● </test_values>
● </example>
● </examples>
● <values>
● <value name="usracct.type">login</value>
● <value name="usracct.sessionid">$PID</value>
● <value name="usracct.application">$PROGRAM</value>
● <value name="secevt.verdict">ACCEPT</value>
● </values>
● </rule>

Más contenido relacionado

La actualidad más candente

LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
 
What is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.xWhat is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.xUlrich Krause
 
BIRD Routing Daemon
BIRD Routing DaemonBIRD Routing Daemon
BIRD Routing DaemonAPNIC
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and moreBrendan Gregg
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownScyllaDB
 
Home NOC Operators' Group的 the Internet
Home NOC Operators' Group的 the InternetHome NOC Operators' Group的 the Internet
Home NOC Operators' Group的 the InternetTomoya Takezaki
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingKernel TLV
 
Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)
Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)
Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)NTT DATA Technology & Innovation
 
The concept of mini hardening
The concept of  mini hardeningThe concept of  mini hardening
The concept of mini hardeningMasahiro Tabata
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAPEDB
 
10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPFShuji Yamada
 
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)NTT DATA Technology & Innovation
 
Linux Instrumentation
Linux InstrumentationLinux Instrumentation
Linux InstrumentationDarkStarSword
 
フロー技術によるネットワーク管理
フロー技術によるネットワーク管理フロー技術によるネットワーク管理
フロー技術によるネットワーク管理Motonori Shindo
 
NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)NGINX, Inc.
 
LTO/オートローダー/仮想テープライブラリの基礎知識
LTO/オートローダー/仮想テープライブラリの基礎知識LTO/オートローダー/仮想テープライブラリの基礎知識
LTO/オートローダー/仮想テープライブラリの基礎知識MKT International Inc.
 
BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料Toshiki Tsuboi
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux KernelKernel TLV
 
PFSなTLS通信を復号する
PFSなTLS通信を復号するPFSなTLS通信を復号する
PFSなTLS通信を復号する稔 小林
 

La actualidad más candente (20)

LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
What is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.xWhat is new in Notes & Domino Deleopment V10.x
What is new in Notes & Domino Deleopment V10.x
 
BIRD Routing Daemon
BIRD Routing DaemonBIRD Routing Daemon
BIRD Routing Daemon
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
 
Home NOC Operators' Group的 the Internet
Home NOC Operators' Group的 the InternetHome NOC Operators' Group的 the Internet
Home NOC Operators' Group的 the Internet
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)
Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)
Apache Bigtop3.2 (仮)(Open Source Conference 2022 Online/Hiroshima 発表資料)
 
The concept of mini hardening
The concept of  mini hardeningThe concept of  mini hardening
The concept of mini hardening
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAP
 
10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF
 
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
 
Linux Instrumentation
Linux InstrumentationLinux Instrumentation
Linux Instrumentation
 
ACI DHCP Config Guide
ACI DHCP Config GuideACI DHCP Config Guide
ACI DHCP Config Guide
 
フロー技術によるネットワーク管理
フロー技術によるネットワーク管理フロー技術によるネットワーク管理
フロー技術によるネットワーク管理
 
NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)
 
LTO/オートローダー/仮想テープライブラリの基礎知識
LTO/オートローダー/仮想テープライブラリの基礎知識LTO/オートローダー/仮想テープライブラリの基礎知識
LTO/オートローダー/仮想テープライブラリの基礎知識
 
BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料BGP/MPLS-VPNのお勉強資料
BGP/MPLS-VPNのお勉強資料
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
PFSなTLS通信を復号する
PFSなTLS通信を復号するPFSなTLS通信を復号する
PFSなTLS通信を復号する
 

Destacado

RightScale News November 2013: Launch of Cloud Analytics
RightScale News November 2013: Launch of Cloud AnalyticsRightScale News November 2013: Launch of Cloud Analytics
RightScale News November 2013: Launch of Cloud AnalyticsRightScale
 
PCM_Cloud_Flyer
PCM_Cloud_FlyerPCM_Cloud_Flyer
PCM_Cloud_FlyerIgor Belic
 
RightScale Webinar: Considerations For Choosing Cloud Providers
RightScale Webinar:   Considerations For Choosing Cloud ProvidersRightScale Webinar:   Considerations For Choosing Cloud Providers
RightScale Webinar: Considerations For Choosing Cloud ProvidersRightScale
 
NetTask DE Reseller Models Introduction Cloud Services
NetTask DE Reseller Models Introduction Cloud ServicesNetTask DE Reseller Models Introduction Cloud Services
NetTask DE Reseller Models Introduction Cloud ServicesNetTask GmbH
 
Splunk corporate overview German 2012
Splunk corporate overview German 2012Splunk corporate overview German 2012
Splunk corporate overview German 2012jenny_splunk
 
WT16 - Cloud Services Portfolio
WT16 - Cloud Services Portfolio WT16 - Cloud Services Portfolio
WT16 - Cloud Services Portfolio Cloud_Services
 
SolarWinds Federal User Group 2016 - SolarWinds Cloud Products
SolarWinds Federal User Group 2016 - SolarWinds Cloud ProductsSolarWinds Federal User Group 2016 - SolarWinds Cloud Products
SolarWinds Federal User Group 2016 - SolarWinds Cloud ProductsSolarWinds
 
Cisco Meraki Portfolio Guide
Cisco Meraki Portfolio GuideCisco Meraki Portfolio Guide
Cisco Meraki Portfolio GuideMaticmind
 
How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014James Chittenden
 
Rackspace Hosting Presentation
Rackspace Hosting  PresentationRackspace Hosting  Presentation
Rackspace Hosting Presentationogarza
 
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data AnalyticsAmazon Web Services
 
Splunk Webinar: Splunk for Microsoft Exchange
Splunk Webinar: Splunk for Microsoft ExchangeSplunk Webinar: Splunk for Microsoft Exchange
Splunk Webinar: Splunk for Microsoft ExchangeGeorg Knon
 
Erweitern sie ihr Data Center mit Cloud Services
Erweitern sie ihr Data Center mit Cloud ServicesErweitern sie ihr Data Center mit Cloud Services
Erweitern sie ihr Data Center mit Cloud ServicesAWS Germany
 
Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework? Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework? Michael Plöd
 
Microsoft Azure in der Unternehmenspraxis
Microsoft Azure in der UnternehmenspraxisMicrosoft Azure in der Unternehmenspraxis
Microsoft Azure in der UnternehmenspraxisPOINT. Consulting GmbH
 

Destacado (19)

Google’s cloud strategy
Google’s cloud strategyGoogle’s cloud strategy
Google’s cloud strategy
 
RightScale News November 2013: Launch of Cloud Analytics
RightScale News November 2013: Launch of Cloud AnalyticsRightScale News November 2013: Launch of Cloud Analytics
RightScale News November 2013: Launch of Cloud Analytics
 
PCM_Cloud_Flyer
PCM_Cloud_FlyerPCM_Cloud_Flyer
PCM_Cloud_Flyer
 
RightScale Webinar: Considerations For Choosing Cloud Providers
RightScale Webinar:   Considerations For Choosing Cloud ProvidersRightScale Webinar:   Considerations For Choosing Cloud Providers
RightScale Webinar: Considerations For Choosing Cloud Providers
 
NetTask DE Reseller Models Introduction Cloud Services
NetTask DE Reseller Models Introduction Cloud ServicesNetTask DE Reseller Models Introduction Cloud Services
NetTask DE Reseller Models Introduction Cloud Services
 
Splunk corporate overview German 2012
Splunk corporate overview German 2012Splunk corporate overview German 2012
Splunk corporate overview German 2012
 
WT16 - Cloud Services Portfolio
WT16 - Cloud Services Portfolio WT16 - Cloud Services Portfolio
WT16 - Cloud Services Portfolio
 
SolarWinds Federal User Group 2016 - SolarWinds Cloud Products
SolarWinds Federal User Group 2016 - SolarWinds Cloud ProductsSolarWinds Federal User Group 2016 - SolarWinds Cloud Products
SolarWinds Federal User Group 2016 - SolarWinds Cloud Products
 
Cisco Meraki Portfolio Guide
Cisco Meraki Portfolio GuideCisco Meraki Portfolio Guide
Cisco Meraki Portfolio Guide
 
How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014
 
IBM Security SaaS IaaS and PaaS
IBM Security SaaS IaaS and PaaSIBM Security SaaS IaaS and PaaS
IBM Security SaaS IaaS and PaaS
 
Rackspace Hosting Presentation
Rackspace Hosting  PresentationRackspace Hosting  Presentation
Rackspace Hosting Presentation
 
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
(BDT209) Launch: Amazon Elasticsearch For Real-Time Data Analytics
 
Splunk Webinar: Splunk for Microsoft Exchange
Splunk Webinar: Splunk for Microsoft ExchangeSplunk Webinar: Splunk for Microsoft Exchange
Splunk Webinar: Splunk for Microsoft Exchange
 
Erweitern sie ihr Data Center mit Cloud Services
Erweitern sie ihr Data Center mit Cloud ServicesErweitern sie ihr Data Center mit Cloud Services
Erweitern sie ihr Data Center mit Cloud Services
 
Vodafone Cloud & Hosting Services
Vodafone Cloud & Hosting Services Vodafone Cloud & Hosting Services
Vodafone Cloud & Hosting Services
 
Vodafone Cloud & Hosting Services
Vodafone Cloud & Hosting ServicesVodafone Cloud & Hosting Services
Vodafone Cloud & Hosting Services
 
Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework? Warum empfehle ich meinen Kunden das Spring Framework?
Warum empfehle ich meinen Kunden das Spring Framework?
 
Microsoft Azure in der Unternehmenspraxis
Microsoft Azure in der UnternehmenspraxisMicrosoft Azure in der Unternehmenspraxis
Microsoft Azure in der Unternehmenspraxis
 

Similar a Scaling your logging infrastructure using syslog-ng

Get the most out of your security logs using syslog-ng
Get the most out of your security logs using syslog-ngGet the most out of your security logs using syslog-ng
Get the most out of your security logs using syslog-ngPeter Czanik
 
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
SCaLE 2016 - syslog-ng: From Raw Data to Big DataSCaLE 2016 - syslog-ng: From Raw Data to Big Data
SCaLE 2016 - syslog-ng: From Raw Data to Big DataBalaBit
 
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...BalaBit
 
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...BalaBit
 
syslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extractionsyslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extractionBalaBit
 
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.Airat Khisamov
 
PostgresOpen 2013 A Comparison of PostgreSQL Encryption Options
PostgresOpen 2013 A Comparison of PostgreSQL Encryption OptionsPostgresOpen 2013 A Comparison of PostgreSQL Encryption Options
PostgresOpen 2013 A Comparison of PostgreSQL Encryption OptionsFaisal Akber
 
Syslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress GuideSyslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress GuideAbhishek Kumar
 
Developing Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaJoe Stein
 
Hunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentationHunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentationOlehLevytskyi1
 
Fedora Developer's Conference 2014 Talk
Fedora Developer's Conference 2014 TalkFedora Developer's Conference 2014 Talk
Fedora Developer's Conference 2014 TalkRainer Gerhards
 
Advanced Log Processing
Advanced Log ProcessingAdvanced Log Processing
Advanced Log ProcessingAnton Chuvakin
 
Elk presentation 2#3
Elk presentation 2#3Elk presentation 2#3
Elk presentation 2#3uzzal basak
 
WarsawITDays_ ApacheNiFi202
WarsawITDays_ ApacheNiFi202WarsawITDays_ ApacheNiFi202
WarsawITDays_ ApacheNiFi202Timothy Spann
 
CODEONTHEBEACH_Streaming Applications with Apache Pulsar
CODEONTHEBEACH_Streaming Applications with Apache PulsarCODEONTHEBEACH_Streaming Applications with Apache Pulsar
CODEONTHEBEACH_Streaming Applications with Apache PulsarTimothy Spann
 

Similar a Scaling your logging infrastructure using syslog-ng (20)

Get the most out of your security logs using syslog-ng
Get the most out of your security logs using syslog-ngGet the most out of your security logs using syslog-ng
Get the most out of your security logs using syslog-ng
 
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
SCaLE 2016 - syslog-ng: From Raw Data to Big DataSCaLE 2016 - syslog-ng: From Raw Data to Big Data
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
 
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
 
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
 
syslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extractionsyslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extraction
 
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
 
GrayLog for Java developers FOSDEM 2018
GrayLog for Java developers FOSDEM 2018GrayLog for Java developers FOSDEM 2018
GrayLog for Java developers FOSDEM 2018
 
PostgresOpen 2013 A Comparison of PostgreSQL Encryption Options
PostgresOpen 2013 A Comparison of PostgreSQL Encryption OptionsPostgresOpen 2013 A Comparison of PostgreSQL Encryption Options
PostgresOpen 2013 A Comparison of PostgreSQL Encryption Options
 
Syslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress GuideSyslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress Guide
 
Developing Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache Kafka
 
Kamailio - Secure Communication
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure Communication
 
Hunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentationHunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentation
 
Ravi kumar
Ravi kumarRavi kumar
Ravi kumar
 
Fedora Developer's Conference 2014 Talk
Fedora Developer's Conference 2014 TalkFedora Developer's Conference 2014 Talk
Fedora Developer's Conference 2014 Talk
 
D4 Project Presentation
D4 Project PresentationD4 Project Presentation
D4 Project Presentation
 
Advanced Log Processing
Advanced Log ProcessingAdvanced Log Processing
Advanced Log Processing
 
Elk presentation 2#3
Elk presentation 2#3Elk presentation 2#3
Elk presentation 2#3
 
WarsawITDays_ ApacheNiFi202
WarsawITDays_ ApacheNiFi202WarsawITDays_ ApacheNiFi202
WarsawITDays_ ApacheNiFi202
 
Secure network
Secure networkSecure network
Secure network
 
CODEONTHEBEACH_Streaming Applications with Apache Pulsar
CODEONTHEBEACH_Streaming Applications with Apache PulsarCODEONTHEBEACH_Streaming Applications with Apache Pulsar
CODEONTHEBEACH_Streaming Applications with Apache Pulsar
 

Último

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Último (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

Scaling your logging infrastructure using syslog-ng

  • 1. SCALING YOUR LOGGING INFRASTRUCTURE WITH SYSLOG-NG All Things Open 2016 Peter Czanik / Balabit
  • 2. 2 ABOUT ME  Peter Czanik from Hungary  Community Manager at Balabit: syslog-ng upstream  syslog-ng packaging, support, advocacy Balabit is an IT security company with development HQ in Budapest, Hungary Over 200 employees: the majority are engineers
  • 3. 3 syslog-ng Logging Recording events, such as: Jan 14 11:38:48 linux-0jbu sshd[7716]: Accepted publickey for root from 127.0.0.1 port 48806 ssh2 syslog-ng Enhanced logging daemon with a focus on high-performance central log collection.
  • 4. 4 WHY CENTRAL LOGGING? EASE OF USE one place to check instead of many AVAILABILITY even if the sender machine is down SECURITY logs are available even if sender machine is compromised
  • 5. 5 MAIN SYSLOG-NG ROLES collector processor filter storage (or forwarder)
  • 6. 6 ROLE: DATA COLLECTOR Collect system and application logs together: contextual data for either side A wide variety of platform-specific sources:  /dev/log & co  Journal, Sun streams Receive syslog messages over the network:  Legacy or RFC5424, UDP/TCP/TLS Logs or any kind of data from applications:  Through files, sockets, pipes, etc.  Application output
  • 7. 7 ROLE: PROCESSING Classify, normalize and structure logs with built-in parsers:  CSV-parser, DB-parser (PatternDB), JSON parser, key=value parser and more to come Rewrite messages:  For example anonymization Reformatting messages using templates:  Destination might need a specific format (ISO date, JSON, etc.) Enrich data:  GeoIP  Additional fields based on message content
  • 8. 8 ROLE: DATA FILTERING Main uses:  Discarding surplus logs (not storing debug level messages)  Message routing (login events to SIEM) Many possibilities:  Based on message content, parameters or macros  Using comparisons, wildcards, regular expressions and functions  Combining all of these with Boolean operators
  • 9. 9 ROLE: DESTINATIONS “TRADITIONAL” ● File, network, TLS, SQL, etc. “BIG DATA” ● Distributed file systems: ● Hadoop ● NoSQL databases: ● MongoDB ● Elasticsearch ● Messaging systems: ● Kafka
  • 10. 10 WHICH SYSLOG-NG VERSION IS THE FASTEST?  Project started in 1998  Version 3.3 added multi-threading in 2011  Latest stable version is 3.8, released two months ago
  • 11. 11 Kindle e-book reader on a plane :) Version 1.6 BMW i3 all electric car Version 3.4
  • 12. 12 FREE-FORM LOG MESSAGES Most log messages are: date + hostname + text Mar 11 13:37:56 linux-6965 sshd[4547]: Accepted keyboard-interactive/pam for root from 127.0.0.1 port 46048 ssh2  Text = English sentence with some variable parts  Easy to read by a human  Difficult to process them with scripts
  • 13. 13 SOLUTION: STRUCTURED LOGGING  Events represented as name-value pairs  Example: an ssh login: app=sshd user=root source_ip=192.168.123.45  syslog-ng: name-value pairs inside  Date, facility, priority, program name, pid, etc.  Parsers in syslog-ng can turn unstructured and some structured data (CSV, JSON) into name-value pairs
  • 14. 14 JSON PARSER Turns JSON-based log messages into name-value pairs {"PROGRAM":"prg00000","PRIORITY":"info","PID":"1234","MESSAGE":"seq: 0000000000, thread: 0000, runid: 1374490607, stamp: 2013-07-22T12:56:47 MESSAGE... ","HOST":"localhost","FACILITY":"auth","DATE":"Jul 22 12:56:47"}
  • 15. 15 CSV PARSER Parses columnar data into fields parser p_apache { csv-parser(columns("APACHE.CLIENT_IP", "APACHE.IDENT_NAME", "APACHE.USER_NAME", "APACHE.TIMESTAMP", "APACHE.REQUEST_URL", "APACHE.REQUEST_STATUS", "APACHE.CONTENT_LENGTH", "APACHE.REFERER", "APACHE.USER_AGENT", "APACHE.PROCESS_TIME", "APACHE.SERVER_NAME") flags(escape-double-char,strip-whitespace) delimiters(" ") quote-pairs('""[]') ); }; destination d_file { file("/var/log/messages-${APACHE.USER_NAME:-nouser}"); }; log { source(s_local); parser(p_apache); destination(d_file);};
  • 16. 16 KEY=VALUE PARSER Finds key=value pairs in messages Introduced in version 3.7. Typical in firewalls, like: 2016-03-04T07:10:19-05:00 127.0.0.1 zorp/http[3486]: core.summary(4): (svc/http#0/http/intraPLUGinter:267346): Connection summary; rule_id='51', session_start='1451980783', session_end='1451980784', client_proto='TCP', client_address='172.168.65.4', client_port='56084', client_zone='office', server_proto='TCP', server_address='173.252.120.68', server_port='443', server_zone='internet', client_local='173.252.120.68', client_local_port='443', server_local='91.120.23.97', server_local_port='46472', verdict='ACCEPTED', info=''
  • 17. 17 PATTERNDB PARSER PatternDB message parser Can extract useful information from unstructured messages into name-value pairs  Add status fields based on message text  Message classification (like LogCheck) Needs XML describing log messages Example: an ssh login failure:  Parsed: app=sshd, user=root, source_ip=192.168.123.45  Added: action=login, status=failure  Classified as “violation”
  • 18. 18 PARSERS WRITTEN IN RUST Rust parsers  Rust: https://www.rust-lang.org/  Supported from 3.8 Example modules in separate repository: https://github.com/balabit/syslog-ng-rust-modules/  Regexp parser  Actiondb parser (similar to, but easier to use than patterndb)  Correlation parser
  • 19. 19 ANONYMIZING MESSAGES Many regulations about what can be logged  PCI-DSS: credit card numbers  Europe: IP addresses, user names Locating sensitive information:  Regular expression: slow, works also in unknown logs  Patterndb: fast, works only in known log messages Anonymizing:  Overwrite it with a constant  Overwrite it with a hash of the original
  • 20. 20 CONFIGURATION  “Don't Panic”  Simple and logical, even if it looks difficult at first  Pipeline model:  Many different building blocks (sources, destinations, filters, parsers, etc.)  Connected into a pipeline using “log” statements
  • 21. 21 syslog-ng.conf: global options @version:3.7 @include "scl.conf" # this is a comment :) options { flush_lines (0); # [...] keep_hostname (yes); };
  • 22. 22 syslog-ng.conf: sources source s_sys { system(); internal(); }; source s_net { udp(ip(0.0.0.0) port(514)); };
  • 23. 23 syslog-ng.conf: destinations destination d_mesg { file("/var/log/messages"); }; destination d_es { elasticsearch( index("syslog-ng_${YEAR}.${MONTH}.${DAY}") type("test") cluster("syslog-ng") template("$(format-json --scope rfc3164 --scope nv-pairs --exclude R_DATE --key ISODATE)n"); ); };
  • 24. 24 syslog-ng.conf: filters, parsers filter f_nodebug { level(info..emerg); }; filter f_messages { level(info..emerg) and not (facility(mail) or facility(authpriv) or facility(cron)); }; parser pattern_db { db-parser(file("/opt/syslog-ng/etc/patterndb.xml") ); };
  • 25. 25 syslog-ng.conf: logpath log { source(s_sys); filter(f_messages); destination(d_mesg); }; log { source(s_net); source(s_sys); filter(f_nodebug); parser(pattern_db); destination(d_es); flags(flow-control); };
  • 27. 27 SCALING SYSLOG-NG  Client – Relay – Server instead of Client – Server  Distribute some of the processing to Client/Relay
  • 28. 28 LOG ROUTING  Based on filtering  Send the right logs to the right places  Message parsing can increase accuracy  E-mail on root logins  Can optimize SIEM / log analyzer tools  Only relevant messages: cheaper licensing  Throttling: evening out peaks
  • 29. 29 WHAT IS NEW IN SYSLOG-NG 3.8  Disk-based buffering  Grouping-by(): correlation independent of patterndb  Parsers written in Rust  Elasticsearch 2.x support  Curl (HTTP) destination  Performance improvements  Many more :-)
  • 30. 30 SYSLOG-NG BENEFITS FOR LARGE ENVIRONMENTS High-performance reliable log collection Simplified architecture Single application for both syslog and application data Easier-to-use data Parsed and presented in a ready-to-use format Lower load on destinations Efficient message filtering and routing
  • 31. 31 JOINING THE COMMUNITY  syslog-ng: http://syslog-ng.org/  Source on GitHub: https://github.com/balabit/syslog-ng  Mailing list: https://lists.balabit.hu/pipermail/syslog-ng/  IRC: #syslog-ng on freenode
  • 32. 32 QUESTIONS? My blog: http://czanik.blogs.balabit.com/ My e-mail: peter.czanik@balabit.com Twitter: https://twitter.com/PCzanik
  • 33. 33 SAMPLE XML ● <?xml version='1.0' encoding='UTF-8'?> ● <patterndb version='3' pub_date='2010-07-13'> ● <ruleset name='opensshd' id='2448293e-6d1c-412c-a418-a80025639511'> ● <pattern>sshd</pattern> ● <rules> ● <rule provider="patterndb" id="4dd5a329-da83-4876-a431-ddcb59c2858c" class="system"> ● <patterns> ● <pattern>Accepted @ESTRING:usracct.authmethod: @for @ESTRING:usracct.username: @from @ESTRING:usracct.device: @port @ESTRING:: @@ANYSTRING:usracct.service@</pattern> ● </patterns> ● <examples> ● <example> ● <test_message program="sshd">Accepted password for bazsi from 127.0.0.1 port 48650 ssh2</test_message> ● <test_values> ● <test_value name="usracct.username">bazsi</test_value> ● <test_value name="usracct.authmethod">password</test_value> ● <test_value name="usracct.device">127.0.0.1</test_value> ● <test_value name="usracct.service">ssh2</test_value> ● </test_values> ● </example> ● </examples> ● <values> ● <value name="usracct.type">login</value> ● <value name="usracct.sessionid">$PID</value> ● <value name="usracct.application">$PROGRAM</value> ● <value name="secevt.verdict">ACCEPT</value> ● </values> ● </rule>