1/82
Looks like no tags are added yet.
Operating system logs
Generated by the OS itself and record things like user logins, privilege escalations, service starts and stops, and system errors
Windows Event ID 4624
Successful login
Windows Event ID 4625
Failed login
Windows Event ID 4648
Explicit credential use
/var/log/auth.log
log authentication events
/var/log/syslog
Records syslog/system events
Tracking Windows authentication events
Start with OS authentication logs, filter for Event ID 4625 then followed closely by 4624 from the same source
network logs
Come form firewalls, routers, switches, proxies, and IPS. Track allowed and denied connections, traffic flows, and protocol usage
Cloud environment equivalents of network logs
AWS VPC Flow Logs, Azure NSG Flow Logs
Application logs
Generate access logs and error logs, databases log queries, and custom applications log transactions
Syslog level 0
Emergency
Syslog level 1
Alert
Syslog level 2
Critical
Syslog level 3
Error
Syslog level 4
Warning
Syslog level 5
Notice
Syslog Level 6
Informational
Syslog Level 7
Debug
Running debug logging can cause
severe performance issues and overwhelming storage consumption
Only dial up to Debug during..
active incident investigation on isolated systems
Structured Logging
Refers to writing log entries in a consistent, machine-readable format, most commonly JSON
SIEM and log analysis tools parse
structured logs much more efficiently than unstructured plain text
log ingestion
Process of collecting log data from sources across the environment and getting it into a centralized system for storage and analysis
Agent-based collection
installation of a lightweight software agent on the source system
Reads local log files, parses them, forwards then to the SIEM or log aggregator
Agent-based collectors
Splunk Universal Forwarder, Elastic Beats, Microsoft Monitoring Agent
Downside of agent-based collection
Operaitonal overhead. You must deploy, manage, and update agents.
Agentless collection
Logs are pulled from source systems without installing anything on them
Windows Management Instrumentation (WMI)
Used to pull Windows event logs remotely
Syslog is agent-based or agentless
Agentless
SNMP Traps
Agentless; used for network device monitoring
Tradeoff using Agentless Collection
Less granular control and potential reliability gaps is the network between the source and collector is unreliable
Missing time windows in firewall events can indicate
A syslog UDP can indicate a Syslog UDP delivery failure; Syslog over UDP provides no delivery gurantee
Gaps in firewall logs during an incident can appear suspicious but may be caused by
a transport issue
Modern devices do not use traditional agentless collection, they use
APIs for data retrieval
AWS CloudTrail stores
Activity logs in S3
How are logs pulled
through the AWS API
Azure Monitor and Azure Activity Logs
Accessible through the Azure REST API
Log collection Google Cloud Operations Suite works..
the same way as Azure Monitor and Azure Activity Logs
Most modern SIEM platforms have ____ for cloud APIs
Native connectors
Native connectors examples
Microsoft Sentinel (Native connectors for Azure services), Splunk (Add-ons for AWS and GCP), Chronicle (Purpose-built for cloud log ingestion at massive scale)
Log aggregator/log forwarder
Buffers, normalizes, and batches the data before sending it upstream to the SIEM; agents on endpoints send logs to a local aggregator
Log aggregators give a resilient..
collection point even if the SIEM is down
Log aggregators examples
Logstash, Fluentd, Vector
Log Colleciton Chain
Is the agent running on the source?
Is the syslog forwarder configured correctly?
Is the aggregator healthy?
Is the SIEM connector active?
Log normalization
Process of transforming those different formats into a common, consistent schema
Log configuration
Is about making sure the sources are capturing the right events at the right level of detail
Widnows by default does not log
process creation
Windows has a granular audit policy system that
controls exactly which event categories get logged to the Security event log
Windows event categories that need to be enabled for logging
Logon and logoff events
Account management
Privilege use
Object access for sensitive files and registry keys
Policy Change
Process Creation
Detailed File Share
Process Creation Auditing
Also called Audit Process Creation under the Detailed Tracking category
When enabled, Windows logs Event ID 4688 for every process that starts, including the full command line
Capturing the command line in 4688 Events catches
LOLBin Abuse, PowerShell attacks, Malicious scripts
Linux primary logging daemon (legacy)
rsyslog
Linux primary logging daemon (modern replacement)
journald
On Linux, you want to make sure you’re capturing authentication events from
auth.log, sudo usage, cron job execution, kernel messages, any application-specific logs
auditd
Beyond basic Syslog configuration, this should be configured as part of the Linux audit Framework,. it allows specific audit rules to log file access system calls and user activity at a very granular level
Network logging needs to see
What connections were established, where they went, and how much data moved. Both allowed and denied traffic need to be logged
Network logging tradeoff is
log volume. Log aggregation architecture and SIEM configuration become important
Web application logs should log
Status codes, Source IP addresses, User agents, and response sizes
For databases, you want ___ logging enabled
query logging, at least for privilege operations and access to sensitive tables
AD Events that should be logged
Authentication events, Group policy changes, account modifications
Filtering at the source means
Excluding known-good, repetitive events before they ever hit the ingestion pipeline
The line between filtering noise and filtering evidence is not always
clear; bad actors know certain actions blend into routine traffic. Good configuration strategies filter aggressively on truly benign events
The most important thing to do to protect log integrity is
getting logs off source system quickly into a separate, secured environment
During a Windows incident, check the System event log for
Event ID 1102; means the audit log was cleared. Event ID 1102 near the time of a suspected attack is a major indicator of attacker cleanup activity
Write-once/Immutable storage
Once a log entry is written, it cannot be modified or deleted. Common in compliance-heavy industries like healthcare and finance
Cloud Write-once Storage examples
AWS S3 Object Log, Azure Immutable Blob Storage
Log file hashing
Checks the integrity of a log file by generating the hash of the original log file, then when looking at the log again, comparing the hash and seeing if the file was modified.
MITRE ATT&CK T1070
Indicator Removal; includes sub techniques used for clearing event logs
Windows Security log permissions
Event log should only be readable by administrators and log collection agent
Linux log permissions
Log files in /var/log should have appropriate file permissions so regular users cannot modify or delete them
SIEM Log permissions
Role-based access control determines who can view, modify, or delete log data
The solution to protecting log data in transit
Syslog over TLS, sometimes implemented in syslog-ng; the syslog traffic is encrypted so it cannot be read and requires authentication from both sides, preventing interception and injection.
Both Splunk Universal Forwarder and Elastic Beats support this
run w32tm /query /status
checks NTP sync status and offset on a Windows machine
Some SIEM platforms solve the issue of attackers modifying NTP or time drift occurring by…
applying a recent timestamp at the point of ingestion separate from the source timestamp
Cloud services often log in what time zone?
UTC
Best practice for time zones
Log events in UTC and let the SIEM handle local time zone
Mitigation for NTP Amplification and Time Manipulation Attacks
Disable the NTP monolith command and restrict NTP responses to known clients
NTPv4 and Precision Time Protocol (PTP)
Support cryptographic authentication to ensure systems are syncing from legitimate time sources and not from an attacker-controlled NTP server
timedatectl status
checks NTP sync status and offset on a Linux machine
Log retention
Defining how long different types of log data are kept before they are archived or deleted
Retention policy is about finding…
the right balance between long enough to be useful and not so long that storage costs unsustainable
PCI DSS Log Retention requirement
Requires audit log retention for at least 12 months, with three months of logs immediately available for analysis