SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
Introduction   BSD Syslog         IETF Protocols   Still Missing   Analysis




                            Syslog Protocols

                              Martin Schütte




                              22/29 May 2008
Introduction         BSD Syslog          IETF Protocols   Still Missing   Analysis




       Introduction
           Logging
           Syslog vs. Audit
       BSD Syslog
           Overview
           Format
           API
           Daemon
           IPC
       IETF Protocols
           Overview, RFC
           Internet Drafts
           Draft: syslog-sign
       Still Missing
           reliable TCP reconnect
           UI, API and local transport
       Analysis
           Classification
           real time monitoring
           Conclusion
Introduction       BSD Syslog       IETF Protocols    Still Missing    Analysis




                                 Logging

       Merriam-Webster Online Dictionary:

       log [1, noun]
       3 a: the record of the rate of a ship’s speed or of her daily
       progress; also: the full nautical record of a ship’s voyage
       b: the full record of a flight by an aircraft
       4: a record of performance, events, or day-to-day activities

       log [2, verb]
       2: to make a note or record of: enter details of or about
       in a log
Introduction        BSD Syslog        IETF Protocols   Still Missing   Analysis




                                 Using Log Data



           • Debugging
           • Statistics/Planning
           • Accountability for user actions
           • Detect ongoing attacks
           • Examine security incidents
Introduction    BSD Syslog        IETF Protocols      Still Missing     Analysis




                             Syslog vs. Audit

   Audit
                                          Syslog
     • mandantory
                                            • part of application
       (no action without log)
                                            • controlled by user
     • needs trusted system
                                            • optional and unreliable
     • low-level
       (usually in kernel)                  • gets semantic
                                               content/meaning
     • little semantic
       content/meaning                      • (often) human readable
                                               messages
     • large amount of data
Introduction              BSD Syslog               IETF Protocols               Still Missing                Analysis




                                 Levels of Abstraction
                                       Audit (10 out of 140 events)
       header ,68 ,10 , recvfrom (2) ,0 , Thu May 8 16:41:55 2008 , + 349 msec , 
         subject , -1 , root , wheel , root , wheel ,763 ,0 ,0 ,0.0.0.0 , return , 
         failure : Resource temporarily unavailable ,4294967295 , trailer ,68 ,
       header ,68 ,10 , connect (2) ,0 , Thu May 8 16:41:55 2008 , + 349 msec , 
         subject , mschuett , sshd , sshd , sshd , sshd ,80728 ,53083 ,56590 ,141.89.58.200 , return , 
         failure : No such file or directory ,4294967295 , trailer ,68 ,
       header ,68 ,10 , connect (2) ,0 , Thu May 8 16:41:55 2008 , + 349 msec , 
         subject , mschuett , sshd , sshd , sshd , sshd ,80728 ,53083 ,56590 ,141.89.58.200 , return , 
         failure : No such file or directory ,4294967295 , trailer ,68 ,
       header ,68 ,10 , sendto (2) ,0 , Thu May 8 16:41:55 2008 , + 351 msec , 
         subject , mschuett , sshd , sshd , sshd , sshd ,80728 ,53083 ,56590 ,141.89.58.200 , return , 
         failure : Bad file descriptor ,4294967295 , trailer ,68 ,
       header ,96 ,10 , OpenSSH login ,0 , Thu May 8 16:41:55 2008 , + 357 msec , 
         subject , -1 , -1 , -1 , -1 , -1 ,80727 ,80727 ,52400 ,141.89.58.200 , text , 
         invalid user name " user " , return , failure : No such process ,4294967295 , trailer ,96 ,
       header ,68 ,10 , auditon (2) - get audit state ,0 , Thu May 8 16:41:55 2008 , + 357 msec , 
         subject , mschuett , root , wheel , root , wheel ,80727 ,53083 ,56590 ,141.89.58.200 , return , 
         success ,0 , trailer ,68 ,
       header ,68 ,10 , sysctl (3) ,0 , Thu May 8 16:41:59 2008 , + 535 msec , 
         subject , -1 , root , wheel , root , wheel ,853 ,0 ,0 ,0.0.0.0 , return , 
         success ,0 , trailer ,68 ,
       header ,68 ,10 , sysctl (3) ,0 , Thu May 8 16:41:59 2008 , + 535 msec , 
         subject , -1 , root , wheel , root , wheel ,853 ,0 ,0 ,0.0.0.0 , return , 
         success ,0 , trailer ,68 ,
       header ,68 ,10 , pipe (2) ,0 , Thu May 8 16:41:59 2008 , + 589 msec , 
         subject , mschuett , root , wheel , root , wheel ,80729 ,53083 ,56590 ,141.89.58.200 , return , 
         success ,3 , trailer ,68 ,
Introduction          BSD Syslog           IETF Protocols         Still Missing     Analysis




                             Levels of Abstraction
                                           Syslog




       2008 -05 -08 T16 :41:53.00+02:00 fax sshd [80727]: 
         Invalid user user from 141.89.58.200
       2008 -05 -08 T16 :41:53.00+02:00 fax sshd [80727]: 
         Failed none for invalid user user from 141.89.58.200 port 52400 ssh2
       2008 -05 -08 T16 :41:54.00+02:00 fax sshd [80727]: 
         Failed password for invalid user user from 141.89.58.200 port 52400 ssh2
       2008 -05 -08 T16 :41:55.00+02:00 fax sshd [80727]: 
         Failed password for invalid user user from 141.89.58.200 port 52400 ssh2
       2008 -05 -08 T16 :41:55.00+02:00 fax sshd [80727]: 
         Failed password for invalid user user from 141.89.58.200 port 52400 ssh2
Introduction    BSD Syslog       IETF Protocols   Still Missing   Analysis




                       Levels of Abstraction
                             possible Summary




          3 fax sshd : auth error 
              user XY from 141.89.58.200
Introduction        BSD Syslog      IETF Protocols   Still Missing   Analysis




                                 BSD Syslog


           • introduced by Eric Allman for sendmail (∼ 1984)
           • primarily designed for programming/debugging
           • simple, uniform, easy to use and configure
           • de facto standard for logging on Unix

           • 2001: RFC 3164 describes common features
Introduction        BSD Syslog      IETF Protocols   Still Missing   Analysis




                                 BSD Syslog


           • introduced by Eric Allman for sendmail (∼ 1984)
           • primarily designed for programming/debugging
           • simple, uniform, easy to use and configure
           • de facto standard for logging on Unix

           • 2001: RFC 3164 describes common features

       Eric wrote syslogd so that all the logs could be brought to one
       place and cleanly thrown away at once.
Introduction      BSD Syslog      IETF Protocols   Still Missing   Analysis




                               BSD Syslog


       Combination of:
         • message format
         • API
         • daemon
         • protocol for IPC
Introduction         BSD Syslog         IETF Protocols       Still Missing      Analysis




                         Syslog Message Format

       <38>Mar 17 21:57:57 frodo sshd[701]: Connection from 211.74.5.81 port 5991
       <52>Mar 17 13:54:30 192.168.0.42 printer: paper out

        • Priority
                                                By convention:
        • Header
                                                  • Priority not written
            • Timestamp
                                                    to logfile
            • Hostname
                                                  • only printable ASCII
        • Message
            • Tag                                 • up to 1024 characters
            • Content
Introduction                    BSD Syslog                      IETF Protocols                  Still Missing         Analysis




                             Metadata: Facility & Severity
       Facility:                                                    Severity:
            0.     kernel messages                                       0. Emergency: system is unusable
            1.     user-level messages                                   1. Alert: action must be taken immediately
            2.     mail system
            3.     system daemons                                        2. Critical: critical conditions
            4.     security/authorization messages (auth)                3. Error: error conditions
            5.     messages generated internally by syslogd              4. Warning: warning conditions
            6.     line printer subsystem
            7.     network news subsystem                                5. Notice: normal but significant condition
            8.     UUCP subsystem                                        6. Informational: informational messages
            9.     clock daemon                                          7. Debug: debug-level messages
           10.     security/authorization messages (authpriv)
           11.     FTP daemon
           12.     NTP subsystem
           13.     log audit                                        Priority := 8 × Facility + Severity
           14.     log alert
           15.     cron daemon
           16.     local use 0 (local0)
           17.     local use 1 (local1)
           18.     local use 2 (local2)
           19.     local use 3 (local3)
           20.     local use 4 (local4)
           21.     local use 5 (local5)
           22.     local use 6 (local6)
           23.     local use 7 (local7)
Introduction           BSD Syslog         IETF Protocols       Still Missing   Analysis




                                           API

           • #include <syslog.h>
           • void openlog(const char *ident, 
                          int logopt, int facility);
               allocate resources and set options
           • int setlogmask(int maskpri);
               set mask to log only severe messages
           • void syslog(int priority, 
                          const char *message, ... );
               send one log message, arguments like printf()
           • void closelog(void);
               free resources
Introduction           BSD Syslog        IETF Protocols      Still Missing    Analysis




                                    Send Messages

           • in programs:
               # include < syslog .h >
               openlog ( " my_tool " , LOG_PID , 0);
               setlogmask ( LOG_UPTO ( LOG_INFO ));
               syslog ( LOG_LPR | LOG_ALERT , " printer on fire " );
               closelog ();

           • from shell:
               / usr / bin / logger -t my_tool -i -p lpr . alert 
                                               " printer on fire "

           • by pipe (e. g. in httpd.conf):
               ErrorLog "|/ usr / bin / logger -p local3 . info -t apache "
Introduction          BSD Syslog        IETF Protocols   Still Missing   Analysis




                                      syslogd

           • collects messages from kernel, applications, and network
           • filters by priority
           • writes to files, programs, terminals, or network (UDP)

           • newer implementations (like syslog-ng or rsyslog)
               with additional features, like:
                 • filter by host/program/regexp
                 • different message and timestamp formats
                 • TCP or SQL servers as destinations
Introduction          BSD Syslog          IETF Protocols          Still Missing      Analysis




                                    syslog.conf

       One rule on every line: Selector <Tab> Action

       Example:
       authpriv .*                                / var / log / secure

       *. info ; mail . none ; authpriv . none    -/ var / log / messages

       auth .*                                    | exec / usr / local / sbin / authfilter

       *. alert                                   root , eric

       mail .*                                    @logserver . example . org
Introduction      BSD Syslog    IETF Protocols   Still Missing   Analysis




                        “Transport Protocol“


       Input from
         • local applications: socket(AF_UNIX, SOCK_DGRAM, 0);
         • network: socket(AF_INET, SOCK_DGRAM, 0);
         • kernel: open("/dev/klog", O_RDONLY, 0);
            (file interface to ring buffer)
       ⇒ One message per recvfrom()/read().
Introduction       BSD Syslog      IETF Protocols    Still Missing   Analysis




                            Networked Logging


       Usual installation: many systems send logs to central log
       server.
          • ease of use
          • central backup, monitoring, analysis
          • enables event correlation across hosts
          • lower risk of unauthorized access and alteration
Introduction   BSD Syslog       IETF Protocols    Still Missing   Analysis




                Roles, Devices, Data Flow

                      Syslog-Roles:
                        • Devices/Sender generate,
                        • Relays forward,
                        • Collectors receive messages
                      Further processing:
                        • Storage for archiving
                        • Analyzer to analyze
                           and/or summarize data
Introduction         BSD Syslog        IETF Protocols       Still Missing        Analysis




                             Problems with UDP

       Advantages:
         • simple and efficient (usable for embedded devices)
         • allows ”stealth logging“ (in Honeynets)
       Problems:
         • packet loss
         • no sender authentication
       from man syslogd:
       The ability to log messages received in UDP packets is equivalent to an
       unauthenticated remote disk-filling service. . .
Introduction        BSD Syslog       IETF Protocols     Still Missing   Analysis




                             Move to TCP/TLS


       Since ∼ 2000:
       syslogd implementations support TCP transport.
           • no standard established, not always interoperable
           • define ’n’ or ’0’ to mark end of message
             (to send datagrams in stream)
           • possible to tunnel TCP over TLS
           • possible to authenticate servers/clients
Introduction        BSD Syslog     IETF Protocols     Still Missing   Analysis




                 IETF syslog-sec Working Group


           • RFC 3164: The BSD Syslog Protocol (informational)
           • RFC 3195: Reliable Delivery for Syslog
           • current Drafts:
               • The Syslog Protocol
               • UDP transport mapping for Syslog
               • TLS transport mapping for Syslog
               • Signed Syslog Messages
               • Syslog Management Information Base
Introduction           BSD Syslog                IETF Protocols                Still Missing   Analysis




               RFC 3195: Reliable Delivery for Syslog
           • uses BEEP for transport
           • RAW-Mode: just BSD Syslog lines as an
             application/octet-stream payload
           • COOKED-Mode: exchange of XML records
                  C:   Content - Type : application / beep + xml
                  C:
                  C:   < entry facility = ’24 ’ severity = ’5 ’
                  C:      timestamp = ’ Oct 27 13:24:12 ’
                  C:      deviceFQDN = ’ screen . lowry . records . example . com ’
                  C:      deviceIP = ’10.0.0.47 ’
                  C:      pathID = ’173 ’
                  C:      tag = ’ dvd ’ >
                  C:        Job paused - Boss watching .
                  C:   </ entry >
                  C:   END


                  S : Content - Type : application / beep + xml
                  S:
                  S : < ok / >
                  S : END
Introduction        BSD Syslog   IETF Protocols   Still Missing   Analysis




               RFC 3195: Reliable Delivery for Syslog


       Known implementations:
         • LibLogging (R. Gerhards)
         • SDSC Syslog (San Diego Supercomputer Center)
       Known users:
         • none (?)
Introduction        BSD Syslog         IETF Protocols   Still Missing   Analysis




                    Draft: The Syslog Protocol
           • keeps plain text format
           • allows UTF-8 for data fields
           • independent from transport protocol
           • full timestamps
           • message IDs (like Windows Eventlog)
           • structured data fields with namespaces!
             (derived from SNMP Private Enterprise Codes)
           • message lenght:
             MUST accept 480 octets, SHOULD accept 2048 octets,
             MAY receive larger messages (if larger: SHOULD
             truncate the payload, MAY discard the message)
Introduction       BSD Syslog        IETF Protocols   Still Missing   Analysis




                 Syslog-protocol message format
       <165>1 2003-10-11T22:14:15.003Z frodo.example.com evnts - ID47
       [exampleSDID@0 iut="3" eventID="1011" eventSource="Application"]
       An application event log entry . . .
           • Header
               • Priority
               • Version (new)
               • Timestamp (extended)
               • Hostname
               • Application Name
               • Process ID
               • Message ID (new)
           • Structured Data (new)
           • text Message (UTF-8)
Introduction        BSD Syslog     IETF Protocols    Still Missing   Analysis




 Draft: Transmission of syslog messages over UDP




           • just like UDP transport in BSD Syslog
           • one message per datagram
Introduction           BSD Syslog        IETF Protocols     Still Missing   Analysis




           Draft: TLS Transport Mapping for Syslog


           • data encryption, integrity, and host authentication
           • requires server and client certificates
           • difficult part: mutual authentication using certificate,
             certificate fingerprint, or CA
           • datagram encapsulation:
               APPLICATION - DATA = 1* SYSLOG - FRAME
               SYSLOG - FRAME = MSG - LEN SP SYSLOG - MSG
Introduction        BSD Syslog        IETF Protocols      Still Missing        Analysis




       Draft: Syslog Management Information Base

           • describes MIB subtree
           • allows SNMP monitoring of syslog daemons
           • structure:
                • syslogNotifications
                • syslogObjects
                    • syslogControlTable (contains configuration parameters
                      like role, address, max. message size)
                    • syslogOperationsTable (contains operations information
                      like number of processed messages, start time, time of
                      last error)
               • conformance
Introduction        BSD Syslog       IETF Protocols    Still Missing     Analysis




                  Draft: Signed syslog Messages
                                    Overview



           • adds detached, in-band signatures
           • provides origin authentication, message integrity, replay
             resistance, message sequencing, and detection of missing
             messages
           • Payload Blocks: contains public key, sent at
             session/message stream
           • Signature Blocks: signed message, contains hashes of last
             messages
Introduction         BSD Syslog       IETF Protocols     Still Missing   Analysis




                   Draft: Signed syslog Messages
                                  Signature Groups



           • Problem: Different message destinations
         ⇒ Signature Groups: group messages by message priorities
          • Signature Blocks for every Signature Group seperately
          • predefined modes:
               •   only one global Signature Group
               •   each PRI value has its own Signature Group
               •   range of sequential PRI values per Signature Group
               •   any other (custom) scheme
Introduction             BSD Syslog             IETF Protocols           Still Missing   Analysis




                      Draft: Signed syslog Messages
                                           Payload Blocks


       on startup:
         • Payload Block with
                  • timestamp
                  • key type (PKIX (X.509), OpenPGP, public key,
                     predistributed, or other/installation-specific)
                  • key blob (base64)
           • example:
               2008 -05 -21 T13 : 4 7: 36 .00 3+ 02 00 C LW Q ga 2 V5 IG J s b 2 I K

           • keys may be large
         ⇒ Payload Block fragmented into multiple Certificate Blocks
Introduction            BSD Syslog         IETF Protocols        Still Missing        Analysis




                      Draft: Signed syslog Messages
                                      Certificate Blocks

           • Certificate Blocks with ssign-cert SDs:
               [ ssign - cert VER =" xxx " RSID =" xxx " SG =" xxx " SPRI =" xxx "
                 TBPL =" xxx " INDEX =" xxx " FLEN =" xxx " FRAG =" xxx " SIGN =" xxx "]


                  •   Version (including hash and signature algorithm)
                  •   Reboot Session ID
                  •   Signature Group
                  •   Signature Priority
                  •   Total Payload Block Length
                  •   Index into Payload Block
                  •   Fragment Length
                  •   Payload Block Fragment (base64)
                  •   Signature (for this CB, base64)
Introduction             BSD Syslog               IETF Protocols             Still Missing        Analysis




                      Draft: Signed syslog Messages
                                           Certificate Blocks




       example:
       <110 >1 2008 -05 -21 T13 : 5 5 : 00 . 0 0 0 + 02 0 0 frodo . example . com
        - - - [ ssign - cert VER ="0111" RSID ="0"
        SG ="0" SPRI ="0" TBPL ="47" INDEX ="1" FLEN ="47"
        FRAG ="2008 -05 -21 T13 : 4 7 : 3 6. 0 0 3 + 0 20 0 C L W Q g a 2 V 5 I G J s b 2 I K "
        SIGN =" < signature >"]
Introduction            BSD Syslog          IETF Protocols         Still Missing     Analysis




                      Draft: Signed syslog Messages
                                       Signature Blocks

           • Signature Block with with ssign SDs:
               [ ssign VER =" xxx " RSID =" xxx " SG =" xxx " SPRI =" xxx "
                 GBC =" xxx " FMN =" xxx " CNT =" xxx " HB =" xxx " SIGN =" xxx "]


                  •   Version (including hash and signature algorithm)
                  •   Reboot Session ID
                  •   Signature Group
                  •   Signature Priority
                  •   Global Block Counter
                  •   First Message Number
                  •   Count
                  •   Hash Blocks (base64)
                  •   Signature (for this SB, base64)
Introduction        BSD Syslog      IETF Protocols    Still Missing      Analysis




               Problem: TCP unreliable at reconnect


           • single TCP connection is reliable, but on close/reconnect
             a message is lost
           • Problem with TCP (and other SOCK_STREAM interfaces?):
             asynchronous send().
           • even after server closes connection:
             successful send(), writing into local buffer
           • known problem, e.g. in syslog-ng
Introduction       BSD Syslog        IETF Protocols   Still Missing   Analysis




               Problem: TCP unreliable at reconnect
                                possible solutions




       suggested solution: librelp: Reliable Event Logging Protocol
         • one more protocol layer
         • client sends messages with transaction numbers
         • server acknowledges every message
Introduction           BSD Syslog        IETF Protocols     Still Missing     Analysis




               Problem: TCP unreliable at reconnect
                                    possible solutions




       in LANs:
          • use SCTP in 1-to-1 modus
          • use struct tcp_info to check connection state
               getsockopt ( sock , IPPROTO_TCP , TCP_INFO , & tinfo , & tinfo_size );

           • check recv() to receive possible status changes
               rc = recv ( sock , msgbuf , BUFSIZE , MSG_DONTWAIT | MSG_PEEK );
Introduction            BSD Syslog          IETF Protocols         Still Missing        Analysis




                      syslog-protocol vs. syslog-sign

           • Structured Data allows adding data in transport
           • without impairing later parsing/analysis
           • useful with relays or time synchronization problems
           • examples:
               <34 >1 1970 -01 -01 T00 :01:15.009 Z mymachine . example . com
                 syslogd - - [ transport@0 relay1 =" logserver . example . com "
                 timestamp1 ="2003 -10 -11 T18 : 5 4: 1 6 . 7 0 2 + 0 4 : 0 0 " ] restart
               <34 >1 2003 -10 -11 T14 : 00 : 00 . 00 0+ 0 4: 0 0 mymachine . example . com
                 syslogd - - [ transport@0 relay1 =" logserver . example . com "
                 timestamp1 ="2003 -10 -11 T18 : 2 0: 1 6 . 7 0 2 + 0 4 : 0 0 " ] restart

           • but: any change invalidates signature
Introduction           BSD Syslog         IETF Protocols       Still Missing   Analysis




                   Extended API for syslog-protocol
           • syslog(3) API cannot use all syslog-protocol fields
           • no MSGID field
           • no structured data
           • new API desirable
           • possible but incomplete approach: Apple’s asl(3) API:
               aslmsg m = asl_new ( ASL_TYPE_MSG );
               asl_set (m , ASL_KEY_FACILITY , " com . secrets . r . us ");

               # allows arbitrary key = value pairs , but no namespaces :
               asl_set (m , " Clearance " , " Top Secret ");

                ...
               asl_log ( NULL , m , ASL_LEVEL_NOTICE , " Message One ");
                ...
               asl_log ( NULL , m , ASL_LEVEL_ERR , " Message Two ");
Introduction         BSD Syslog        IETF Protocols   Still Missing   Analysis




               Problem: syslog(3) and Local Sockets

           • unreliable (if buffer full)
           • whole message is controlled by the user/application
           • thus syslogd depends on user-supplied data
           • easy message injection:
               echo -n " <32 > Apr 1 03:14:15 mail sshd [1]: 
                 Accepted publickey for root 
                 from 192.168.23.42 port 1024 ssh2 " 
               | socat -u stdin unix - sendto :/ var / run / log
Introduction         BSD Syslog        IETF Protocols    Still Missing   Analysis




               Problem: syslog(3) and Local Sockets
                                  possible solutions




           • device driver to append/inject trusted metadata
             (timestamp, uid, pid)
           • SCM_CREDENTIALS:
                • few systems support passing credentials over local
                  sockets (kernel-verified)
                • setsockopt(sock, SOL_SOCKET, SO_PASSCRED,
                  &on, sizeof(on));
                • different implementations and data structures
Introduction       BSD Syslog     IETF Protocols    Still Missing   Analysis




               Problem: Policy for Reliable Syslog


       Scenario: network problem, logserver unreachable.
       Three alternatives:
         • throw away messages
         • enlarge the buffer (in memory or on disk)
         • blocking syslog(3) calls, i.e. stop processes
       What to do now?
Introduction                            BSD Syslog                              IETF Protocols                               Still Missing                            Analysis




                                                           Log File Analysis
                                                                 99,9 % is unimportant
       Jul   9   09:37:58   localhost   SystemStarter : Willkommen !
       Jul   9   09:37:58   localhost   lookupd [122]: lookupd ( version 324.2.1) starting - Fri Jul 9 09:37:58 2004
       Jul   9   09:37:58   localhost   ConsoleMessage : Starting Apple Multicast DNS Responder
       Jul   9   09:37:58   localhost   ConsoleMessage : Starting kernel event agent
       Jul   9   09:37:58   localhost   ConsoleMessage : Starting timed execution services
       Jul   9   09:37:58   localhost   ConsoleMessage : Starting SecurityServer
       Jul   9   09:38:01   localhost   SystemStarter : ? Apple Multicast DNS Responder ? wird gestartet
       Jul   9   09:38:02   localhost   SystemStarter : ? Kernel Event Agent ? wird gestartet
       Jul   9   09:38:02   localhost   SystemStarter : ? Timed Execution Services ? werden gestartet
       Jul   9   09:38:04   localhost   kernel : A p p l e PM U U s e r C l i e nt :: setProperties Wak eOnACchange 0
       Jul   9   09:38:06   localhost   ConsoleMessage : Initializing network
       Jul   9   09:38:06   localhost   mDNSResponder [155]: mDNSResponder -58.8 ( Apr 24 2004 20:38:40) starting
       Jul   9   09:38:06   localhost   SystemStarter : Starting SecuritySe rver
       Jul   9   09:38:06   localhost   SystemStarter : Netzwerkdienste werden initialisiert
       Jul   9   09:38:06   localhost   ConsoleMessage : Checking disks
       Jul   9   09:38:06   localhost   SystemStarter : Volumes werden ? berpr ? ft
       Jul   9   09:38:08   localhost   kernel : ATY , Bee_A : vram [9 c000000 :02000000]
       Jul   9   09:38:08   localhost   kernel : ATY , Bee_B : vram [ 9 8 0 0 0 0 0 0 : 0 2 0 0 0 0 0 0 ]
       Jul   9   09:38:08   localhost   syslogd : / dev / console : Input / output error
       Jul   9   09:38:08   localhost   init : kernel security level changed from 0 to 1
       Jul   9   09:38:09   localhost   D irec tory Serv ice [186]: Launched version 1.8 ( v256 .6)
       Jul   9   09:38:09   localhost   loginwindow [182]: Sent launch request message to Di r e cto ry Se rv ic e mach_init port
       Jul   9   09:38:16   localhost   SystemStarter : Warten auf ? Netzwerkd ien ste werden initialisiert ?
       Jul   9   09:38:22   localhost   last message repeated 2 times
       Jul   9   09:38:23   localhost   configd [87]: executing / System / Library / S y s t e m C o n f i g u r a t i o n / Kicker . bundle / Contents / Resources / set - hostname
       Jul   9   09:38:24   localhost   set - hostname [195]: setting hostname to ivich . local
       Jul   9   09:38:25   localhost   SystemStarter : Warten auf ? Netzwerkd ien ste werden initialisiert ?
       Jul   9   09:38:28   localhost   ConsoleMessage : Loading Shared IP extension
       Jul   9   09:38:28   localhost   SystemStarter : Shared - IP - Erweiterung wird geladen
       Jul   9   09:38:28   localhost   / usr / libexec / crashreporterd : g e t _ e x c e p t i o n _ p o r t s () failed : ( ipc / send ) invalid destination port
       Jul   9   09:38:28   localhost   ConsoleMessage : Starting Apple File Service
       Jul   9   09:38:28   localhost   ConsoleMessage : Starting printing services
       Jul   9   09:38:29   localhost   SystemStarter : ? Apple File Services ? werden gestartet
       Jul   9   09:38:29   localhost   SystemStarter : Die Druckerdienste werden gestartet
       Jul   9   09:38:30   localhost   ConsoleMessage : Loading IP Firewall extension
       Jul   9   09:38:30   localhost   SystemStarter : IP - Firewall - Erweiterung wird geladen
       Jul   9   09:38:32   localhost   kernel : IP packet filtering initialized , divert enabled , rule - based forwarding enabled , default to accept , logging disabled
       Jul   9   09:38:32   localhost   kernel : IPv6 packet filtering initialized , default to accept , logging disabled
       Jul   9   09:38:32   localhost   kernel : IP firewall loaded
       Jul   9   09:38:32   localhost   ConsoleMessage : Starting internet services
       Jul   9   09:38:32   localhost   SystemStarter : ? Internet Services ? werden gestartet
       Jul   9   09:38:32   localhost   xinetd [257]: xinetd Version 2.3.11 started with libwrap options compiled in .
       Jul   9   09:38:32   localhost   xinetd [257]: Started working : 3 available services
       Jul   9   09:38:33   localhost   SystemStarter : Systemstart beendet .
       Jul   9   09:38:44   localhost   d iska rbit rati ond [88]: disk1s2 hfs ED021A74 -9 EEF -3 AA5 -9 B54 -5 B703F7D0D71 ute [ not mounted ]
       Jul   9   09:38:45   localhost   d iska rbit rati ond [88]: disk1s2 hfs ED021A74 -9 EEF -3 AA5 -9 B54 -5 B703F7D0D71 ute / Users / ute
Introduction           BSD Syslog           IETF Protocols          Still Missing            Analysis




                                    Normalization

           • messages from different sources in diferent formats
             (Syslog, multilog, Windows Eventlog, SNMP traps, . . . )
           • convert into common format
                • timestamp format
                • character set
                • data fields

       Example: Eventlog → Syslog
       2008 -05 -06 T15 : 1 8 : 0 1 . 00 + 0 2 : 0 0 THESEUS NT : < NTSYSLOG ; I2 ; > 
         Service ’ NTSYSLOG ’ wurde gestartet
       2008 -05 -06 T15 : 1 7 : 5 8 . 00 + 0 2 : 0 0 THESEUS NT : < EventLog ; I6005 ; > 
         Der E r e i g n i s p r o t o k o l l d i e n s t wurde gestartet .
Introduction        BSD Syslog   IETF Protocols   Still Missing   Analysis




                                 grep


           • grep "important Msg" logdatei | less
           • grep -v "unimportant Msg1" logdatei | 
               grep -v "unimportant Msg2" | 
               grep -v "unimportant Msg3" | less

           • inefficient
           • only interactive
Introduction        BSD Syslog       IETF Protocols      Still Missing   Analysis




                          grep and Shell Tools

       cat logfile 
        | egrep ’^.{15} .+ sshd [.+]: Invalid user .+ from .+ $ ’ 
        | sed -e ’s /^.{16}// ’ -e ’s / sshd [.*]: / sshd : / ’ 
          -e ’s / user .* from / user XY from / ’ 
        | sort | uniq -c | sort - nr >> report

       Ergebnis:
       Summary : lines . l o g i n _ f a i l e d _ u s e r
       --------------------------------
        451 neo sshd : Invalid user XY from 210.75.23.122
        451 mail sshd : Invalid user XY from 210.75.23.122
        209 neo sshd : Invalid user XY from 60.191.41.89
         12 neo sshd : Invalid user XY from 125 .1 52 .17 .2 36
         12 mail sshd : Invalid user XY from 12 5. 15 2.1 7. 23 6
Introduction        BSD Syslog      IETF Protocols   Still Missing   Analysis




                             Artificial Ignorance

           • filter known good messages
           • leave new and unknown messages for inspection
       Steps:
        1. take existing logs, strip timestamps & PIDs
        2. list with sort | uniq -c
        3. write regexps to filter known good messages
        4. regularly review remaining messages
        5. readjust filters
Introduction         BSD Syslog       IETF Protocols   Still Missing   Analysis




                                  logcheck


           • uses lists of regexps to classify:
               • hacking
               • violations
               • ignore
               • everything else
           • sends report by e-mail
           • uses logtail to remember current position in logfile
           • can be called as often as necessary (hourly, dayly, weekly)
Introduction                      BSD Syslog                            IETF Protocols                         Still Missing    Analysis




                                                              logwatch
            • similar to logcheck
            • calls Perl scripts for service-dependent summary
            • e.g. for amavisd:
       ****** Summary * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
              2   Miscellaneous warnings
       ========   ================================================
          19664   Ham - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -       95.36%
          19630     Clean passed                                                                  95.19%
             34     Bad header passed                                                               0.16%

               942        Spam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -    4.57%
               514          Spam blocked                                                              2.49%
               428          Spam discarded ( no quarantine )                                          2.08%

                 15       Malware - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -       0.07%
                 15         Malware blocked                                                           0.07%

          20621           Total messages scanned - - - - - - - - - - - - - - - - 100.00%
        662.993 M         Total bytes scanned                                695 ,198 ,092
       ========           ================================================
Introduction                BSD Syslog            IETF Protocols      Still Missing   Analysis




                             service-specific summaries
                                         e. g. pflogsumm for Postfix

       Postfix log summaries for May 21

       Grand Totals
       ------------
       messages

           7708       received
          27350       delivered
              3       forwarded
             70       deferred (575 deferrals )
            240       bounced
          48996       rejected (63%)
              0       reject warnings
              0       held
            262       discarded (0%)

             1024 m   bytes received
             4036 m   bytes delivered
              931     senders
              520     sending hosts / domains
             3621     recipients
              506     recipient hosts / domains

       ...
Introduction   BSD Syslog        IETF Protocols   Still Missing   Analysis




                            Counting Events
Introduction        BSD Syslog      IETF Protocols    Still Missing   Analysis




                           real time monitoring
       advantages:
         • follow sequences and dependencies of related messages
         • stateful analysis (e.g. follow user session)
         • automatic reactions (notification or countermeasure)
       some programs:
         • special purpose:
               • Snort (network IDS)
               • Nagios (device/service monitoring)
               • fail2ban (ssh logins)
           • general purpose:
               • swatch
               • logsurfer
               • Simple Event Correlator
Introduction        BSD Syslog        IETF Protocols      Still Missing     Analysis




                                    Swatch


           • matches lines against regexp
           • performs actions on match
       swatch.conf example:
       ignore / ntpd .*: kernel time sync enabled /

       watchfor /[ fF ] ailed password for (.*) from (.*) port (.*) $ /
               throttle threshold =3 , delay =0:1:0 , key = $2
               exec "/ sbin / iptables -A s wa tch _r ej ect s -s $2 -j DROP "
Introduction          BSD Syslog      IETF Protocols      Still Missing   Analysis




                            Logsurfer/Logsurfer+

           • matches lines against match-regex and not-match-regex
           • performs usual actions
           • feature: create/delete rules
           • collect multiple lines in a context
           • complex configuration with multiple levels of quoting
       rule format:
       match - regex not - match - regex
          stop - regex not - stop - regex timeout [ continue ] action
Introduction        BSD Syslog         IETF Protocols       Still Missing    Analysis




                          Logsurfer/Logsurfer+


       advanced logsurfer.conf example:
       ’ on (/.*): file system full$ ’ ’/ root / mp3sammlung ’ - - 0
             exec "/ usr / bin / find " " $1 - name *. mp3 - exec rm {} ;"

       ’ failed password for (.*) from (.*) port (.*) $ ’ - - - 0
             pipe " report . sh notice "

       ’.* ’ - - - 0
             echo >> lines . unknown $0
Introduction             BSD Syslog               IETF Protocols             Still Missing         Analysis




                                              contexts

       ’ ftpd [[0 -9]+]: (? @ ([0 -9.]+)) [ INFO ] Neue Verbindung von 1. $ ’ - - - 0
          open
          " ftpd [[0 -9]+]: (.* @$2 )" - 2000 720 20 ignore

       ’ ftpd [[0 -9]+]: (.* @ (.*)) [ ERROR ] ’ - - - 0
          rule before
          " ftpd [[0 -9]+]: (.* @ ( $2 )) [ INFO ] Logout ." - - - 300
               report "/ bin / cat " " ftpd [[0 -9]+]: (.* @$2 )"


       created context:
       ftpd [[0 -9]+]: (.* @192 .168.0.2)


       created rule:
       ftpd [[0 -9]+]: (.* @ (192.1 68.0.2)) [ INFO ] Logout . -
                 - - 300
                 REPORT "/ bin / cat " " ftpd [[0 -9]+]: (.* @$2 )"
Introduction        BSD Syslog      IETF Protocols     Still Missing   Analysis




                        Simple Event Correlator



           • can count events and observe thresholds
           • dynamic creation/deletion of rules
           • create own events
           • arbitrary context names
           • execute custom Perl functions
Introduction         BSD Syslog         IETF Protocols       Still Missing      Analysis




                         Simple Event Correlator

       sec.conf example:
       type = S i n g l e W i t h 2 T h r e s h o l d s
       ptype = RegExp
       pattern = sshd .*: a ut hen ti ca tio n failure [ ;].* rhost =( S +)

       desc = Multiple failed ssh au th ent ic ati on attempts from $1
       action = logonly ; shellcmd ( / usr / local / sbin / ipt - add [...] )
       window =60
       thresh =4

       desc2 = Pruning iptables firewall rule blocking ssh from $1
       action2 = logonly ; shellcmd ( / sbin / iptables [...] )
       window2 =7200
       thresh2 =0
Introduction         BSD Syslog       IETF Protocols   Still Missing   Analysis




                      note on automatic actions


           • possible notifications:
             SNMP-traps, e-mail, Jabber, SMS, . . .
           • must not cause new errors
           • countermeasures only in known environment
           • log messages are user input – always quote and filter in
             scripts
               sshd [164]: ... illegal user ‘ rm - rf * ‘
Introduction         BSD Syslog        IETF Protocols   Still Missing   Analysis




                                  recommendations

           • use only few logfiles (not every facility seperate)
           • automate, filter, summarize
           • read only new or known bad messages yourself, but do
             read them
           • put analysis/summary in periodic daily
           • do not plan overly complex (classification is good,
             time-based thresholds are nice to have, dynamic rules and
             contexts are seldom necessary)
Links




                       Links: Information



        • NetBSD GSoC08 project: syslogd
        • IETF Syslog Working Group Status Page

        • LogAnalysis.org
        • Syslog-ng FAQ und Loghost HOWTO
Links




                      Links: Daemons



        • rsyslog
        • syslog-ng
        • stunnel
Links




                          Links: Analysis

        • logcheck
        • logwatch
        • Swatch
        • LoGS
        • SEC - simple event correlator
        • Logsurfer
        • Logsurfer+
        • Artificial Ignorance: How-To Guide

Contenu connexe

Tendances

IBM Websphere MQ Basic
IBM Websphere MQ BasicIBM Websphere MQ Basic
IBM Websphere MQ BasicPRASAD BHATKAR
 
Introduction into SIP protocol
Introduction into SIP protocolIntroduction into SIP protocol
Introduction into SIP protocolMichal Hrncirik
 
Websphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentalsWebsphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentalsBiju Nair
 
17 palo alto threat prevention concept
17 palo alto threat prevention concept17 palo alto threat prevention concept
17 palo alto threat prevention conceptMostafa El Lathy
 
VoLTE Interfaces , Protocols & IMS Stack
VoLTE Interfaces , Protocols & IMS StackVoLTE Interfaces , Protocols & IMS Stack
VoLTE Interfaces , Protocols & IMS StackVikas Shokeen
 
SNMP(Simple Network Management Protocol)
SNMP(Simple Network Management Protocol)SNMP(Simple Network Management Protocol)
SNMP(Simple Network Management Protocol)Mohammad Awais Javaid
 
Avaya Aura Messaging Portfolio
Avaya Aura Messaging PortfolioAvaya Aura Messaging Portfolio
Avaya Aura Messaging PortfolioMotty Ben Atia
 
16 palo alto ssl decryption policy concept
16 palo alto ssl decryption policy concept16 palo alto ssl decryption policy concept
16 palo alto ssl decryption policy conceptMostafa El Lathy
 
6 pan-os software update &amp; downgrade instruction
6 pan-os software update &amp; downgrade instruction6 pan-os software update &amp; downgrade instruction
6 pan-os software update &amp; downgrade instructionMostafa El Lathy
 
7 palo alto security zones &amp; interfaces concepts
7 palo alto security zones &amp; interfaces concepts7 palo alto security zones &amp; interfaces concepts
7 palo alto security zones &amp; interfaces conceptsMostafa El Lathy
 
IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)Juarez Junior
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslogamiable_indian
 
2 what is the best firewall (sizing)
2 what is the best firewall (sizing)2 what is the best firewall (sizing)
2 what is the best firewall (sizing)Mostafa El Lathy
 
Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1Barry Hesk
 
Session initiation protocol SIP
Session initiation protocol SIPSession initiation protocol SIP
Session initiation protocol SIPLaraib Khan
 
8 palo alto security policy concepts
8 palo alto security policy concepts8 palo alto security policy concepts
8 palo alto security policy conceptsMostafa El Lathy
 
Fundamental of Quality of Service(QoS)
Fundamental of Quality of Service(QoS) Fundamental of Quality of Service(QoS)
Fundamental of Quality of Service(QoS) Reza Farahani
 

Tendances (20)

IBM Websphere MQ Basic
IBM Websphere MQ BasicIBM Websphere MQ Basic
IBM Websphere MQ Basic
 
Introduction into SIP protocol
Introduction into SIP protocolIntroduction into SIP protocol
Introduction into SIP protocol
 
sigtran
sigtransigtran
sigtran
 
Websphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentalsWebsphere MQ (MQSeries) fundamentals
Websphere MQ (MQSeries) fundamentals
 
17 palo alto threat prevention concept
17 palo alto threat prevention concept17 palo alto threat prevention concept
17 palo alto threat prevention concept
 
VoLTE Interfaces , Protocols & IMS Stack
VoLTE Interfaces , Protocols & IMS StackVoLTE Interfaces , Protocols & IMS Stack
VoLTE Interfaces , Protocols & IMS Stack
 
SNMP(Simple Network Management Protocol)
SNMP(Simple Network Management Protocol)SNMP(Simple Network Management Protocol)
SNMP(Simple Network Management Protocol)
 
20 palo alto site to site
20 palo alto site to site20 palo alto site to site
20 palo alto site to site
 
Avaya Aura Messaging Portfolio
Avaya Aura Messaging PortfolioAvaya Aura Messaging Portfolio
Avaya Aura Messaging Portfolio
 
16 palo alto ssl decryption policy concept
16 palo alto ssl decryption policy concept16 palo alto ssl decryption policy concept
16 palo alto ssl decryption policy concept
 
6 pan-os software update &amp; downgrade instruction
6 pan-os software update &amp; downgrade instruction6 pan-os software update &amp; downgrade instruction
6 pan-os software update &amp; downgrade instruction
 
7 palo alto security zones &amp; interfaces concepts
7 palo alto security zones &amp; interfaces concepts7 palo alto security zones &amp; interfaces concepts
7 palo alto security zones &amp; interfaces concepts
 
IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
2 what is the best firewall (sizing)
2 what is the best firewall (sizing)2 what is the best firewall (sizing)
2 what is the best firewall (sizing)
 
Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1Barry Hesk: Cisco Unified Communications Manager training deck 1
Barry Hesk: Cisco Unified Communications Manager training deck 1
 
Session initiation protocol SIP
Session initiation protocol SIPSession initiation protocol SIP
Session initiation protocol SIP
 
WebSphere MQ tutorial
WebSphere MQ tutorialWebSphere MQ tutorial
WebSphere MQ tutorial
 
8 palo alto security policy concepts
8 palo alto security policy concepts8 palo alto security policy concepts
8 palo alto security policy concepts
 
Fundamental of Quality of Service(QoS)
Fundamental of Quality of Service(QoS) Fundamental of Quality of Service(QoS)
Fundamental of Quality of Service(QoS)
 

Similaire à Syslog Protocols

NetBSD syslogd with IETF Syslog Protocols
NetBSD syslogd with IETF Syslog ProtocolsNetBSD syslogd with IETF Syslog Protocols
NetBSD syslogd with IETF Syslog ProtocolsMartin Schütte
 
LogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log StandardizationLogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log StandardizationAnton Chuvakin
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...Alexandre Moneger
 
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-BayesOSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-BayesNETWAYS
 
Tutorial: Network State Awareness Troubleshooting
Tutorial: Network State Awareness TroubleshootingTutorial: Network State Awareness Troubleshooting
Tutorial: Network State Awareness TroubleshootingAPNIC
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Puppet
 
Kernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesKernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesAnne Nicolas
 
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica SarbuOSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica SarbuNETWAYS
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote ShellcodeAj MaChInE
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Hajime Tazaki
 
Discovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitDiscovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitAbhisek Datta
 
Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetesTed Jung
 
下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-final下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-finalcsdnmobile
 
Search and analyze data in real time
Search and analyze data in real timeSearch and analyze data in real time
Search and analyze data in real timeRohit Kalsarpe
 
Dataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and toolsDataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and toolsStefano Salsano
 
Docker interview Questions-3.pdf
Docker interview Questions-3.pdfDocker interview Questions-3.pdf
Docker interview Questions-3.pdfYogeshwaran R
 
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios
 

Similaire à Syslog Protocols (20)

NetBSD syslogd with IETF Syslog Protocols
NetBSD syslogd with IETF Syslog ProtocolsNetBSD syslogd with IETF Syslog Protocols
NetBSD syslogd with IETF Syslog Protocols
 
LogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log StandardizationLogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log Standardization
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
 
Mina2
Mina2Mina2
Mina2
 
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-BayesOSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
OSDC 2016 - Ingesting Logs with Style by Pere Urbon-Bayes
 
Tutorial: Network State Awareness Troubleshooting
Tutorial: Network State Awareness TroubleshootingTutorial: Network State Awareness Troubleshooting
Tutorial: Network State Awareness Troubleshooting
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
 
Kernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesKernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologies
 
Tos tutorial
Tos tutorialTos tutorial
Tos tutorial
 
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica SarbuOSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
OSDC 2016 - Unifying Logs and Metrics Data with Elastic Beats by Monica Sarbu
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
 
Discovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitDiscovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and Profit
 
Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetes
 
下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-final下午1 intel yang, elton_mee_go-arch-update-final
下午1 intel yang, elton_mee_go-arch-update-final
 
Search and analyze data in real time
Search and analyze data in real timeSearch and analyze data in real time
Search and analyze data in real time
 
Dataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and toolsDataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and tools
 
Docker interview Questions-3.pdf
Docker interview Questions-3.pdfDocker interview Questions-3.pdf
Docker interview Questions-3.pdf
 
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
 

Plus de Martin Schütte

Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)Martin Schütte
 
Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)Martin Schütte
 
Terraform – Infrastructure as Code (Kielux'18)
Terraform – Infrastructure as Code (Kielux'18)Terraform – Infrastructure as Code (Kielux'18)
Terraform – Infrastructure as Code (Kielux'18)Martin Schütte
 
Terraform -- Infrastructure as Code
Terraform -- Infrastructure as CodeTerraform -- Infrastructure as Code
Terraform -- Infrastructure as CodeMartin Schütte
 
Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)Martin Schütte
 
Terraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud ServicesTerraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud ServicesMartin Schütte
 
The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)Martin Schütte
 
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)Martin Schütte
 
Short Introduction to IPv6
Short Introduction to IPv6Short Introduction to IPv6
Short Introduction to IPv6Martin Schütte
 
Software Testing on the Web
Software Testing on the WebSoftware Testing on the Web
Software Testing on the WebMartin Schütte
 
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...Martin Schütte
 

Plus de Martin Schütte (12)

Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)
 
Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)Writing Ansible Modules (CLT'19)
Writing Ansible Modules (CLT'19)
 
Terraform – Infrastructure as Code (Kielux'18)
Terraform – Infrastructure as Code (Kielux'18)Terraform – Infrastructure as Code (Kielux'18)
Terraform – Infrastructure as Code (Kielux'18)
 
Terraform -- Infrastructure as Code
Terraform -- Infrastructure as CodeTerraform -- Infrastructure as Code
Terraform -- Infrastructure as Code
 
Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)
 
Terraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud ServicesTerraform: Configuration Management for Cloud Services
Terraform: Configuration Management for Cloud Services
 
The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)The IPv6 Snort Plugin (at DeepSec 2014)
The IPv6 Snort Plugin (at DeepSec 2014)
 
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
The IPv6 Snort Plugin (at Troopers 14 IPv6 Security Summit)
 
Short Introduction to IPv6
Short Introduction to IPv6Short Introduction to IPv6
Short Introduction to IPv6
 
Software Testing on the Web
Software Testing on the WebSoftware Testing on the Web
Software Testing on the Web
 
PGP/GPG Einführung
PGP/GPG EinführungPGP/GPG Einführung
PGP/GPG Einführung
 
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
Design and Implementation of an IPv6 Plugin for the Snort Intrusion Detection...
 

Dernier

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 

Dernier (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 

Syslog Protocols

  • 1. Introduction BSD Syslog IETF Protocols Still Missing Analysis Syslog Protocols Martin Schütte 22/29 May 2008
  • 2. Introduction BSD Syslog IETF Protocols Still Missing Analysis Introduction Logging Syslog vs. Audit BSD Syslog Overview Format API Daemon IPC IETF Protocols Overview, RFC Internet Drafts Draft: syslog-sign Still Missing reliable TCP reconnect UI, API and local transport Analysis Classification real time monitoring Conclusion
  • 3. Introduction BSD Syslog IETF Protocols Still Missing Analysis Logging Merriam-Webster Online Dictionary: log [1, noun] 3 a: the record of the rate of a ship’s speed or of her daily progress; also: the full nautical record of a ship’s voyage b: the full record of a flight by an aircraft 4: a record of performance, events, or day-to-day activities log [2, verb] 2: to make a note or record of: enter details of or about in a log
  • 4. Introduction BSD Syslog IETF Protocols Still Missing Analysis Using Log Data • Debugging • Statistics/Planning • Accountability for user actions • Detect ongoing attacks • Examine security incidents
  • 5. Introduction BSD Syslog IETF Protocols Still Missing Analysis Syslog vs. Audit Audit Syslog • mandantory • part of application (no action without log) • controlled by user • needs trusted system • optional and unreliable • low-level (usually in kernel) • gets semantic content/meaning • little semantic content/meaning • (often) human readable messages • large amount of data
  • 6. Introduction BSD Syslog IETF Protocols Still Missing Analysis Levels of Abstraction Audit (10 out of 140 events) header ,68 ,10 , recvfrom (2) ,0 , Thu May 8 16:41:55 2008 , + 349 msec , subject , -1 , root , wheel , root , wheel ,763 ,0 ,0 ,0.0.0.0 , return , failure : Resource temporarily unavailable ,4294967295 , trailer ,68 , header ,68 ,10 , connect (2) ,0 , Thu May 8 16:41:55 2008 , + 349 msec , subject , mschuett , sshd , sshd , sshd , sshd ,80728 ,53083 ,56590 ,141.89.58.200 , return , failure : No such file or directory ,4294967295 , trailer ,68 , header ,68 ,10 , connect (2) ,0 , Thu May 8 16:41:55 2008 , + 349 msec , subject , mschuett , sshd , sshd , sshd , sshd ,80728 ,53083 ,56590 ,141.89.58.200 , return , failure : No such file or directory ,4294967295 , trailer ,68 , header ,68 ,10 , sendto (2) ,0 , Thu May 8 16:41:55 2008 , + 351 msec , subject , mschuett , sshd , sshd , sshd , sshd ,80728 ,53083 ,56590 ,141.89.58.200 , return , failure : Bad file descriptor ,4294967295 , trailer ,68 , header ,96 ,10 , OpenSSH login ,0 , Thu May 8 16:41:55 2008 , + 357 msec , subject , -1 , -1 , -1 , -1 , -1 ,80727 ,80727 ,52400 ,141.89.58.200 , text , invalid user name " user " , return , failure : No such process ,4294967295 , trailer ,96 , header ,68 ,10 , auditon (2) - get audit state ,0 , Thu May 8 16:41:55 2008 , + 357 msec , subject , mschuett , root , wheel , root , wheel ,80727 ,53083 ,56590 ,141.89.58.200 , return , success ,0 , trailer ,68 , header ,68 ,10 , sysctl (3) ,0 , Thu May 8 16:41:59 2008 , + 535 msec , subject , -1 , root , wheel , root , wheel ,853 ,0 ,0 ,0.0.0.0 , return , success ,0 , trailer ,68 , header ,68 ,10 , sysctl (3) ,0 , Thu May 8 16:41:59 2008 , + 535 msec , subject , -1 , root , wheel , root , wheel ,853 ,0 ,0 ,0.0.0.0 , return , success ,0 , trailer ,68 , header ,68 ,10 , pipe (2) ,0 , Thu May 8 16:41:59 2008 , + 589 msec , subject , mschuett , root , wheel , root , wheel ,80729 ,53083 ,56590 ,141.89.58.200 , return , success ,3 , trailer ,68 ,
  • 7. Introduction BSD Syslog IETF Protocols Still Missing Analysis Levels of Abstraction Syslog 2008 -05 -08 T16 :41:53.00+02:00 fax sshd [80727]: Invalid user user from 141.89.58.200 2008 -05 -08 T16 :41:53.00+02:00 fax sshd [80727]: Failed none for invalid user user from 141.89.58.200 port 52400 ssh2 2008 -05 -08 T16 :41:54.00+02:00 fax sshd [80727]: Failed password for invalid user user from 141.89.58.200 port 52400 ssh2 2008 -05 -08 T16 :41:55.00+02:00 fax sshd [80727]: Failed password for invalid user user from 141.89.58.200 port 52400 ssh2 2008 -05 -08 T16 :41:55.00+02:00 fax sshd [80727]: Failed password for invalid user user from 141.89.58.200 port 52400 ssh2
  • 8. Introduction BSD Syslog IETF Protocols Still Missing Analysis Levels of Abstraction possible Summary 3 fax sshd : auth error user XY from 141.89.58.200
  • 9. Introduction BSD Syslog IETF Protocols Still Missing Analysis BSD Syslog • introduced by Eric Allman for sendmail (∼ 1984) • primarily designed for programming/debugging • simple, uniform, easy to use and configure • de facto standard for logging on Unix • 2001: RFC 3164 describes common features
  • 10. Introduction BSD Syslog IETF Protocols Still Missing Analysis BSD Syslog • introduced by Eric Allman for sendmail (∼ 1984) • primarily designed for programming/debugging • simple, uniform, easy to use and configure • de facto standard for logging on Unix • 2001: RFC 3164 describes common features Eric wrote syslogd so that all the logs could be brought to one place and cleanly thrown away at once.
  • 11. Introduction BSD Syslog IETF Protocols Still Missing Analysis BSD Syslog Combination of: • message format • API • daemon • protocol for IPC
  • 12. Introduction BSD Syslog IETF Protocols Still Missing Analysis Syslog Message Format <38>Mar 17 21:57:57 frodo sshd[701]: Connection from 211.74.5.81 port 5991 <52>Mar 17 13:54:30 192.168.0.42 printer: paper out • Priority By convention: • Header • Priority not written • Timestamp to logfile • Hostname • only printable ASCII • Message • Tag • up to 1024 characters • Content
  • 13. Introduction BSD Syslog IETF Protocols Still Missing Analysis Metadata: Facility & Severity Facility: Severity: 0. kernel messages 0. Emergency: system is unusable 1. user-level messages 1. Alert: action must be taken immediately 2. mail system 3. system daemons 2. Critical: critical conditions 4. security/authorization messages (auth) 3. Error: error conditions 5. messages generated internally by syslogd 4. Warning: warning conditions 6. line printer subsystem 7. network news subsystem 5. Notice: normal but significant condition 8. UUCP subsystem 6. Informational: informational messages 9. clock daemon 7. Debug: debug-level messages 10. security/authorization messages (authpriv) 11. FTP daemon 12. NTP subsystem 13. log audit Priority := 8 × Facility + Severity 14. log alert 15. cron daemon 16. local use 0 (local0) 17. local use 1 (local1) 18. local use 2 (local2) 19. local use 3 (local3) 20. local use 4 (local4) 21. local use 5 (local5) 22. local use 6 (local6) 23. local use 7 (local7)
  • 14. Introduction BSD Syslog IETF Protocols Still Missing Analysis API • #include <syslog.h> • void openlog(const char *ident, int logopt, int facility); allocate resources and set options • int setlogmask(int maskpri); set mask to log only severe messages • void syslog(int priority, const char *message, ... ); send one log message, arguments like printf() • void closelog(void); free resources
  • 15. Introduction BSD Syslog IETF Protocols Still Missing Analysis Send Messages • in programs: # include < syslog .h > openlog ( " my_tool " , LOG_PID , 0); setlogmask ( LOG_UPTO ( LOG_INFO )); syslog ( LOG_LPR | LOG_ALERT , " printer on fire " ); closelog (); • from shell: / usr / bin / logger -t my_tool -i -p lpr . alert " printer on fire " • by pipe (e. g. in httpd.conf): ErrorLog "|/ usr / bin / logger -p local3 . info -t apache "
  • 16. Introduction BSD Syslog IETF Protocols Still Missing Analysis syslogd • collects messages from kernel, applications, and network • filters by priority • writes to files, programs, terminals, or network (UDP) • newer implementations (like syslog-ng or rsyslog) with additional features, like: • filter by host/program/regexp • different message and timestamp formats • TCP or SQL servers as destinations
  • 17. Introduction BSD Syslog IETF Protocols Still Missing Analysis syslog.conf One rule on every line: Selector <Tab> Action Example: authpriv .* / var / log / secure *. info ; mail . none ; authpriv . none -/ var / log / messages auth .* | exec / usr / local / sbin / authfilter *. alert root , eric mail .* @logserver . example . org
  • 18. Introduction BSD Syslog IETF Protocols Still Missing Analysis “Transport Protocol“ Input from • local applications: socket(AF_UNIX, SOCK_DGRAM, 0); • network: socket(AF_INET, SOCK_DGRAM, 0); • kernel: open("/dev/klog", O_RDONLY, 0); (file interface to ring buffer) ⇒ One message per recvfrom()/read().
  • 19. Introduction BSD Syslog IETF Protocols Still Missing Analysis Networked Logging Usual installation: many systems send logs to central log server. • ease of use • central backup, monitoring, analysis • enables event correlation across hosts • lower risk of unauthorized access and alteration
  • 20. Introduction BSD Syslog IETF Protocols Still Missing Analysis Roles, Devices, Data Flow Syslog-Roles: • Devices/Sender generate, • Relays forward, • Collectors receive messages Further processing: • Storage for archiving • Analyzer to analyze and/or summarize data
  • 21. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problems with UDP Advantages: • simple and efficient (usable for embedded devices) • allows ”stealth logging“ (in Honeynets) Problems: • packet loss • no sender authentication from man syslogd: The ability to log messages received in UDP packets is equivalent to an unauthenticated remote disk-filling service. . .
  • 22. Introduction BSD Syslog IETF Protocols Still Missing Analysis Move to TCP/TLS Since ∼ 2000: syslogd implementations support TCP transport. • no standard established, not always interoperable • define ’n’ or ’0’ to mark end of message (to send datagrams in stream) • possible to tunnel TCP over TLS • possible to authenticate servers/clients
  • 23. Introduction BSD Syslog IETF Protocols Still Missing Analysis IETF syslog-sec Working Group • RFC 3164: The BSD Syslog Protocol (informational) • RFC 3195: Reliable Delivery for Syslog • current Drafts: • The Syslog Protocol • UDP transport mapping for Syslog • TLS transport mapping for Syslog • Signed Syslog Messages • Syslog Management Information Base
  • 24. Introduction BSD Syslog IETF Protocols Still Missing Analysis RFC 3195: Reliable Delivery for Syslog • uses BEEP for transport • RAW-Mode: just BSD Syslog lines as an application/octet-stream payload • COOKED-Mode: exchange of XML records C: Content - Type : application / beep + xml C: C: < entry facility = ’24 ’ severity = ’5 ’ C: timestamp = ’ Oct 27 13:24:12 ’ C: deviceFQDN = ’ screen . lowry . records . example . com ’ C: deviceIP = ’10.0.0.47 ’ C: pathID = ’173 ’ C: tag = ’ dvd ’ > C: Job paused - Boss watching . C: </ entry > C: END S : Content - Type : application / beep + xml S: S : < ok / > S : END
  • 25. Introduction BSD Syslog IETF Protocols Still Missing Analysis RFC 3195: Reliable Delivery for Syslog Known implementations: • LibLogging (R. Gerhards) • SDSC Syslog (San Diego Supercomputer Center) Known users: • none (?)
  • 26. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: The Syslog Protocol • keeps plain text format • allows UTF-8 for data fields • independent from transport protocol • full timestamps • message IDs (like Windows Eventlog) • structured data fields with namespaces! (derived from SNMP Private Enterprise Codes) • message lenght: MUST accept 480 octets, SHOULD accept 2048 octets, MAY receive larger messages (if larger: SHOULD truncate the payload, MAY discard the message)
  • 27. Introduction BSD Syslog IETF Protocols Still Missing Analysis Syslog-protocol message format <165>1 2003-10-11T22:14:15.003Z frodo.example.com evnts - ID47 [exampleSDID@0 iut="3" eventID="1011" eventSource="Application"] An application event log entry . . . • Header • Priority • Version (new) • Timestamp (extended) • Hostname • Application Name • Process ID • Message ID (new) • Structured Data (new) • text Message (UTF-8)
  • 28. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Transmission of syslog messages over UDP • just like UDP transport in BSD Syslog • one message per datagram
  • 29. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: TLS Transport Mapping for Syslog • data encryption, integrity, and host authentication • requires server and client certificates • difficult part: mutual authentication using certificate, certificate fingerprint, or CA • datagram encapsulation: APPLICATION - DATA = 1* SYSLOG - FRAME SYSLOG - FRAME = MSG - LEN SP SYSLOG - MSG
  • 30. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Syslog Management Information Base • describes MIB subtree • allows SNMP monitoring of syslog daemons • structure: • syslogNotifications • syslogObjects • syslogControlTable (contains configuration parameters like role, address, max. message size) • syslogOperationsTable (contains operations information like number of processed messages, start time, time of last error) • conformance
  • 31. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Signed syslog Messages Overview • adds detached, in-band signatures • provides origin authentication, message integrity, replay resistance, message sequencing, and detection of missing messages • Payload Blocks: contains public key, sent at session/message stream • Signature Blocks: signed message, contains hashes of last messages
  • 32. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Signed syslog Messages Signature Groups • Problem: Different message destinations ⇒ Signature Groups: group messages by message priorities • Signature Blocks for every Signature Group seperately • predefined modes: • only one global Signature Group • each PRI value has its own Signature Group • range of sequential PRI values per Signature Group • any other (custom) scheme
  • 33. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Signed syslog Messages Payload Blocks on startup: • Payload Block with • timestamp • key type (PKIX (X.509), OpenPGP, public key, predistributed, or other/installation-specific) • key blob (base64) • example: 2008 -05 -21 T13 : 4 7: 36 .00 3+ 02 00 C LW Q ga 2 V5 IG J s b 2 I K • keys may be large ⇒ Payload Block fragmented into multiple Certificate Blocks
  • 34. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Signed syslog Messages Certificate Blocks • Certificate Blocks with ssign-cert SDs: [ ssign - cert VER =" xxx " RSID =" xxx " SG =" xxx " SPRI =" xxx " TBPL =" xxx " INDEX =" xxx " FLEN =" xxx " FRAG =" xxx " SIGN =" xxx "] • Version (including hash and signature algorithm) • Reboot Session ID • Signature Group • Signature Priority • Total Payload Block Length • Index into Payload Block • Fragment Length • Payload Block Fragment (base64) • Signature (for this CB, base64)
  • 35. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Signed syslog Messages Certificate Blocks example: <110 >1 2008 -05 -21 T13 : 5 5 : 00 . 0 0 0 + 02 0 0 frodo . example . com - - - [ ssign - cert VER ="0111" RSID ="0" SG ="0" SPRI ="0" TBPL ="47" INDEX ="1" FLEN ="47" FRAG ="2008 -05 -21 T13 : 4 7 : 3 6. 0 0 3 + 0 20 0 C L W Q g a 2 V 5 I G J s b 2 I K " SIGN =" < signature >"]
  • 36. Introduction BSD Syslog IETF Protocols Still Missing Analysis Draft: Signed syslog Messages Signature Blocks • Signature Block with with ssign SDs: [ ssign VER =" xxx " RSID =" xxx " SG =" xxx " SPRI =" xxx " GBC =" xxx " FMN =" xxx " CNT =" xxx " HB =" xxx " SIGN =" xxx "] • Version (including hash and signature algorithm) • Reboot Session ID • Signature Group • Signature Priority • Global Block Counter • First Message Number • Count • Hash Blocks (base64) • Signature (for this SB, base64)
  • 37. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problem: TCP unreliable at reconnect • single TCP connection is reliable, but on close/reconnect a message is lost • Problem with TCP (and other SOCK_STREAM interfaces?): asynchronous send(). • even after server closes connection: successful send(), writing into local buffer • known problem, e.g. in syslog-ng
  • 38. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problem: TCP unreliable at reconnect possible solutions suggested solution: librelp: Reliable Event Logging Protocol • one more protocol layer • client sends messages with transaction numbers • server acknowledges every message
  • 39. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problem: TCP unreliable at reconnect possible solutions in LANs: • use SCTP in 1-to-1 modus • use struct tcp_info to check connection state getsockopt ( sock , IPPROTO_TCP , TCP_INFO , & tinfo , & tinfo_size ); • check recv() to receive possible status changes rc = recv ( sock , msgbuf , BUFSIZE , MSG_DONTWAIT | MSG_PEEK );
  • 40. Introduction BSD Syslog IETF Protocols Still Missing Analysis syslog-protocol vs. syslog-sign • Structured Data allows adding data in transport • without impairing later parsing/analysis • useful with relays or time synchronization problems • examples: <34 >1 1970 -01 -01 T00 :01:15.009 Z mymachine . example . com syslogd - - [ transport@0 relay1 =" logserver . example . com " timestamp1 ="2003 -10 -11 T18 : 5 4: 1 6 . 7 0 2 + 0 4 : 0 0 " ] restart <34 >1 2003 -10 -11 T14 : 00 : 00 . 00 0+ 0 4: 0 0 mymachine . example . com syslogd - - [ transport@0 relay1 =" logserver . example . com " timestamp1 ="2003 -10 -11 T18 : 2 0: 1 6 . 7 0 2 + 0 4 : 0 0 " ] restart • but: any change invalidates signature
  • 41. Introduction BSD Syslog IETF Protocols Still Missing Analysis Extended API for syslog-protocol • syslog(3) API cannot use all syslog-protocol fields • no MSGID field • no structured data • new API desirable • possible but incomplete approach: Apple’s asl(3) API: aslmsg m = asl_new ( ASL_TYPE_MSG ); asl_set (m , ASL_KEY_FACILITY , " com . secrets . r . us "); # allows arbitrary key = value pairs , but no namespaces : asl_set (m , " Clearance " , " Top Secret "); ... asl_log ( NULL , m , ASL_LEVEL_NOTICE , " Message One "); ... asl_log ( NULL , m , ASL_LEVEL_ERR , " Message Two ");
  • 42. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problem: syslog(3) and Local Sockets • unreliable (if buffer full) • whole message is controlled by the user/application • thus syslogd depends on user-supplied data • easy message injection: echo -n " <32 > Apr 1 03:14:15 mail sshd [1]: Accepted publickey for root from 192.168.23.42 port 1024 ssh2 " | socat -u stdin unix - sendto :/ var / run / log
  • 43. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problem: syslog(3) and Local Sockets possible solutions • device driver to append/inject trusted metadata (timestamp, uid, pid) • SCM_CREDENTIALS: • few systems support passing credentials over local sockets (kernel-verified) • setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); • different implementations and data structures
  • 44. Introduction BSD Syslog IETF Protocols Still Missing Analysis Problem: Policy for Reliable Syslog Scenario: network problem, logserver unreachable. Three alternatives: • throw away messages • enlarge the buffer (in memory or on disk) • blocking syslog(3) calls, i.e. stop processes What to do now?
  • 45. Introduction BSD Syslog IETF Protocols Still Missing Analysis Log File Analysis 99,9 % is unimportant Jul 9 09:37:58 localhost SystemStarter : Willkommen ! Jul 9 09:37:58 localhost lookupd [122]: lookupd ( version 324.2.1) starting - Fri Jul 9 09:37:58 2004 Jul 9 09:37:58 localhost ConsoleMessage : Starting Apple Multicast DNS Responder Jul 9 09:37:58 localhost ConsoleMessage : Starting kernel event agent Jul 9 09:37:58 localhost ConsoleMessage : Starting timed execution services Jul 9 09:37:58 localhost ConsoleMessage : Starting SecurityServer Jul 9 09:38:01 localhost SystemStarter : ? Apple Multicast DNS Responder ? wird gestartet Jul 9 09:38:02 localhost SystemStarter : ? Kernel Event Agent ? wird gestartet Jul 9 09:38:02 localhost SystemStarter : ? Timed Execution Services ? werden gestartet Jul 9 09:38:04 localhost kernel : A p p l e PM U U s e r C l i e nt :: setProperties Wak eOnACchange 0 Jul 9 09:38:06 localhost ConsoleMessage : Initializing network Jul 9 09:38:06 localhost mDNSResponder [155]: mDNSResponder -58.8 ( Apr 24 2004 20:38:40) starting Jul 9 09:38:06 localhost SystemStarter : Starting SecuritySe rver Jul 9 09:38:06 localhost SystemStarter : Netzwerkdienste werden initialisiert Jul 9 09:38:06 localhost ConsoleMessage : Checking disks Jul 9 09:38:06 localhost SystemStarter : Volumes werden ? berpr ? ft Jul 9 09:38:08 localhost kernel : ATY , Bee_A : vram [9 c000000 :02000000] Jul 9 09:38:08 localhost kernel : ATY , Bee_B : vram [ 9 8 0 0 0 0 0 0 : 0 2 0 0 0 0 0 0 ] Jul 9 09:38:08 localhost syslogd : / dev / console : Input / output error Jul 9 09:38:08 localhost init : kernel security level changed from 0 to 1 Jul 9 09:38:09 localhost D irec tory Serv ice [186]: Launched version 1.8 ( v256 .6) Jul 9 09:38:09 localhost loginwindow [182]: Sent launch request message to Di r e cto ry Se rv ic e mach_init port Jul 9 09:38:16 localhost SystemStarter : Warten auf ? Netzwerkd ien ste werden initialisiert ? Jul 9 09:38:22 localhost last message repeated 2 times Jul 9 09:38:23 localhost configd [87]: executing / System / Library / S y s t e m C o n f i g u r a t i o n / Kicker . bundle / Contents / Resources / set - hostname Jul 9 09:38:24 localhost set - hostname [195]: setting hostname to ivich . local Jul 9 09:38:25 localhost SystemStarter : Warten auf ? Netzwerkd ien ste werden initialisiert ? Jul 9 09:38:28 localhost ConsoleMessage : Loading Shared IP extension Jul 9 09:38:28 localhost SystemStarter : Shared - IP - Erweiterung wird geladen Jul 9 09:38:28 localhost / usr / libexec / crashreporterd : g e t _ e x c e p t i o n _ p o r t s () failed : ( ipc / send ) invalid destination port Jul 9 09:38:28 localhost ConsoleMessage : Starting Apple File Service Jul 9 09:38:28 localhost ConsoleMessage : Starting printing services Jul 9 09:38:29 localhost SystemStarter : ? Apple File Services ? werden gestartet Jul 9 09:38:29 localhost SystemStarter : Die Druckerdienste werden gestartet Jul 9 09:38:30 localhost ConsoleMessage : Loading IP Firewall extension Jul 9 09:38:30 localhost SystemStarter : IP - Firewall - Erweiterung wird geladen Jul 9 09:38:32 localhost kernel : IP packet filtering initialized , divert enabled , rule - based forwarding enabled , default to accept , logging disabled Jul 9 09:38:32 localhost kernel : IPv6 packet filtering initialized , default to accept , logging disabled Jul 9 09:38:32 localhost kernel : IP firewall loaded Jul 9 09:38:32 localhost ConsoleMessage : Starting internet services Jul 9 09:38:32 localhost SystemStarter : ? Internet Services ? werden gestartet Jul 9 09:38:32 localhost xinetd [257]: xinetd Version 2.3.11 started with libwrap options compiled in . Jul 9 09:38:32 localhost xinetd [257]: Started working : 3 available services Jul 9 09:38:33 localhost SystemStarter : Systemstart beendet . Jul 9 09:38:44 localhost d iska rbit rati ond [88]: disk1s2 hfs ED021A74 -9 EEF -3 AA5 -9 B54 -5 B703F7D0D71 ute [ not mounted ] Jul 9 09:38:45 localhost d iska rbit rati ond [88]: disk1s2 hfs ED021A74 -9 EEF -3 AA5 -9 B54 -5 B703F7D0D71 ute / Users / ute
  • 46. Introduction BSD Syslog IETF Protocols Still Missing Analysis Normalization • messages from different sources in diferent formats (Syslog, multilog, Windows Eventlog, SNMP traps, . . . ) • convert into common format • timestamp format • character set • data fields Example: Eventlog → Syslog 2008 -05 -06 T15 : 1 8 : 0 1 . 00 + 0 2 : 0 0 THESEUS NT : < NTSYSLOG ; I2 ; > Service ’ NTSYSLOG ’ wurde gestartet 2008 -05 -06 T15 : 1 7 : 5 8 . 00 + 0 2 : 0 0 THESEUS NT : < EventLog ; I6005 ; > Der E r e i g n i s p r o t o k o l l d i e n s t wurde gestartet .
  • 47. Introduction BSD Syslog IETF Protocols Still Missing Analysis grep • grep "important Msg" logdatei | less • grep -v "unimportant Msg1" logdatei | grep -v "unimportant Msg2" | grep -v "unimportant Msg3" | less • inefficient • only interactive
  • 48. Introduction BSD Syslog IETF Protocols Still Missing Analysis grep and Shell Tools cat logfile | egrep ’^.{15} .+ sshd [.+]: Invalid user .+ from .+ $ ’ | sed -e ’s /^.{16}// ’ -e ’s / sshd [.*]: / sshd : / ’ -e ’s / user .* from / user XY from / ’ | sort | uniq -c | sort - nr >> report Ergebnis: Summary : lines . l o g i n _ f a i l e d _ u s e r -------------------------------- 451 neo sshd : Invalid user XY from 210.75.23.122 451 mail sshd : Invalid user XY from 210.75.23.122 209 neo sshd : Invalid user XY from 60.191.41.89 12 neo sshd : Invalid user XY from 125 .1 52 .17 .2 36 12 mail sshd : Invalid user XY from 12 5. 15 2.1 7. 23 6
  • 49. Introduction BSD Syslog IETF Protocols Still Missing Analysis Artificial Ignorance • filter known good messages • leave new and unknown messages for inspection Steps: 1. take existing logs, strip timestamps & PIDs 2. list with sort | uniq -c 3. write regexps to filter known good messages 4. regularly review remaining messages 5. readjust filters
  • 50. Introduction BSD Syslog IETF Protocols Still Missing Analysis logcheck • uses lists of regexps to classify: • hacking • violations • ignore • everything else • sends report by e-mail • uses logtail to remember current position in logfile • can be called as often as necessary (hourly, dayly, weekly)
  • 51. Introduction BSD Syslog IETF Protocols Still Missing Analysis logwatch • similar to logcheck • calls Perl scripts for service-dependent summary • e.g. for amavisd: ****** Summary * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 Miscellaneous warnings ======== ================================================ 19664 Ham - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 95.36% 19630 Clean passed 95.19% 34 Bad header passed 0.16% 942 Spam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4.57% 514 Spam blocked 2.49% 428 Spam discarded ( no quarantine ) 2.08% 15 Malware - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.07% 15 Malware blocked 0.07% 20621 Total messages scanned - - - - - - - - - - - - - - - - 100.00% 662.993 M Total bytes scanned 695 ,198 ,092 ======== ================================================
  • 52. Introduction BSD Syslog IETF Protocols Still Missing Analysis service-specific summaries e. g. pflogsumm for Postfix Postfix log summaries for May 21 Grand Totals ------------ messages 7708 received 27350 delivered 3 forwarded 70 deferred (575 deferrals ) 240 bounced 48996 rejected (63%) 0 reject warnings 0 held 262 discarded (0%) 1024 m bytes received 4036 m bytes delivered 931 senders 520 sending hosts / domains 3621 recipients 506 recipient hosts / domains ...
  • 53. Introduction BSD Syslog IETF Protocols Still Missing Analysis Counting Events
  • 54. Introduction BSD Syslog IETF Protocols Still Missing Analysis real time monitoring advantages: • follow sequences and dependencies of related messages • stateful analysis (e.g. follow user session) • automatic reactions (notification or countermeasure) some programs: • special purpose: • Snort (network IDS) • Nagios (device/service monitoring) • fail2ban (ssh logins) • general purpose: • swatch • logsurfer • Simple Event Correlator
  • 55. Introduction BSD Syslog IETF Protocols Still Missing Analysis Swatch • matches lines against regexp • performs actions on match swatch.conf example: ignore / ntpd .*: kernel time sync enabled / watchfor /[ fF ] ailed password for (.*) from (.*) port (.*) $ / throttle threshold =3 , delay =0:1:0 , key = $2 exec "/ sbin / iptables -A s wa tch _r ej ect s -s $2 -j DROP "
  • 56. Introduction BSD Syslog IETF Protocols Still Missing Analysis Logsurfer/Logsurfer+ • matches lines against match-regex and not-match-regex • performs usual actions • feature: create/delete rules • collect multiple lines in a context • complex configuration with multiple levels of quoting rule format: match - regex not - match - regex stop - regex not - stop - regex timeout [ continue ] action
  • 57. Introduction BSD Syslog IETF Protocols Still Missing Analysis Logsurfer/Logsurfer+ advanced logsurfer.conf example: ’ on (/.*): file system full$ ’ ’/ root / mp3sammlung ’ - - 0 exec "/ usr / bin / find " " $1 - name *. mp3 - exec rm {} ;" ’ failed password for (.*) from (.*) port (.*) $ ’ - - - 0 pipe " report . sh notice " ’.* ’ - - - 0 echo >> lines . unknown $0
  • 58. Introduction BSD Syslog IETF Protocols Still Missing Analysis contexts ’ ftpd [[0 -9]+]: (? @ ([0 -9.]+)) [ INFO ] Neue Verbindung von 1. $ ’ - - - 0 open " ftpd [[0 -9]+]: (.* @$2 )" - 2000 720 20 ignore ’ ftpd [[0 -9]+]: (.* @ (.*)) [ ERROR ] ’ - - - 0 rule before " ftpd [[0 -9]+]: (.* @ ( $2 )) [ INFO ] Logout ." - - - 300 report "/ bin / cat " " ftpd [[0 -9]+]: (.* @$2 )" created context: ftpd [[0 -9]+]: (.* @192 .168.0.2) created rule: ftpd [[0 -9]+]: (.* @ (192.1 68.0.2)) [ INFO ] Logout . - - - 300 REPORT "/ bin / cat " " ftpd [[0 -9]+]: (.* @$2 )"
  • 59. Introduction BSD Syslog IETF Protocols Still Missing Analysis Simple Event Correlator • can count events and observe thresholds • dynamic creation/deletion of rules • create own events • arbitrary context names • execute custom Perl functions
  • 60. Introduction BSD Syslog IETF Protocols Still Missing Analysis Simple Event Correlator sec.conf example: type = S i n g l e W i t h 2 T h r e s h o l d s ptype = RegExp pattern = sshd .*: a ut hen ti ca tio n failure [ ;].* rhost =( S +) desc = Multiple failed ssh au th ent ic ati on attempts from $1 action = logonly ; shellcmd ( / usr / local / sbin / ipt - add [...] ) window =60 thresh =4 desc2 = Pruning iptables firewall rule blocking ssh from $1 action2 = logonly ; shellcmd ( / sbin / iptables [...] ) window2 =7200 thresh2 =0
  • 61. Introduction BSD Syslog IETF Protocols Still Missing Analysis note on automatic actions • possible notifications: SNMP-traps, e-mail, Jabber, SMS, . . . • must not cause new errors • countermeasures only in known environment • log messages are user input – always quote and filter in scripts sshd [164]: ... illegal user ‘ rm - rf * ‘
  • 62. Introduction BSD Syslog IETF Protocols Still Missing Analysis recommendations • use only few logfiles (not every facility seperate) • automate, filter, summarize • read only new or known bad messages yourself, but do read them • put analysis/summary in periodic daily • do not plan overly complex (classification is good, time-based thresholds are nice to have, dynamic rules and contexts are seldom necessary)
  • 63. Links Links: Information • NetBSD GSoC08 project: syslogd • IETF Syslog Working Group Status Page • LogAnalysis.org • Syslog-ng FAQ und Loghost HOWTO
  • 64. Links Links: Daemons • rsyslog • syslog-ng • stunnel
  • 65. Links Links: Analysis • logcheck • logwatch • Swatch • LoGS • SEC - simple event correlator • Logsurfer • Logsurfer+ • Artificial Ignorance: How-To Guide