01 / 20

Endpoint
Logging

Understand how event logs and syslog capture activity on endpoints, giving defenders the visibility they need to detect and investigate threats.

Cyber Security

What Is Endpoint Logging?

Every action on a computer: a user signing in, a program starting, or a file being modified: generates a record. Endpoint logging is the practice of systematically capturing, storing, and organizing those records so security teams can trace what happened, when, and who was responsible.

Why Logging Matters

Detection
Identify suspicious behavior like unauthorized logins or malware execution in real time.
Investigation
Reconstruct the timeline of an incident to understand the attacker's actions step by step.
Compliance
Meet regulatory requirements (HIPAA, PCI-DSS, GDPR) that mandate audit trails and record-keeping.

Anatomy of a Log Entry

2024-03-15 09:42:17 | WARNING | User: jdoe | Failed login attempt | Source: 192.168.1.45 Timestamp When it happened Severity How critical the event is Source User or process Event What happened Context IP, device, extra detail Every log entry answers: Who? What? When? Where? How severe? These five fields form the foundation of useful, searchable logs.

Windows Event Logs

Windows stores logs in a structured binary format (.evtx) managed by the Event Log service. They are viewed through Event Viewer (eventvwr.msc) and can be queried programmatically with PowerShell or wevtutil.

Security
Logon events, privilege use, audit policy changes, object access
System
Driver failures, service start/stop, hardware errors, time changes
Application
Software crashes, database errors, custom app events

The Syslog Protocol

Syslog is a standard protocol (RFC 5424) used by Linux, macOS, network devices, and many applications to send log messages to a centralized server. Unlike Windows Event Logs, syslog messages are plain text and follow a universal format.

<34>1 2024-03-15T09:42:17Z webserver01 sshd 2847 - - Failed password for jdoe Priority Facility + Severity Timestamp ISO 8601 format Hostname Source device App Name Process that generated it Message Human-readable event detail Syslog Severity Levels (0-7) 0 Emerg 1 Alert 2 Crit 3 Error 4 Warn 5 Notice 6 Info 7 Debug

Event Logs vs Syslog

Windows Event Logs Syslog
Format Structured binary (.evtx) Plain text (RFC 5424)
Platform Windows only Linux, macOS, routers, firewalls
Viewer Event Viewer (GUI) / PowerShell Text editors, grep, log aggregators
Transport Local + WEF forwarding UDP 514, TCP 514, TLS 6514
Severity 5 levels (Critical to Info) 8 levels (Emergency to Debug)
Centralization Windows Event Forwarding (WEF) rsyslog, syslog-ng, SIEM

The Logging Pipeline

Generate OS / App creates log entry Collect Agent forwards to central store Normalize Parse into standard fields Store Index in SIEM or log server Analyze & Alert Correlation rules trigger alerts when suspicious patterns appear Respond & Investigate Analysts search logs to trace attack paths and remediate Retention: Logs must be stored for a defined period (30-365 days typical) based on policy and compliance needs.

Key Log Sources on an Endpoint

1
Operating System Logs: Authentication events, process creation, privilege escalation, service starts and stops
2
Application Logs: Web server access logs, database query logs, email server logs, custom app errors
3
Security Tool Logs: Antivirus detections, firewall blocks, EDR (Endpoint Detection & Response) telemetry
4
Audit Logs: File access records, registry changes, policy modifications: created by the OS audit subsystem

How to Set Up Effective Logging

1
Identify critical events: Determine which events matter most: logins, process creation, file access, network connections
2
Enable audit policies: On Windows, use Group Policy to enable advanced audit policies. On Linux, configure rsyslog or journald
3
Forward logs centrally: Ship logs to a SIEM (Splunk, Elastic, etc.) using agents or syslog forwarding
4
Set retention and rotation: Define how long logs are kept and configure automatic rotation to prevent disk exhaustion
5
Monitor and alert: Create correlation rules and dashboards so anomalies trigger real-time notifications

Example: Windows Security Log

Event ID: 4625 Log Name: Security Source: Microsoft-Windows-Security-Auditing Date: 2024-03-15 03:14:22 Keywords: Audit Failure Account: Administrator Logon Type: 10 (Remote) This is a failed remote login to the Administrator account: possible brute-force attempt.

Example: Syslog Entry Analysis

Mar 15 03:14:22 webserver01 sshd[2847]: Failed password for root from 203.0.113.50 port 22 Facility: auth SSH authentication Severity: Warning Failed login to root Source IP: External 203.0.113.50 Action: Investigate IP reputation, check for repeated attempts, consider blocking.

Example: Correlating Log Sources

03:14 AM Firewall Log: 50 connections from 203.0.113.50 to port 22 in 2 minutes 03:16 AM Syslog (sshd): Accepted password for root from 203.0.113.50 03:17 AM Syslog (sshd): New process /tmp/backdoor.sh spawned by root 03:18 AM EDR Alert: Suspicious script execution detected in /tmp/ directory Correlation reveals: brute-force → successful login → backdoor installed

Syslog Facility Codes

The facility code tells you which subsystem generated the message. Combined with severity, it forms the priority value in the syslog header (\( \text{Priority} = \text{Facility} \times 8 + \text{Severity} \)).

kern (0)
Kernel messages: hardware issues, driver events
auth (4)
Authentication: login attempts, sudo usage, PAM events
daemon (3)
System daemons: cron, dhcpd, ntpd services
local0-7
Custom use: assigned to specific apps by sysadmins

Common Mistakes

✕ Logging Everything
Capturing all events without filtering creates noise, fills disks, and makes finding real threats nearly impossible.
✕ No Centralization
Leaving logs only on local endpoints means an attacker can delete them to cover their tracks.
✕ Ignoring Timestamps
If endpoints lack synchronized clocks (NTP), correlating events across devices becomes unreliable.
✕ No Retention Policy
Without defined retention, logs may be overwritten before an investigation begins: or kept forever, wasting storage.
✕ Unencrypted Transport
Sending syslog over plain UDP (port 514) allows attackers to intercept or tamper with log data in transit.

Question 1 of 5

Which Windows Event ID indicates a successful logon?

Question 2 of 5

Syslog uses severity levels numbered 0 through 7. Which severity level represents the most critical condition?

Question 3 of 5

What is the primary reason to forward endpoint logs to a centralized server?

Question 4 of 5

A syslog message has the priority value <38>. If the facility for "auth" is 4, and the priority formula is \( \text{Facility} \times 8 + \text{Severity} \), what is the severity level?

Question 5 of 5

Which statement best describes what this correlated sequence of events indicates?