Audit Linux privileges now to limit compromise, escalation, and system-wide damage. Review Linux Privileges×
An administrator reports unusual outbound traffic from a Linux server after firewall logs show repeated connections to an unfamiliar external IP address. Nothing obvious appears in the authentication logs, the web server is running normally, and no high-severity endpoint alerts have fired.
The question is not whether one unusual event occurred. It is whether seemingly unrelated events across several log sources describe the same incident.
For small teams without an enterprise SIEM or dedicated security operations center, answering that question requires a structured investigation. This playbook explains how to connect authentication activity, privilege changes, persistence, process execution, and network traffic without allowing individual commands to replace investigative judgment.
Individual log entries rarely reveal the full story. Failed SSH logins, sudo activity, new user creation, scheduled tasks, and outbound connections may all appear routine when reviewed separately. Chained together, they can describe an active compromise.
Linux administrators need this broader view because the first visible symptom may not appear in the log source closest to the original intrusion. A network anomaly might lead back to an earlier SSH login, privilege escalation, or unauthorized service change.
Security analysts face a related problem. Without a structured way to connect events, triage becomes a sequence of disconnected searches. False positives consume time, while meaningful activity remains buried in normal administrative noise.
For CIOs and IT directors, weak log correlation means longer detection times, slower investigations, incomplete compliance evidence, and greater uncertainty when deciding whether an incident affects business operations. Improving correlation reduces those risks without immediately requiring a large SIEM investment.
Attackers benefit from using the same utilities administrators use every day. A failed SSH login can look like a mistyped password. A cron entry can resemble routine maintenance. A curl process may appear to be part of an update script.
Native administrative tools such as sudo, cron, systemctl, and curl often produce activity that blends into the environment. Basic alerts may identify each event, but they do not necessarily reveal that the events belong to the same sequence.
Delayed detection gives an attacker more time to establish recurring access, inspect additional systems, steal credentials, or transfer data. The longer those actions remain disconnected, the more difficult and expensive the response becomes.
Before searching through logs, confirm that the evidence can support a reliable timeline.
These checks prevent the team from building conclusions around incomplete timestamps, missing records, or expected administrative behavior.
The commands below illustrate the investigation process. The objective is not to run every command mechanically. Each step should answer a specific question about what occurred.
Begin by narrowing the review to the period surrounding the original alert.
journalctl --since "2 hours ago"
The goal is to create a manageable chronological window and identify service failures, user sessions, process activity, or configuration changes that occurred near the suspicious connection.
Review successful and failed authentication events.
journalctl -u ssh
On systems that store authentication events in traditional log files:
grep "Accepted" /var/log/auth.log
Determine:
![]()
A successful login is often more important than the failures that came before it.
Check whether the authenticated account elevated privileges shortly after entering the system.
grep sudo /var/log/auth.log
Determine whether the user ran expected administrative commands or moved immediately into a root shell. Compare the activity with the account’s normal duties and the maintenance schedule.
Review scheduled tasks and enabled services for changes that follow the suspicious login.
crontab -l
systemctl list-unit-files --state=enabled
Look for:
![]()
cron entriessystemd servicesThe presence of a cron job or enabled service does not prove malicious activity. Its timing, owner, command, and relationship to other events determine its significance.
Examine current process activity and parent-child relationships.
ps aux
pstree
Look for processes that:
/tmp, /var/tmp, or other unusual locationscron jobs or systemd unitsCurrent process output provides only a snapshot. Use it alongside audit records, service logs, shell history, or process accounting where available.
Review listening services and active connections.
ss -tulpn
Relevant service events may also appear in the journal:
journalctl -u NetworkManager
Investigate:
The aim is to connect the original firewall alert to a local user, process, service, or persistence mechanism.
Small security teams should prioritize combinations of events that become more significant when they occur close together.
|
Activity to Monitor |
Why It Matters |
|
Repeated authentication failures followed by a successful login |
May indicate brute force, password spraying, or credential guessing |
|
Successful logins outside normal working patterns |
May indicate use of compromised credentials |
|
|
May reveal rapid privilege escalation |
|
New |
May provide recurring attacker access |
|
Processes launched from temporary directories |
May indicate unauthorized scripts or payloads |
|
New outbound connections after a process or service change |
May indicate command-and-control traffic or data transfer |
|
Similar activity across several hosts |
May indicate lateral movement or shared credential abuse |
The security team should alert on these relationships where possible, rather than treating each event as an independent warning.
Once the timeline is assembled, evaluate the strength and scope of the evidence.
Consider:
Use the findings to choose the next action.
|
Finding |
Action |
|
Normal administrative activity |
Document the evidence and close the review |
|
Suspicious but inconclusive activity |
Increase monitoring and examine related systems |
|
Confirmed compromise |
Begin formal incident response procedures |
|
Active attacker or continuing malicious traffic |
Isolate the host as quickly as operationally possible |
When the evidence supports a compromise, respond methodically.
Copy relevant logs before rotation overwrites them. Capture volatile information such as active processes, network connections, logged-in users, and mounted filesystems where appropriate.
Avoid rebooting the system as an automatic first step. A reboot may remove volatile evidence and stop processes that could help explain the intrusion.
Identify whether the activity is limited to one host or appears elsewhere. Review adjacent servers, shared accounts, SSH keys, administrative workstations, cloud identities, and systems communicating with the same external destination.
Disconnect or restrict the system to stop ongoing command-and-control traffic, data transfer, or lateral movement. Coordinate containment with the system owner when isolation could interrupt critical services.
Rotate passwords, SSH keys, API tokens, service credentials, and other secrets connected to the affected accounts or host. Do not assume changing one password removes every access path.
Give leadership a factual account of:
Log correlation establishes what likely happened. Full incident response must then address eradication, recovery, validation, and lessons learned.
Improvements should address the specific failures exposed by the investigation.
rsyslog, syslog-ng, Loki, or Graylog. Off-host storage helps preserve evidence when an attacker deletes or modifies local records.auditd or another suitable monitoring mechanism to track changes to cron directories, systemd unit files, user accounts, SSH configuration, and other high-value locations.cron schedules, expected services, and typical outbound destinations. A useful baseline allows the team to distinguish an anomaly from ordinary system behavior more quickly.Automate high-value correlations first. Begin with event sequences such as:
Cron changes followed by shell or download activityAutomation should encode a sound investigation method, not replace one.
No. Native Linux logging tools and lightweight centralized logging platforms can support effective investigations in smaller environments. A SIEM becomes more valuable as log volume, infrastructure size, compliance requirements, and correlation complexity increase.
Start with the evidence that produced the alert. For suspicious remote access, authentication logs may come first. For unexplained outbound traffic, begin with the firewall or network evidence and work backward to the responsible process, service, and user.
There is no universal first log. The initial symptom should determine the starting point.
Retention should reflect regulatory obligations, available storage, incident response maturity, and the organization’s normal detection delay. Keeping only a few days of logs often makes historical investigations impossible. Thirty to 90 days may be a useful operational starting point for some organizations, but it should not be treated as a universal requirement.
journalctl Replace Traditional Syslog?Not necessarily. The systemd journal provides structured local records, while tools such as rsyslog and syslog-ng can route, filter, and forward logs to other systems. Many environments use them together.
Yes. Shell scripts, scheduled queries, detection rules, and lightweight monitoring platforms can identify repeated event sequences. Automation is most effective after the team defines which combinations of events indicate meaningful risk in its environment.