Log Sources: OS, Identity, Network, Cloud and Application
An incident review asks "did the attacker copy the customer database?" and the answer is "we don't know, the database server didn't log queries and the firewall only kept 7 days". Detection and investigation can only use data that was collected before the question came up. Choosing log sources is therefore a security decision, made in advance, with a budget. This lesson maps the main source families to the questions they answer, reads three of them in a sandbox session, and gives a way to prioritise.
Five families of telemetry
| Family | Examples | Answers | Blind to |
|---|---|---|---|
| Operating system | Windows Security, System, PowerShell and Sysmon channels; Linux auth.log/journald, auditd; macOS unified log |
who logged on where, which process ran with which command line, privilege use, service and task creation | what happened inside an application, traffic contents |
| Identity | Active Directory / Kerberos events on DCs, the identity provider's sign-in and audit logs (OIDC/SAML), MFA logs, VPN authentication | which account authenticated, from where, with which factor; group and role changes | what the account did afterwards on hosts |
| Network | firewall allow/deny logs, IDS alerts (Suricata), Zeek conn/dns/http/ssl logs, proxy logs, DNS resolver logs, NetFlow |
who talked to whom, how much, which names were resolved, which URLs fetched | encrypted contents, host-local activity |
| Cloud and SaaS | control-plane audit logs (AWS CloudTrail, Azure Activity and Entra ID logs, Google Cloud Audit Logs), storage access logs, SaaS admin logs | who changed which resource or permission, API calls by which identity | workloads' own processes unless agents run there |
| Application | web server access logs, application audit logs (logins, exports, admin actions), database audit logs, mail gateway logs | business-level actions: who exported 10,000 customer records | anything the developers did not log |
EDR telemetry is OS-level data collected by a security agent, usually richer than built-in logs (process trees, module loads, memory-access events); it has its own lessons (EDR and XDR). The Windows event IDs that matter most are listed in The Key Event IDs and Sysmon; Linux service logs in Linux Services and Logs.
Three sources in one session
The session below (in your sandbox, on files it writes itself and on a bundled sample capture; no network) reads a synthetic auth.log from a Linux web server, which is an OS and identity source at once, and DNS answers that a network sensor would log, here taken from the sample capture dns.pcap.
cat > auth.log <<'LOG'
2026-01-15T10:00:02+00:00 web01 sshd[811]: Accepted publickey for deploy from 10.10.0.21 port 51022 ssh2: ED25519 SHA256:lab-only-key
2026-01-15T10:03:11+00:00 web01 sshd[815]: Failed password for invalid user oracle from 203.0.113.50 port 40110 ssh2
2026-01-15T10:03:12+00:00 web01 sshd[815]: Failed password for invalid user test from 203.0.113.50 port 40112 ssh2
2026-01-15T10:03:14+00:00 web01 sshd[817]: Failed password for root from 203.0.113.50 port 40114 ssh2
2026-01-15T10:03:15+00:00 web01 sshd[817]: Failed password for root from 203.0.113.50 port 40116 ssh2
2026-01-15T10:05:40+00:00 web01 sudo: deploy : TTY=pts/0 ; PWD=/srv/app ; USER=root ; COMMAND=/usr/bin/systemctl restart app
2026-01-15T10:07:09+00:00 web01 sshd[822]: Failed password for alice from 10.10.0.22 port 52200 ssh2
2026-01-15T10:07:15+00:00 web01 sshd[822]: Accepted password for alice from 10.10.0.22 port 52200 ssh2
LOG
echo "== failed SSH passwords by source and user"
grep 'Failed password' auth.log | sed -E 's/.*for (invalid user )?([^ ]+) from ([^ ]+).*/\3 \2/' | sort | uniq -c | sort -rn
echo "== successful logins"
awk '/Accepted/ {print $1, $2, $5, $7, "from", $9}' auth.log
echo "== privilege use"
grep -o 'sudo:.*' auth.log | sed -E 's/ +/ /g'
echo "== DNS from the network sensor (sample pcap)"
tshark -r $SAMPLES/pcap/dns.pcap -Y 'dns.flags.response == 1' -T fields -E separator=' ' \
-e frame.time_epoch -e ip.dst -e dns.qry.name -e dns.flags.rcode -e dns.a== failed SSH passwords by source and user
2 203.0.113.50 root
1 203.0.113.50 test
1 203.0.113.50 oracle
1 10.10.0.22 alice
== successful logins
2026-01-15T10:00:02+00:00 web01 publickey deploy from 10.10.0.21
2026-01-15T10:07:15+00:00 web01 password alice from 10.10.0.22
== privilege use
sudo: deploy : TTY=pts/0 ; PWD=/srv/app ; USER=root ; COMMAND=/usr/bin/systemctl restart app
== DNS from the network sensor (sample pcap)
1768471200.001200000 10.10.0.5 www.lab.test 0 10.10.0.10
1768471200.501100000 10.10.0.5 nope.lab.test 3
Each source answers a different question about the same morning:
- Failed passwords by source and user:
203.0.113.50triedoracle,testandrootwithin four seconds;invalid usermeans the accounts don't exist. That is an automated guesser, not a person who mistyped.10.10.0.22failed once foraliceand then succeeded: a typo. - Successful logins show the method:
deployuses a key,alicea password. A policy "keys only on servers" is violated by the second line, and the log is how you would know. - Privilege use:
sudorecords who became root to run what. This line is the bridge between an identity (deploy) and an action (restart the app). - DNS answers from the sensor:
www.lab.testresolved,nope.lab.testreturned rcode 3 (NXDOMAIN). Many NXDOMAINs from one host are a classic sign of malware trying generated domain names, and DNS logs often show a compromise before anything else does (DNS Beaconing).
Deciding what to collect
Collecting everything is unaffordable (Collecting, Shipping and Retaining Logs) and makes searches slow. A practical order:
- Identity first. DCs, the identity provider, VPN and MFA logs. Almost every intrusion uses accounts, and these logs are small.
- Endpoint process creation with command lines (Sysmon Event ID 1 or EDR, Windows 4688 with command-line auditing, Linux auditd
execve). The single richest source for detecting attacker behaviour. - DNS and proxy / egress firewall. Every command-and-control channel and most exfiltration cross them.
- Cloud control-plane audit logs. Usually cheap and decisive for cloud incidents.
- Critical applications' audit logs, chosen by asking "what would an attacker want here?".
Map each planned source to the ATT&CK techniques it lets you detect (ATT&CK lists data sources and data components for each technique) and to the detections that use it. A source no detection or investigation uses is a candidate to drop; a technique with no source is a gap to fill.
How logging gaps are detected
- Inventory versus reality. Compare the asset inventory with the hosts that actually sent logs in the last 24 hours. Every host without logs is either decommissioned, broken or a blind spot.
- Volume baselines per source. A DC that normally sends 3,000 events per minute and now sends 30 is a broken agent, a changed audit policy, or an attacker who cleared or stopped logging (Windows Event ID 1102 "audit log cleared", or the agent service stopping).
- Canary events. Generate a known harmless event on a schedule (a test login, a
loggermessage) and alert when it does not arrive.
How gaps are fixed or prevented
- Enable the audit settings the detections need (Windows advanced audit policy, see Event Log Channels and the Audit Policy; auditd rules, Sysmon and auditd Configuration Basics).
- Deploy collection as part of provisioning, so a new server cannot exist without an agent.
- Protect the logs: forward them off the host quickly, so an attacker with admin rights cannot erase the evidence before it leaves.
Pitfalls
- Logging without the fields that matter. Process creation without command lines, firewall logs without NAT translations, proxy logs without the user. Check a sample event before you call a source "collected".
- Trusting one family. Network logs miss host activity; host logs miss unmanaged devices. Detections built on two families survive the loss of one.
- Forgetting the application layer. The question that matters to the business ("was data stolen?") is often only answered by application and database audit logs.
Practice
1. Which source would show that a cloud storage bucket was made public, and which would show who downloaded from it afterwards?
The cloud control-plane audit log (for example CloudTrail management events) records the policy or ACL change and the identity that made it. Downloads are data-plane events: the storage service's access logs or data-event logging, which is often off by default and must be enabled in advance.
2. Extend the session's pipeline to count failures per source IP only and print sources with 3 or more.
grep 'Failed password' auth.log | sed -E 's/.* from ([^ ]+) .*/\1/' | sort | uniq -c | awk '$1 >= 3' prints 4 203.0.113.50.
3. A DC's event volume drops by 99 % at 02:00. Give three explanations and the first check for each.
Agent crash or upgrade (check the agent service state and its own logs); audit policy changed by GPO (check event 4719 and the GPO history); attacker cleared the log or stopped the service (check event 1102, service stop events, and EDR telemetry from the DC, which is a separate source).
Test yourself
Which family of logs answers 'which account authenticated from where, with which factor'?
- Application logs
- Identity logs (DCs, identity provider, VPN, MFA)
- NetFlow
- Web server access logs
In the session, what shows that 203.0.113.50 is an automated guesser rather than a person who mistyped?
- It used SSH keys
- Several different account names, two of them non-existent, within four seconds
- It succeeded at the end
- It ran sudo
What does DNS rcode 3 (NXDOMAIN) in many answers to one host often indicate?
- A healthy resolver
- Malware trying many generated domain names
- An expired TLS certificate
- A brute-force login
Which source is usually the single richest for detecting attacker behaviour on endpoints?
- Printer logs
- Process creation with command lines (Sysmon 1, EDR, 4688, auditd execve)
- Disk usage metrics
- Screen-saver events