Security
Logging
Learn how authentication logs, network logs, and application logs work together to protect systems and detect threats.
What Are Security Logs?
A security log is a chronological record of events generated by systems, applications, and network devices. Every time a user logs in, a file is accessed, or a packet crosses a firewall, the event can be captured as a log entry.
Why Logging Matters
Anatomy of a Log Entry
The Three Core Log Types
Authentication Logs
Authentication logs record every identity-related event: successful logins, failed login attempts, account lockouts, password resets, privilege escalations, and logoffs. They are the first place to look when investigating unauthorized access.
Network Logs
Network logs capture data about traffic flowing through routers, switches, firewalls, and intrusion detection systems (IDS). They reveal who is talking to whom, what ports and protocols are in use, and whether traffic was allowed or blocked.
Application Logs
Application logs come from the software layer: web servers, databases, email servers, and custom applications. They capture user actions, errors, and transactions inside the application boundary.
Key Distinction: Three Log Types
| Authentication | Network | Application | |
|---|---|---|---|
| Focus | Identity | Traffic | Behavior |
| Answers | Who accessed? | Where did data go? | What did they do? |
| Sources | OS, AD, IAM | Firewall, IDS, router | Web/DB/email server |
| Example Event | Failed login ✕ 5 | Blocked port scan | SQL injection attempt |
| Detection | Brute force, insider | Lateral movement | Exploit, data theft |
How Logs Work Together
Setting Up Effective Logging
Example: Detecting a Brute Force Attack
Example: Tracing Lateral Movement
Example: Web Application Attack
Common Mistakes
Summary Comparison
| Aspect | Auth Logs | Network Logs | App Logs |
|---|---|---|---|
| Layer | Identity | Transport | Application |
| Key Data | User, result, IP | Src/dst IP, port, protocol | URL, query, status |
| Detects | Brute force, insider | Scanning, C2, exfil | Injection, abuse |
| Source | OS, AD, SSO | Firewall, IDS, router | Web/DB/mail server |
| When to Check | Unauthorized access | Unusual traffic | App errors/exploits |
Question 1 of 5
A security analyst sees 50 failed login attempts for the same account within 2 minutes. Which log type primarily captured this activity?
Question 2 of 5
Which of the following would best be detected using network logs?
Question 3 of 5
What is the primary purpose of a SIEM in security logging?
Question 4 of 5
An attacker has compromised a workstation and is using RDP to access a database server. Which combination of logs would best reveal the full attack path?
Question 5 of 5
A web server log shows the request: GET /search?q=' OR '1'='1. What type of attack does this entry most likely indicate?