CYBER SECURITY • SECURITY OPERATIONS AND MONITORING

Security Logging — Explain what logs are useful for security (auth, network, application) (conceptual)

Understanding how authentication, network, and application logs form the evidentiary backbone of modern security operations.

Historical Context & Motivation

Long before the term "cybersecurity" entered common parlance, system administrators recognized the value of recording what happens on their machines. The earliest Unix systems in the 1970s wrote simple text records of user logins and process events to flat files, primarily for debugging and capacity planning rather than for any security purpose. As networked computing expanded through the 1980s and 1990s, these humble records evolved into structured security logs — timestamped records of system events that analysts could review to detect unauthorized access, investigate incidents, and satisfy regulatory requirements. Today, security logging is not merely a best practice but a foundational requirement enshrined in frameworks such as NIST SP 800-92, PCI DSS, and HIPAA, reflecting the consensus that you cannot defend what you cannot observe.

1971
Unix utmp/wtmp Files
Early Unix systems introduce utmp and wtmp files to track user logins and system boot events, establishing the conceptual pattern of event recording that persists today.
1988
Morris Worm & Syslog Emergence
The Morris Worm compromises roughly 10% of the Internet-connected machines. In its aftermath, the BSD syslog protocol is widely adopted, allowing centralized log collection across hosts for the first time.
2001
Sarbanes-Oxley & Regulatory Mandates
Corporate scandals and new legislation mandate audit trails for financial systems, compelling organizations to retain and review logs systematically — compliance becomes a major driver for logging infrastructure.
2005
SIEM Platforms Emerge
Security Information and Event Management (SIEM) platforms aggregate logs from authentication, network, and application sources into a unified analytics engine, enabling correlation-based detection at enterprise scale.
2020s
Cloud-Native & ML-Driven Logging
Cloud-native architectures produce telemetry at massive scale. Machine learning models process billions of log events daily to detect anomalies, and structured logging formats like JSON and the OCSF standard drive interoperability.

This historical trajectory reveals a persistent question that security professionals still grapple with: which events, from which sources, should we capture to maximize our ability to detect, investigate, and respond to security incidents while keeping storage and processing costs manageable? Answering this question requires a principled understanding of the three primary log domains — authentication, network, and application — and the distinct security insights each provides.

Core Principles of Security Logging

Effective security logging rests on a set of foundational principles that determine what to record, how to protect it, and how to use it. These principles are technology-agnostic: whether you are instrumenting a Kubernetes cluster or a legacy mainframe, the same conceptual framework applies. Understanding these principles allows you to evaluate any logging architecture and identify gaps before an adversary exploits them.

1

Completeness

Every security-relevant event — successful or failed — must be captured. A log that records only successful logins misses brute-force attacks. Completeness ensures that analysts can reconstruct the full narrative of an incident.
2

Integrity

Logs must be tamper-evident or tamper-proof. Attackers routinely clear or modify logs to cover their tracks. Integrity is preserved through write-once storage, cryptographic hashing, or forwarding logs to a separate, hardened collector.
3

Timeliness

Logs lose defensive value if they arrive minutes or hours after the event. Near-real-time ingestion enables timeliness, which is essential for alerting and automated response playbooks.
4

Correlation Capability

Individual log entries are data points; combined, they become intelligence. Correlation across authentication, network, and application logs reveals attack chains that no single source can expose.
5

Retention & Compliance

Regulatory frameworks mandate minimum retention periods — often 90 days to 7 years. Proper retention policies balance legal requirements against storage costs through tiered archival strategies.
KEY TAKEAWAY
Think of security logs like the black box on an aircraft. A flight data recorder is useless if it only records altitude but not airspeed, or if the pilot can erase it mid-flight, or if investigators cannot access it until weeks after a crash. Similarly, security logs must be complete (capture all relevant channels), tamper-resistant (protected from the adversary), and timely (available when you need them). Without all three, the investigative record is incomplete.

The Three Pillars — A Visual Overview

Security-relevant logs can be broadly categorized into three pillars: authentication logs, network logs, and application logs. Each pillar answers a different set of questions about what happened in your environment. When these three data streams converge in a SIEM or log analytics platform, they produce a composite view that dramatically reduces the ambiguity an analyst faces during triage and investigation. The following diagram illustrates how each pillar feeds into a centralized collection point and the distinct security questions it addresses.

The three pillars — Authentication, Network, and Application — feed into a centralized SIEM platform where cross-domain correlation enables detection and fuels incident response.

Notice that each pillar captures a fundamentally different dimension of activity. Authentication logs answer who questions (identity, credentials, access level). Network logs answer where and how questions (source/destination addresses, protocols, volumes). Application logs answer what questions (business logic execution, data access, errors). An attacker who exfiltrates a database record will leave traces across all three domains: an authentication event when they log in, a network flow when the data leaves the perimeter, and an application audit entry when the query executes. Viewing any single pillar in isolation may reveal only an innocuous-looking event; only the composite picture exposes the adversarial intent.

How Security Logging Works — The Log Pipeline

Security logging is not a single technology but a pipeline composed of several stages: generation, collection, normalization, storage, analysis, and retention. Each stage introduces design decisions that affect the fidelity and utility of the logs downstream. Understanding this pipeline is essential because a failure at any stage — an application that does not emit sufficient detail, a collector that drops events under load, or a retention policy that deletes evidence too early — can render the entire investment in logging moot.

The Six-Stage Log Pipeline

The six-stage log pipeline from event generation through long-term retention. The normalized JSON entry below shows the key fields — timestamp, source_ip, event_type, user — that every security-relevant log should contain to support downstream correlation.

The normalization stage is particularly critical in heterogeneous environments. A firewall may label a denied connection as action=drop while an IDS records the same concept as result=blocked. Without parsing these into a common schema — such as the Open Cybersecurity Schema Framework (OCSF) or the Elastic Common Schema (ECS) — automated correlation rules will miss matches that a human analyst would immediately recognize. Normalization also involves enrichment: appending geolocation data to IP addresses, resolving hostnames, and mapping user identifiers to directory entries.

💡 Structured vs. Unstructured Logs
Many legacy applications emit unstructured, free-text log lines (e.g., Jan 15 03:22:17 server1 sshd[4512]: Failed password for jdoe from 10.0.4.88). Modern practice favors structured formats like JSON or key-value pairs because they eliminate brittle regex parsing and enable direct indexing. When instrumenting new applications, always prefer structured logging libraries such as Python's structlog or Java's SLF4J with JSON layouts.

Deep Dive — Authentication, Network & Application Logs

Authentication Logs

Authentication logs record every attempt to prove identity to a system, whether that system is an operating system, a web application, or a cloud identity provider. On Linux, the primary sources are /var/log/auth.log (Debian-family) or /var/log/secure (Red Hat-family), capturing PAM events, SSH sessions, and sudo invocations. Windows environments generate Security Event Log entries, with Event IDs 4624 (successful logon) and 4625 (failed logon) being among the most security-critical identifiers any Windows analyst should know. Cloud providers like AWS emit authentication records through CloudTrail's ConsoleLogin and AssumeRole events. These logs are invaluable for detecting brute-force attacks, credential stuffing, lateral movement via pass-the-hash, and unauthorized privilege escalation.

Network Logs

Network logs capture the movement of data across infrastructure boundaries. The most common sources include firewall logs (recording allow/deny decisions), NetFlow or IPFIX records (summarizing traffic flows by source, destination, port, and byte count), DNS query logs, web proxy access logs, and intrusion detection/prevention system (IDS/IPS) alerts. Network logs are especially powerful for identifying command-and-control (C2) beaconing, data exfiltration, lateral movement, and reconnaissance scanning. A DNS query log that shows a workstation resolving a domain generated by a domain generation algorithm (DGA) is often the earliest indicator of a malware infection — long before application logs reveal any anomaly. Similarly, NetFlow records can reveal low-and-slow data exfiltration that bypasses signature-based controls by analyzing volume and timing patterns.

Application Logs

Application logs are generated by software running on top of the operating system — web servers (Apache/Nginx access and error logs), databases (MySQL slow-query logs, PostgreSQL pg_audit logs), custom business applications, and middleware such as message queues and API gateways. These logs capture the semantics of user interaction with business logic: which records were queried, which files were downloaded, which API endpoints were called, and which errors occurred. From a security perspective, application logs are indispensable for detecting injection attacks (SQL injection payloads in query logs), authorization bypass (a user accessing resources outside their role), and business-logic abuse (such as exploiting a race condition in a payment workflow). Because application developers control what gets logged, the security value of application logs varies enormously — an application that logs only "request processed" provides virtually no forensic value, whereas one that logs the authenticated user, the requested resource, the input parameters, and the response code becomes a rich source of investigative data.

Comparison of the three log domains across five key dimensions
DimensionAuthentication LogsNetwork LogsApplication Logs
Primary QuestionWho authenticated and with what credentials?What traffic traversed the network?What did the software do with user requests?
Example SourcesPAM, Active Directory, LDAP, OAuth/OIDC IdP, CloudTrailFirewalls, IDS/IPS, NetFlow, DNS resolvers, VPN gatewaysWeb servers, databases, APIs, custom app frameworks
Key Security Use CasesBrute force detection, credential theft, privilege escalationC2 beaconing, exfiltration, lateral movement, scanningInjection attacks, authorization bypass, data theft
VolumeModerate — proportional to user baseVery high — every packet or flow generates recordsVariable — depends on instrumentation depth
Typical FormatSyslog, Windows Event XML, JSON (cloud)Syslog, CEF, IPFIX binary, PCAPVaries widely — custom text, JSON, CLF/ELF

Worked Example — Tracing an Intrusion Across Log Sources

Consider the following scenario: your organization's SOC receives an alert that a user account jdoe has been flagged for anomalous behavior. The alert was generated by a SIEM rule that detected the account accessing a sensitive database during off-hours. Walk through how an analyst would use each log type to reconstruct the attack chain.

Reconstructing a Credential-Theft Incident
1
Step 1 — Examine Authentication LogsThe analyst queries the SIEM for all authentication events associated with jdoe over the past 72 hours. The results reveal 47 failed SSH login attempts from IP 203.0.113.42 between 01:00 and 01:15, followed by a successful login at 01:16. This pattern is consistent with a brute-force attack that ultimately guessed the correct password.
Indicator: 47 failed logins → 1 success from external IP 203.0.113.42 at 01:16 UTC.
2
Step 2 — Correlate with Network LogsNext, the analyst pivots to firewall and NetFlow records for IP 203.0.113.42. The firewall logs confirm inbound connections to port 22 (SSH) starting at 01:00. After the successful login at 01:16, NetFlow records show an outbound connection from the compromised host to 198.51.100.9:443 — a known command-and-control server — with periodic 60-second beacon intervals and a total of 4.2 MB uploaded over 3 hours. DNS logs show the compromised host resolving c2.badactor.example at 01:17, one minute after the initial login.
Indicator: C2 beaconing to 198.51.100.9:443 every 60s; 4.2 MB exfiltrated; DGA-like domain resolved.
3
Step 3 — Inspect Application LogsFinally, the analyst examines the database audit logs (pg_audit). The records show that at 02:30, user jdoe executed SELECT * FROM customers WHERE 1=1 — a broad query retrieving all customer records. The web application's access log confirms an API call to /api/v2/export?format=csv at 02:31, resulting in a 3.8 MB response body. This correlates with the 4.2 MB NetFlow volume to the C2 server, accounting for protocol overhead.
Indicator: Full customer table exported via API; response size aligns with exfiltration volume.
4
Step 4 — Construct the Attack TimelineCombining the evidence from all three sources, the analyst constructs a coherent timeline: (1) brute-force credential compromise at 01:16, (2) malware deployment and C2 establishment at 01:17, (3) internal reconnaissance from 01:18 to 02:29, (4) bulk data exfiltration at 02:30–02:31. This multi-source correlation transforms ambiguous individual events into a conclusive incident narrative that supports containment and remediation actions.
Conclusion: Credential compromise → C2 → data exfiltration. No single log source alone would have revealed the full attack chain.

Strengths and Limitations of Each Log Type

No single log type provides a complete picture. Each pillar has inherent strengths and blind spots, and a mature security operations program explicitly maps these gaps and compensates through multi-source correlation. The table below summarizes the key trade-offs that influence logging architecture design.

Strengths and limitations across the three security log pillars
Log TypeStrengthsLimitations
AuthenticationDirectly ties activity to an identity; high signal-to-noise ratio for account-level threats; relatively low volume and easy to store.Cannot reveal what a user did after authenticating; useless if the attacker bypasses authentication entirely (e.g., exploiting an unauthenticated vulnerability); reliant on consistent identity labeling across systems.
NetworkCaptures all traffic regardless of endpoint configuration; hard for attackers to suppress since logs reside on infrastructure devices; excellent for detecting lateral movement and exfiltration.Encrypted payloads (TLS) hide content; extremely high volume creates storage and processing challenges; flow records lose granular detail compared to full packet captures.
ApplicationCaptures business-logic context that network and auth logs cannot provide; detects injection, authorization bypass, and business-logic abuse at the semantic level.Quality depends entirely on developer instrumentation; inconsistent formats across applications; high risk of logging sensitive data (PII, credentials) if not carefully designed.
KEY TAKEAWAY
Think of the three log types as overlapping surveillance cameras with different lenses. Authentication logs are like a camera at the building entrance — they show who badged in, but not what they did inside. Network logs are like motion sensors in the hallways — they track movement patterns between rooms, but cannot read the documents on the desks. Application logs are like cameras inside the vault — they capture exactly what was accessed, but only if someone installed and aimed them correctly. Full coverage requires all three, and the power of the system emerges from combining their perspectives.

Connection to Advanced Security Operations

The conceptual understanding of security logging presented in this lesson is the starting point for several advanced disciplines within security operations. As you progress, you will encounter technologies and methodologies that extend the raw capabilities of log collection into sophisticated detection and response frameworks. It is useful to understand where basic logging ends and these advanced topics begin.

From foundational logging to advanced security operations capabilities
Foundational ConceptAdvanced Extension
Centralized log collection (syslog, agents)SIEM correlation engines that apply detection rules, statistical baselines, and threat intelligence enrichment in real time.
Authentication event recordingUser and Entity Behavior Analytics (UEBA) that model per-user baselines and flag deviations such as impossible-travel logins or unusual privilege usage.
Network flow loggingNetwork Detection and Response (NDR) platforms that apply deep packet inspection, TLS fingerprinting (JA3/JA4), and machine learning to identify encrypted threats.
Application audit trailsRuntime Application Self-Protection (RASP) and distributed tracing frameworks (OpenTelemetry) that correlate security events across microservice boundaries.
Manual log review and alertingSecurity Orchestration, Automation, and Response (SOAR) platforms that automate playbook execution — e.g., automatically disabling an account when a brute-force threshold is met.

Importantly, all of these advanced technologies are only as effective as the log data they consume. A SIEM with incomplete authentication logs will produce blind spots. A UEBA model trained on poorly normalized data will generate excessive false positives. The conceptual foundations covered in this lesson — understanding which logs matter, what they contain, and how to preserve their integrity — remain the critical substrate upon which every advanced capability is built.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why recording only successful authentication events is insufficient for security monitoring. What types of attacks would go undetected, and which log entries would be missing?
PROBLEM 2BASIC CALCULATION
A mid-sized organization generates approximately 2,000 authentication events per hour, 50,000 network flow records per hour, and 8,000 application log entries per hour. If each log entry averages 500 bytes, calculate the total daily storage requirement in gigabytes. If the compliance mandate requires 180 days of retention, how much total storage must be provisioned?
PROBLEM 3INTERMEDIATE
A SIEM analyst observes the following events within a 5-minute window: (1) 12 failed SSH logins to a database server from IP 10.0.3.15, followed by (2) 1 successful SSH login from the same IP, then (3) a DNS query from the database server resolving 'update-service.xyz', a newly registered domain. Which log types contributed each observation? Describe what correlation rule you would write and what response action you would recommend.
PROBLEM 4APPLIED
You are the security lead for a startup deploying a three-tier web application (React frontend, Node.js API, PostgreSQL database) on AWS. Design a logging strategy that covers all three pillars. For each pillar, specify: (a) the exact log sources you would enable, (b) the collection mechanism, and (c) one detection use case each log source supports.
PROBLEM 5CRITICAL THINKING
A sophisticated attacker has gained root access to a Linux server and immediately clears /var/log/auth.log and /var/log/syslog. They also install a rootkit that suppresses future log writes to those files. Analyze what compensating controls and architectural decisions would have preserved the evidentiary record despite this tampering. Discuss at least three independent mechanisms and evaluate the trade-offs of each.

Lesson Summary

Security logging provides the evidentiary foundation for detection, investigation, and compliance in modern security operations. The three primary pillars — authentication logs (capturing identity verification events such as login successes, failures, MFA challenges, and privilege changes), network logs (recording traffic flows, firewall decisions, DNS resolutions, and IDS alerts), and application logs (capturing business-logic interactions, database queries, API calls, and runtime errors) — each answer fundamentally different questions about system activity. No single pillar is sufficient on its own; their power emerges through cross-domain correlation in platforms like SIEMs.

The core principles of completeness, integrity, timeliness, correlation capability, and retention compliance govern the design of any effective logging architecture. The six-stage log pipeline — generate, collect, normalize, store, analyze, retain — provides a systematic framework for evaluating and improving an organization's logging posture. These foundational concepts directly support advanced capabilities including UEBA, NDR, and SOAR — all of which depend on high-quality, well-structured log data as their fundamental input.

Varsity Tutors • Cyber Security • Security Logging — Explain what logs are useful for security (auth, network, application) (conceptual)