SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
take care of your logs
Jan Doberstein
( @jalogisch )
17+ Jahre IT Administrator
Support Engineer bei Graylog
( @graylog2 )
Was
sind
Logs?
– Wikipedia
„Eine Logdatei enthält das automatisch
geführte Protokoll aller oder bestimmter
Aktionen von Prozessen auf einem
Computersystem.“
– Wikipedia
„ Außer dem Betriebssystem selbst schreiben
meist Hintergrundprogramme (z. B. ein E-Mail-
Server, ein Proxyserver und anderes) in
Logdateien, um Aktionsmeldungen,
Fehlermeldungen und Hinweise persistent
(dauernd) oder temporär verfügbar zu halten.
Ähnliches gilt für Installationsprogramme,
Firewalls, Virenscanner und dergleichen. “
Logs geben die Möglichkeit
Dinge zu einem späteren
Zeitpunkt nachzuvollziehen
Warum sollte ich vergänglichen
und unnützen Daten
Aufmerksamkeit schenken?
https://twitter.com/janl/status/785456374566223872
Was sind Logs?
Aug 16 18:18:19 d8.jalogis.ch sshd[26944]: fatal: Unable
to negotiate a key exchange method [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse
mapping checking getaddrinfo for hn.kd.ny.adsl
[222.138.139.252] failed - POSSIBLE BREAK-IN ATTEMPT!
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user
admin from 222.138.139.252
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]:
input_userauth_request: invalid user admin [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection
closed by 222.138.139.252 [preauth]
Aug 16 18:19:16 d8.jalogis.ch sshd[26948]: fatal: Unable
to negotiate a key exchange method [preauth]
ohne Logs ist schlecht.
lokales
Sammeln
Linux ( syslog / journald )
Windows ( Eventlog )
lokales Sammeln
root@d8:/var/log# grep -v "fatal: Unable to negotiate a key exchange
method" auth.log | grep -v „pam_unix(cron:session)“
Aug 16 18:12:18 d8.jalogis.ch sshd[26930]: Connection closed by
45.114.50.54 [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse mapping checking
getaddrinfo for hn.kd.ny.adsl [222.138.139.252] failed - POSSIBLE BREAK-
IN ATTEMPT!
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user admin from
222.138.139.252
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: input_userauth_request:
invalid user admin [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection closed by
222.138.139.252 [preauth]
lokales Sammeln
root@d8:~# grep -v 'pam_uni(cron:session)' /var/
log/auth.log | grep 'fatal: Unable to negotiate a key
exchange method' | wc -l
3082
http://xkcd.com/208/
lokales Sammeln
• Ist der Host nicht erreichbar, gibt es kein Log
• Lokale Logs erlauben es nicht, globale
Ereignisse zu verfolg en
• Kompromittierte Systeme sind manipuliert
(simples) zentrales Sammeln
OS Grundausstattung
geringer Aufwand
Syslog
(simples) zentrales Sammeln
http://xkcd.com/208/
Datenbank & Interface
Elasticsearch ist eine dokumentbasierte Datenbank
die auf Apache Lucene aufsetzt und eine
vollständige REST API bietet.
> host:d8.jalogis.ch AND programname:sshd AND message:"*invalid user*"
• Anreicherung
• Filterung
• Normalisierung
zentrales Sammeln & Anreichern
Aug 16 18:18:19 d8.jalogis.ch sshd[26944]: fatal: Unable
to negotiate a key exchange method [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse
mapping checking getaddrinfo for hn.kd.ny.adsl
[222.138.139.252] failed - POSSIBLE BREAK-IN ATTEMPT!
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user
admin from 222.138.139.252
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]:
input_userauth_request: invalid user admin [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection
closed by 222.138.139.252 [preauth]
Aug 16 18:19:16 d8.jalogis.ch sshd[26948]: fatal: Unable
to negotiate a key exchange method [preauth]
(?<timestamp>b(?:[Jj]an(?:uary|uar)?|[Ff]eb(?:ruary|ruar)?|[Mm](?:a|ä)?r(?:ch|z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0-9A-Fa-f]{1,4}:){1}(((:
[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|
2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|
2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?|(?<![0-9])(?:(?:[0-1]?
[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4]
[0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]))(?![0-9]))|b(?:[0-9A-Za-z][0-9A-Za-z-]
{0,62})(?:.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(.?|b))) (?<program>[x21-x5ax5cx5e-x7e]
+)(?:[(?<pid>b(?:[1-9][0-9]*)b)])?: (?<message>.*)
%{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?
%{SYSLOGHOST:logsource} %{SYSLOGPROG}: %
{GREEDYDATA:message}
Aug 16 18:18:19 d8.jalogis.ch sshd[26944]: fatal: Unable
to negotiate a key exchange method [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse
mapping checking getaddrinfo for hn.kd.ny.adsl
[222.138.139.252] failed - POSSIBLE BREAK-IN ATTEMPT!
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user
admin from 222.138.139.252
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]:
input_userauth_request: invalid user admin [preauth]
Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection
closed by 222.138.139.252 [preauth]
Aug 16 18:19:16 d8.jalogis.ch sshd[26948]: fatal: Unable
to negotiate a key exchange method [preauth]
Datenbank & Interface
Syslog
Syslog
AppHardware
App GELF / JSON
Logfile Shipper
App RAWHardware
Syslog
Komplexes Sammeln
• andere Transportwege und Protokolle
• Warteschlangen (queue)
• Paralleles bearbeiten
Komplexes Sammeln
• andere Transportwege und Protokolle
• Warteschlangen (queue)
• Paralleles bearbeiten
Komplexes Sammeln
• andere Transportwege und Protokolle
• Warteschlangen (queue)
• Paralleles bearbeiten
Einheitliche Betrachtung
• verminderte
Zugriffsrechte auf
Server
• schneller und
einfacher Zugriff
auf Informationen
• einfache
Administration
Fragen?
@jalogisch
@graylog2
http://graylog.org
Font: Roboto | Image Credits:
1-2: Leo Gonzales https://www.flickr.com/photos/leoglenn_g/
3: Micolo J https://www.flickr.com/photos/robin1966/
4,5: Christoper https://www.flickr.com/photos/exalthim/
6-11: MrTinDC https://www.flickr.com/photos/mr_t_in_dc/
13: Mike Baker https://www.flickr.com/photos/36593372@N04/
12-17: Jon Anderson https://www.flickr.com/photos/adstream/
18-24: J Drew https://www.flickr.com/photos/brewbooks/
25-35, 45: Steven Isaacson https://www.flickr.com/photos/spi/
36-40: Dennis Jarvis https://www.flickr.com/photos/archer10/
41: Wiscon Department https://www.flickr.com/photos/widnr/
42: Budi Nusyirwan https://www.flickr.com/photos/bukrie/
43,44: Dana https://www.flickr.com/photos/roseannadana/
46,47: Jan Doberstein

Weitere ähnliche Inhalte

Andere mochten auch

OSMC 2016 - Monitoring the real world by Antony Stone
OSMC 2016 - Monitoring the real world by Antony Stone OSMC 2016 - Monitoring the real world by Antony Stone
OSMC 2016 - Monitoring the real world by Antony Stone NETWAYS
 
OSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-Shalom
OSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-ShalomOSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-Shalom
OSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-ShalomNETWAYS
 
OSMC 2016 - Friends and foes by Heinrich Hartmann
OSMC 2016 - Friends and foes by Heinrich HartmannOSMC 2016 - Friends and foes by Heinrich Hartmann
OSMC 2016 - Friends and foes by Heinrich HartmannNETWAYS
 
OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...
OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...
OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...NETWAYS
 
OSMC 2016 - Current State of Icinga by Icinga Team
OSMC 2016 - Current State of Icinga by Icinga Team OSMC 2016 - Current State of Icinga by Icinga Team
OSMC 2016 - Current State of Icinga by Icinga Team NETWAYS
 
OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...
OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...
OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...NETWAYS
 
OSMC 2016 - Application Performance Management with Open-Source-Tooling by M...
OSMC 2016 -  Application Performance Management with Open-Source-Tooling by M...OSMC 2016 -  Application Performance Management with Open-Source-Tooling by M...
OSMC 2016 - Application Performance Management with Open-Source-Tooling by M...NETWAYS
 
OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer
OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer   OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer
OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer NETWAYS
 
OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer
OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer
OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer NETWAYS
 
OSMC 2016 - Small things for monitoring by Jan-Piet Mens
OSMC 2016 - Small things for monitoring by Jan-Piet MensOSMC 2016 - Small things for monitoring by Jan-Piet Mens
OSMC 2016 - Small things for monitoring by Jan-Piet MensNETWAYS
 
OSMC 2016 - Alerting with Time Series by Fabian Reinartz
OSMC 2016 - Alerting with Time Series by Fabian ReinartzOSMC 2016 - Alerting with Time Series by Fabian Reinartz
OSMC 2016 - Alerting with Time Series by Fabian ReinartzNETWAYS
 
OSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland Hochmuth
OSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland HochmuthOSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland Hochmuth
OSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland HochmuthNETWAYS
 
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringOSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringNETWAYS
 
OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin
OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin
OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin NETWAYS
 
OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...
OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...
OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...NETWAYS
 
OSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas Gelf
OSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas GelfOSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas Gelf
OSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas GelfNETWAYS
 
OSMC 2016 - NeDi update and more by Remo Rickli
OSMC 2016 - NeDi update and more by Remo RickliOSMC 2016 - NeDi update and more by Remo Rickli
OSMC 2016 - NeDi update and more by Remo RickliNETWAYS
 
OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...
OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...
OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...NETWAYS
 
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan WagnerOSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan WagnerNETWAYS
 
Modernes System-Management — Alles ist ein Stream
Modernes System-Management — Alles ist ein StreamModernes System-Management — Alles ist ein Stream
Modernes System-Management — Alles ist ein StreamSysDB Project
 

Andere mochten auch (20)

OSMC 2016 - Monitoring the real world by Antony Stone
OSMC 2016 - Monitoring the real world by Antony Stone OSMC 2016 - Monitoring the real world by Antony Stone
OSMC 2016 - Monitoring the real world by Antony Stone
 
OSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-Shalom
OSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-ShalomOSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-Shalom
OSMC 2016 - The Engineer's guide to Data Analysis by Avishai Ish-Shalom
 
OSMC 2016 - Friends and foes by Heinrich Hartmann
OSMC 2016 - Friends and foes by Heinrich HartmannOSMC 2016 - Friends and foes by Heinrich Hartmann
OSMC 2016 - Friends and foes by Heinrich Hartmann
 
OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...
OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...
OSMC 2016: You like Nagios - You will love Centreon by Laurent Pinsivy & Maxi...
 
OSMC 2016 - Current State of Icinga by Icinga Team
OSMC 2016 - Current State of Icinga by Icinga Team OSMC 2016 - Current State of Icinga by Icinga Team
OSMC 2016 - Current State of Icinga by Icinga Team
 
OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...
OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...
OSMC 2016 - Komponenten Monitoring und Performance Management mit Icinga bei ...
 
OSMC 2016 - Application Performance Management with Open-Source-Tooling by M...
OSMC 2016 -  Application Performance Management with Open-Source-Tooling by M...OSMC 2016 -  Application Performance Management with Open-Source-Tooling by M...
OSMC 2016 - Application Performance Management with Open-Source-Tooling by M...
 
OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer
OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer   OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer
OSMC 2016: Open Monitoring Distribution 2016+ by Gerhard Laußer
 
OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer
OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer
OSMC 2016 - DNS Monitoring from Several Vantage Points by Stéphane Bortzmeyer
 
OSMC 2016 - Small things for monitoring by Jan-Piet Mens
OSMC 2016 - Small things for monitoring by Jan-Piet MensOSMC 2016 - Small things for monitoring by Jan-Piet Mens
OSMC 2016 - Small things for monitoring by Jan-Piet Mens
 
OSMC 2016 - Alerting with Time Series by Fabian Reinartz
OSMC 2016 - Alerting with Time Series by Fabian ReinartzOSMC 2016 - Alerting with Time Series by Fabian Reinartz
OSMC 2016 - Alerting with Time Series by Fabian Reinartz
 
OSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland Hochmuth
OSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland HochmuthOSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland Hochmuth
OSMC 2016 - Monasca - Monitoring-as-a-Service (at-Scale) by Roland Hochmuth
 
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware MonitoringOSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
OSMC 2016 - Hello Redfish, Goodbye IPMI - The future of Hardware Monitoring
 
OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin
OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin
OSMC 2016 - Automated Monitoring with Icinga and NSClient++ by Michael Medin
 
OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...
OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...
OSMC 2016 - Soma - A Monitoring Configuration Management Database by Jörg Per...
 
OSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas Gelf
OSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas GelfOSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas Gelf
OSMC 2016 - Ein Jahr mit dem Icinga Director by Thomas Gelf
 
OSMC 2016 - NeDi update and more by Remo Rickli
OSMC 2016 - NeDi update and more by Remo RickliOSMC 2016 - NeDi update and more by Remo Rickli
OSMC 2016 - NeDi update and more by Remo Rickli
 
OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...
OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...
OSMC 2016: Security and Compliance Automation and Reports with Foreman by Shl...
 
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan WagnerOSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
OSMC 2016: Software Development seen from a #yolo^wdevop by Jan Wagner
 
Modernes System-Management — Alles ist ein Stream
Modernes System-Management — Alles ist ein StreamModernes System-Management — Alles ist ein Stream
Modernes System-Management — Alles ist ein Stream
 

Ähnlich wie OSMC 2016 - Take care of your logs by Jan Doberstein

OSDC 2013 | The truth is in the logs by Jan Doberstein
OSDC 2013 | The truth is in the logs by Jan DobersteinOSDC 2013 | The truth is in the logs by Jan Doberstein
OSDC 2013 | The truth is in the logs by Jan DobersteinNETWAYS
 
Zentrales Logging mit Elasticsearch
Zentrales Logging mit ElasticsearchZentrales Logging mit Elasticsearch
Zentrales Logging mit ElasticsearchSimonSchneider24
 
Rex - Infrastruktur als Code
Rex - Infrastruktur als CodeRex - Infrastruktur als Code
Rex - Infrastruktur als CodeJan Gehring
 
Stackstorm – Event driven Automation
Stackstorm – Event driven AutomationStackstorm – Event driven Automation
Stackstorm – Event driven Automationinovex GmbH
 
Domino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG Konferenz
Domino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG KonferenzDomino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG Konferenz
Domino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG Konferenzpanagenda
 
Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...
Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...
Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...NETWAYS
 
Workshop Logfile Analyse mit Splunk
Workshop Logfile Analyse mit SplunkWorkshop Logfile Analyse mit Splunk
Workshop Logfile Analyse mit SplunkHannes Richter
 
XML-Socket-Server zur Kommunikation mit Flash
XML-Socket-Server zur Kommunikation mit FlashXML-Socket-Server zur Kommunikation mit Flash
XML-Socket-Server zur Kommunikation mit FlashStephan Schmidt
 
Schnittstellen und Webservices
Schnittstellen und WebservicesSchnittstellen und Webservices
Schnittstellen und WebservicesJakob .
 
Django trifft Flutter
Django trifft FlutterDjango trifft Flutter
Django trifft Flutterroskakori
 
DOAG 2015 enterprise_securitymitlda_pundpki-pub
DOAG 2015 enterprise_securitymitlda_pundpki-pubDOAG 2015 enterprise_securitymitlda_pundpki-pub
DOAG 2015 enterprise_securitymitlda_pundpki-pubLoopback.ORG
 
Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...
Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...
Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...TRITUM
 
OSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin Grauel
OSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin GrauelOSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin Grauel
OSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin GrauelNETWAYS
 
Betriebsysteme: zwei wichtige Konzepte aus der Praxis
Betriebsysteme: zwei wichtige Konzepte aus der PraxisBetriebsysteme: zwei wichtige Konzepte aus der Praxis
Betriebsysteme: zwei wichtige Konzepte aus der PraxisBrigitte Jellinek
 
Schulung: Einführung in das GPU-Computing mit NVIDIA CUDA
Schulung: Einführung in das GPU-Computing mit NVIDIA CUDASchulung: Einführung in das GPU-Computing mit NVIDIA CUDA
Schulung: Einführung in das GPU-Computing mit NVIDIA CUDAJörn Dinkla
 
node.js - Eine kurze Einführung
node.js - Eine kurze Einführungnode.js - Eine kurze Einführung
node.js - Eine kurze Einführungnodeio
 
Why websecurity sucks
Why websecurity sucksWhy websecurity sucks
Why websecurity sucksThaDafinser
 

Ähnlich wie OSMC 2016 - Take care of your logs by Jan Doberstein (20)

OSDC 2013 | The truth is in the logs by Jan Doberstein
OSDC 2013 | The truth is in the logs by Jan DobersteinOSDC 2013 | The truth is in the logs by Jan Doberstein
OSDC 2013 | The truth is in the logs by Jan Doberstein
 
Zentrales Logging mit Elasticsearch
Zentrales Logging mit ElasticsearchZentrales Logging mit Elasticsearch
Zentrales Logging mit Elasticsearch
 
Node.js Security
Node.js SecurityNode.js Security
Node.js Security
 
Rex - Infrastruktur als Code
Rex - Infrastruktur als CodeRex - Infrastruktur als Code
Rex - Infrastruktur als Code
 
Stackstorm – Event driven Automation
Stackstorm – Event driven AutomationStackstorm – Event driven Automation
Stackstorm – Event driven Automation
 
Domino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG Konferenz
Domino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG KonferenzDomino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG Konferenz
Domino Statistiken verstehen und nutzen (Teil 1) - 41. DNUG Konferenz
 
Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...
Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...
Nagios Conference 2007 | Aufbau eines hochverfügbaren Nagios Clusters by Mart...
 
Workshop Logfile Analyse mit Splunk
Workshop Logfile Analyse mit SplunkWorkshop Logfile Analyse mit Splunk
Workshop Logfile Analyse mit Splunk
 
XML-Socket-Server zur Kommunikation mit Flash
XML-Socket-Server zur Kommunikation mit FlashXML-Socket-Server zur Kommunikation mit Flash
XML-Socket-Server zur Kommunikation mit Flash
 
Schnittstellen und Webservices
Schnittstellen und WebservicesSchnittstellen und Webservices
Schnittstellen und Webservices
 
Django trifft Flutter
Django trifft FlutterDjango trifft Flutter
Django trifft Flutter
 
DOAG 2015 enterprise_securitymitlda_pundpki-pub
DOAG 2015 enterprise_securitymitlda_pundpki-pubDOAG 2015 enterprise_securitymitlda_pundpki-pub
DOAG 2015 enterprise_securitymitlda_pundpki-pub
 
Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...
Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...
Das Ende der Logfiles - mit Elasticsearch, Logstash und Kibana zu übersichtli...
 
Windows Powershell
Windows PowershellWindows Powershell
Windows Powershell
 
OSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin Grauel
OSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin GrauelOSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin Grauel
OSMC 2010 | Logverarbeitung mit syslog-ng - Status und Zukunft by Martin Grauel
 
Betriebsysteme: zwei wichtige Konzepte aus der Praxis
Betriebsysteme: zwei wichtige Konzepte aus der PraxisBetriebsysteme: zwei wichtige Konzepte aus der Praxis
Betriebsysteme: zwei wichtige Konzepte aus der Praxis
 
Schulung: Einführung in das GPU-Computing mit NVIDIA CUDA
Schulung: Einführung in das GPU-Computing mit NVIDIA CUDASchulung: Einführung in das GPU-Computing mit NVIDIA CUDA
Schulung: Einführung in das GPU-Computing mit NVIDIA CUDA
 
node.js - Eine kurze Einführung
node.js - Eine kurze Einführungnode.js - Eine kurze Einführung
node.js - Eine kurze Einführung
 
Why websecurity sucks
Why websecurity sucksWhy websecurity sucks
Why websecurity sucks
 
XPages: Performance-Optimierung - Ulrich Krause (eknori) SNoUG 2013
XPages: Performance-Optimierung  - Ulrich Krause (eknori) SNoUG 2013XPages: Performance-Optimierung  - Ulrich Krause (eknori) SNoUG 2013
XPages: Performance-Optimierung - Ulrich Krause (eknori) SNoUG 2013
 

OSMC 2016 - Take care of your logs by Jan Doberstein

  • 1. take care of your logs
  • 2. Jan Doberstein ( @jalogisch ) 17+ Jahre IT Administrator Support Engineer bei Graylog ( @graylog2 )
  • 4. – Wikipedia „Eine Logdatei enthält das automatisch geführte Protokoll aller oder bestimmter Aktionen von Prozessen auf einem Computersystem.“
  • 5. – Wikipedia „ Außer dem Betriebssystem selbst schreiben meist Hintergrundprogramme (z. B. ein E-Mail- Server, ein Proxyserver und anderes) in Logdateien, um Aktionsmeldungen, Fehlermeldungen und Hinweise persistent (dauernd) oder temporär verfügbar zu halten. Ähnliches gilt für Installationsprogramme, Firewalls, Virenscanner und dergleichen. “
  • 6. Logs geben die Möglichkeit Dinge zu einem späteren Zeitpunkt nachzuvollziehen
  • 7. Warum sollte ich vergänglichen und unnützen Daten Aufmerksamkeit schenken?
  • 10. Aug 16 18:18:19 d8.jalogis.ch sshd[26944]: fatal: Unable to negotiate a key exchange method [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse mapping checking getaddrinfo for hn.kd.ny.adsl [222.138.139.252] failed - POSSIBLE BREAK-IN ATTEMPT! Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user admin from 222.138.139.252 Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: input_userauth_request: invalid user admin [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection closed by 222.138.139.252 [preauth] Aug 16 18:19:16 d8.jalogis.ch sshd[26948]: fatal: Unable to negotiate a key exchange method [preauth]
  • 11.
  • 12. ohne Logs ist schlecht.
  • 13. lokales Sammeln Linux ( syslog / journald ) Windows ( Eventlog )
  • 14. lokales Sammeln root@d8:/var/log# grep -v "fatal: Unable to negotiate a key exchange method" auth.log | grep -v „pam_unix(cron:session)“ Aug 16 18:12:18 d8.jalogis.ch sshd[26930]: Connection closed by 45.114.50.54 [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse mapping checking getaddrinfo for hn.kd.ny.adsl [222.138.139.252] failed - POSSIBLE BREAK- IN ATTEMPT! Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user admin from 222.138.139.252 Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: input_userauth_request: invalid user admin [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection closed by 222.138.139.252 [preauth]
  • 15. lokales Sammeln root@d8:~# grep -v 'pam_uni(cron:session)' /var/ log/auth.log | grep 'fatal: Unable to negotiate a key exchange method' | wc -l 3082
  • 17. lokales Sammeln • Ist der Host nicht erreichbar, gibt es kein Log • Lokale Logs erlauben es nicht, globale Ereignisse zu verfolg en • Kompromittierte Systeme sind manipuliert
  • 18. (simples) zentrales Sammeln OS Grundausstattung geringer Aufwand Syslog
  • 22. Elasticsearch ist eine dokumentbasierte Datenbank die auf Apache Lucene aufsetzt und eine vollständige REST API bietet.
  • 23. > host:d8.jalogis.ch AND programname:sshd AND message:"*invalid user*"
  • 24.
  • 26. zentrales Sammeln & Anreichern
  • 27. Aug 16 18:18:19 d8.jalogis.ch sshd[26944]: fatal: Unable to negotiate a key exchange method [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse mapping checking getaddrinfo for hn.kd.ny.adsl [222.138.139.252] failed - POSSIBLE BREAK-IN ATTEMPT! Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user admin from 222.138.139.252 Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: input_userauth_request: invalid user admin [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection closed by 222.138.139.252 [preauth] Aug 16 18:19:16 d8.jalogis.ch sshd[26948]: fatal: Unable to negotiate a key exchange method [preauth]
  • 28. (?<timestamp>b(?:[Jj]an(?:uary|uar)?|[Ff]eb(?:ruary|ruar)?|[Mm](?:a|ä)?r(?:ch|z)?| [Aa]pr(?:il)?|[Mm]a(?:y|i)?|[Jj]un(?:e|i)?|[Jj]ul(?:y)?|[Aa]ug(?:ust)?|[Ss]ep(?:tember)?|[Oo](?:c| k)?t(?:ober)?|[Nn]ov(?:ember)?|[Dd]e(?:c|z)(?:ember)?)b +(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])| [1-9]) (?!<[0-9])(?:2[0123]|[01]?[0-9]):(?:[0-5][0-9])(?::(?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?))(?![0-9])) (?:<(?<facility>b(?:[0-9]+)b).(?<priority>b(?:[0-9]+)b)> )?(?<logsource>(?:(?:((([0-9A-Fa-f] {1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{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9]|25[0-5]))(?![0-9]))|b(?:[0-9A-Za-z][0-9A-Za-z-] {0,62})(?:.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(.?|b))) (?<program>[x21-x5ax5cx5e-x7e] +)(?:[(?<pid>b(?:[1-9][0-9]*)b)])?: (?<message>.*)
  • 30. Aug 16 18:18:19 d8.jalogis.ch sshd[26944]: fatal: Unable to negotiate a key exchange method [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: reverse mapping checking getaddrinfo for hn.kd.ny.adsl [222.138.139.252] failed - POSSIBLE BREAK-IN ATTEMPT! Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Invalid user admin from 222.138.139.252 Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: input_userauth_request: invalid user admin [preauth] Aug 16 18:18:39 d8.jalogis.ch sshd[26946]: Connection closed by 222.138.139.252 [preauth] Aug 16 18:19:16 d8.jalogis.ch sshd[26948]: fatal: Unable to negotiate a key exchange method [preauth]
  • 31.
  • 32.
  • 33.
  • 35.
  • 38. App GELF / JSON Logfile Shipper
  • 40.
  • 41. Komplexes Sammeln • andere Transportwege und Protokolle • Warteschlangen (queue) • Paralleles bearbeiten
  • 42. Komplexes Sammeln • andere Transportwege und Protokolle • Warteschlangen (queue) • Paralleles bearbeiten
  • 43. Komplexes Sammeln • andere Transportwege und Protokolle • Warteschlangen (queue) • Paralleles bearbeiten
  • 44.
  • 45. Einheitliche Betrachtung • verminderte Zugriffsrechte auf Server • schneller und einfacher Zugriff auf Informationen • einfache Administration
  • 47. Font: Roboto | Image Credits: 1-2: Leo Gonzales https://www.flickr.com/photos/leoglenn_g/ 3: Micolo J https://www.flickr.com/photos/robin1966/ 4,5: Christoper https://www.flickr.com/photos/exalthim/ 6-11: MrTinDC https://www.flickr.com/photos/mr_t_in_dc/ 13: Mike Baker https://www.flickr.com/photos/36593372@N04/ 12-17: Jon Anderson https://www.flickr.com/photos/adstream/ 18-24: J Drew https://www.flickr.com/photos/brewbooks/ 25-35, 45: Steven Isaacson https://www.flickr.com/photos/spi/ 36-40: Dennis Jarvis https://www.flickr.com/photos/archer10/ 41: Wiscon Department https://www.flickr.com/photos/widnr/ 42: Budi Nusyirwan https://www.flickr.com/photos/bukrie/ 43,44: Dana https://www.flickr.com/photos/roseannadana/ 46,47: Jan Doberstein