Skip to content

Runbook 01 — Linux Incident Investigation

A security alert tells you:

Something May Be Wrong

It does not automatically tell you:

What Happened
Who Did It
How It Happened
How Far It Spread
Whether It Is Still Active

That is the purpose of incident investigation.

This runbook provides a repeatable workflow for investigating suspicious activity on an authorized Linux system.

Runbook: Linux Incident Investigation
Level: Intermediate → Advanced
Primary Role: SOC Analyst / Incident Responder
Supporting Roles: Linux Security Engineer, Cloud Security Engineer, DFIR Analyst, Security Consultant
Environment: Authorized Linux systems
Objective: Determine what happened, establish scope and impact, preserve useful evidence, and support safe containment and remediation decisions.

Your SOC receives an alert:

Suspicious Outbound Connection
Detected from Linux Server

The affected host supports an important business application.

Initial monitoring shows:

Unexpected External IP
+
Unusual Process Activity
+
Recent Administrative Login

You are assigned to investigate.

Your job is not simply to:

Block the IP

or:

Kill the Process

Your job is to answer:

What Happened?
When Did It Start?
Which Identity Was Involved?
Which Process Was Responsible?
How Was It Started?
Did It Establish Persistence?
Which Systems Were Affected?
Is the Activity Still Active?
What Should We Contain?
What Evidence Must Be Preserved?

Use:

ALERT
VALIDATE
PRESERVE
TRIAGE
INVESTIGATE
CORRELATE
SCOPE
CONTAIN
REMEDIATE
RECOVER
DOCUMENT

During an investigation:

Evidence
>
Assumption

Never conclude:

Unfamiliar Process
=
Malware

Instead:

Observe
Collect
Correlate
Validate
Conclude

When suspicious activity is discovered, avoid immediately:

Rebooting
Deleting Files
Killing Processes
Clearing Logs
Removing Users
Changing Every Configuration
Reinstalling the Server

unless your approved incident-response procedure requires immediate containment.

These actions may destroy:

Running Process Evidence
Active Connections
Process Relationships
Memory-Resident Information
Temporary Files
Useful Timestamps

Think about evidence volatility.

A useful high-level order is:

Current Time
Logged-In Users
Running Processes
Network Connections
Open / Runtime Information
Services
Filesystem Metadata
Logs
Persistent Configuration

Exact evidence-collection order should follow organizational DFIR procedures.

Start with the alert itself.

Document:

Alert Name:
Alert Time:
Detection Source:
Hostname:
IP Address:
User:
Process:
Destination:
Severity:
Alert Identifier:

Ask:

What triggered the alert?
Which system generated it?
Which asset is affected?
How critical is the asset?
Which identity is involved?
Is activity still occurring?
Is the alert based on one event or many?
Are other systems generating similar alerts?

Phase 02 — Confirm Scope and Authorization

Section titled “Phase 02 — Confirm Scope and Authorization”

Before interacting with the system, confirm:

Host Is In Scope
Investigation Is Authorized
Permitted Actions Are Known
Evidence Requirements Are Known
Escalation Contacts Are Known

On production Linux servers, some actions may affect:

Availability
Application Performance
Evidence Integrity
Customer Services

Use approved procedures.

Create an investigation directory in your authorized environment:

Terminal window
mkdir -p ~/linux-incident-investigation/{system,identity,process,network,services,logs,persistence,files,timeline,reports}

Move into it:

Terminal window
cd ~/linux-incident-investigation

Create:

Incident ID:
Analyst:
Start Time:
Affected Host:
Business Owner:
Detection Source:
Initial Alert:
Current Status:

Maintain a record of:

What You Did
When You Did It
Why You Did It
What You Observed

Capture:

Terminal window
date

Then:

Terminal window
date -u

Review:

Terminal window
timedatectl

Save where appropriate:

Terminal window
timedatectl > system/time-status.txt

You may later correlate:

Linux Logs
SIEM
Firewall
Cloud Logs
Identity Provider
Application Logs

Time consistency is essential.

Collect:

Terminal window
hostname
Terminal window
hostnamectl
Terminal window
cat /etc/os-release
Terminal window
uname -a

Record:

Hostname
Distribution
OS Version
Kernel
Architecture
Virtual / Physical / Cloud Context

Determine:

What Does This Server Do?
Who Owns It?
Is It Production?
What Data Does It Process?
Is It Internet-Facing?
What Is Its Criticality?

Technical severity and business severity may differ.

Run:

Terminal window
uptime

Record:

Current Time
Uptime
Load

Unexpected recent reboot may be relevant.

But:

Recent Reboot

does not automatically mean:

Attacker Rebooted Server

Correlate with:

Maintenance
Patching
Administrator Activity
Cloud Events

Run:

Terminal window
whoami

Then:

Terminal window
id

Document the identity under which evidence is being collected.

This supports:

Accountability
Evidence Interpretation
Audit Trail

Run:

Terminal window
who

Then:

Terminal window
w

Review:

Username
Terminal
Login Source
Login Time
Current Activity
Are These Users Expected?
Are Sources Expected?
Is a Privileged User Logged In?
Does Login Time Match the Alert?
Is an Unknown Session Active?

Run where appropriate:

Terminal window
last

Review:

Username
Source
Login Time
Session Duration
Reboot Events

You may discover:

01:55 Failed Login
02:01 Failed Login
02:06 Successful Login
02:08 sudo Activity
02:11 New Process
02:14 External Connection

The relationship between events is often more important than any single event.

Phase 10 — Review Authentication Failures

Section titled “Phase 10 — Review Authentication Failures”

Relevant evidence may exist in:

systemd Journal
/var/log/auth.log
/var/log/secure

depending on distribution.

Search for patterns rather than blindly copying entire sensitive logs.

Which Account Was Targeted?
Which Source Generated Failures?
How Many Failures?
Was There a Later Success?
Was the Account Privileged?
Was the Source Expected?
Repeated Authentication Failures
Successful Authentication
Privilege Escalation
New Process

This warrants deeper investigation.

Investigate:

sudo
su
Administrative Sessions
UID 0 Activity

Your objective:

WHO
Gained Which Privilege
WHEN
Performed What Action
Was Privilege Expected?
Was It Approved?
Was It Used by the Logged-In User?
Did It Occur Immediately Before Suspicious Activity?

Collect an account inventory:

Terminal window
getent passwd

Identify UID 0 identities:

Terminal window
awk -F: '$3 == 0 {print $1 ":" $3 ":" $7}' /etc/passwd
Unexpected User
Recently Created User
Unexpected UID 0
Unexpected Login Shell
Unexpected Service Account
Changed Group Membership

An unfamiliar account may belong to:

Application
Monitoring Agent
Backup Software
Automation
Vendor Product

Validate before classifying.

Review:

Terminal window
getent group

Pay attention to administrative or security-sensitive groups appropriate to the distribution.

Compare:

Expected Membership

against:

Actual Membership
Unexpected Privileged Group Membership

may indicate:

Misconfiguration
Privilege Creep
Unauthorized Change
Potential Persistence

Run:

Terminal window
ps aux

Then:

Terminal window
ps -ef

Capture:

Terminal window
ps -ef > process/process-list.txt

For suspicious processes determine:

PID
PPID
User
Start Time
Command
Executable
Parent
Network Activity

Run:

Terminal window
ps aux --sort=-%cpu | head -20

Then:

Terminal window
ps aux --sort=-%mem | head -20

High CPU or memory may indicate:

Normal Workload
Application Failure
Runaway Process
Unexpected Software

It is a lead, not a verdict.

Suppose the alert identifies:

PID 1234

Use:

Terminal window
ps -fp 1234

Then:

Terminal window
ps -o pid,ppid,user,lstart,cmd -p 1234
PID
USER
PPID
PARENT
EXECUTABLE
START TIME
NETWORK

For an authorized running process:

Terminal window
readlink -f /proc/1234/exe

Review command-line information:

Terminal window
tr '\0' ' ' < /proc/1234/cmdline

Be careful when collecting process data because arguments may contain:

Passwords
Tokens
Secrets
API Keys

Minimize sensitive evidence.

If:

Suspicious PID = 1234

and:

PPID = 900

investigate:

Terminal window
ps -fp 900

Suppose:

sshd
shell
unexpected process

This provides different context than:

systemd
approved service

Process ancestry helps reconstruct execution.

Where available:

Terminal window
pstree -p

Look for relationships such as:

sshd
└── shell
└── process

or:

systemd
└── service
└── worker

Linux may continue running a process even after its executable file has been deleted.

Where authorized, investigate process executable links and open-file evidence.

A deleted executable associated with an active process deserves attention but is not automatically malicious.

Legitimate software upgrades can also produce this condition.

Where available:

Terminal window
sudo lsof -p 1234

This may show:

Executable
Libraries
Configuration
Files
Network Sockets

Treat output carefully because it may expose sensitive file paths or data relationships.

Run:

Terminal window
ip -brief address

Then:

Terminal window
ip route

Document:

Interfaces
Addresses
Routes
Default Gateway

This establishes the network context for the incident.

Run:

Terminal window
sudo ss -lntup

Look for:

Unexpected Ports
Unexpected Bind Addresses
Unknown Processes
Administrative Services
Recently Introduced Services
PORT
PROCESS
PID
USER
EXECUTABLE
SERVICE
BUSINESS REQUIREMENT

Run:

Terminal window
sudo ss -ntp

Review:

Local Address
Local Port
Remote Address
Remote Port
State
PID
Process
Is the Destination Expected?
Does the Process Normally Communicate There?
Does the Port Match the Application?
When Did Communication Begin?
Are Other Hosts Contacting the Same Destination?

Phase 25 — Correlate Process and Network

Section titled “Phase 25 — Correlate Process and Network”

Suppose you identify:

External IP
Connection
PID 1234
Process X
User alice

Now ask:

How Did Alice Authenticate?
How Did Process X Start?
What Is Its Parent?
What Files Did It Access?
Does It Persist?

This is how investigation expands from an alert into an incident story.

Where relevant, investigate:

Destination Hostname
DNS Queries
Resolver Configuration
Application Logs
Central DNS Logs

Do not rely exclusively on current DNS resolution because mappings can change.

Historical DNS telemetry may provide stronger incident context.

Determine the host firewall technology.

Examples:

Terminal window
sudo firewall-cmd --list-all

or:

Terminal window
sudo ufw status verbose

or:

Terminal window
sudo nft list ruleset
Was Suspicious Traffic Allowed?
Should It Have Been Allowed?
Were Firewall Rules Changed?
Is Administrative Access Overly Broad?

Run:

Terminal window
systemctl --type=service --state=running

Review:

Known Services
Unknown Services
Recently Introduced Services
Privileged Services

Run:

Terminal window
systemctl list-unit-files --type=service --state=enabled

An unexpected enabled service can be significant because it may:

Restart Automatically
After Reboot

Phase 30 — Investigate Suspicious Service

Section titled “Phase 30 — Investigate Suspicious Service”

For an authorized service:

Terminal window
systemctl status <service>

Then:

Terminal window
systemctl cat <service>

Review:

Executable
User
Arguments
Dependencies
Restart Behavior
Environment
Configuration

Do not expose secrets contained in environment or configuration data.

Review common Linux mechanisms that can cause execution to continue across sessions or reboots.

Think:

SYSTEMD
SCHEDULED TASKS
SSH KEYS
ACCOUNTS
SHELL STARTUP
APPLICATION STARTUP

These mechanisms are used extensively by legitimate software.

Your question is:

Is This Mechanism Expected?

For your authorized account:

Terminal window
crontab -l

Review appropriate system scheduling locations.

For another authorized account:

Terminal window
sudo crontab -u <user> -l
Which User?
Which Command?
Which Script?
Who Owns the Script?
Can It Be Modified by Others?
When Was It Added?
Is It Expected?

Run:

Terminal window
systemctl list-timers --all

Investigate unexpected timers.

A timer may launch:

Maintenance
Backups
Updates
Monitoring
Custom Scripts

or unauthorized execution.

For authorized accounts, review:

~/.ssh/authorized_keys

Focus on:

Unknown Key
Recently Added Key
Privileged Account Key
Shared Key
Key Without Owner

Never collect private keys into routine incident notes.

Phase 35 — Review Shell Startup Configuration

Section titled “Phase 35 — Review Shell Startup Configuration”

Potential user startup files include:

.profile
.bash_profile
.bashrc

depending on the shell and distribution.

Investigate:

Unexpected Commands
External Connections
Unexpected Executables
Recent Changes

Potential locations include:

/etc/systemd/system/
/usr/lib/systemd/system/
/lib/systemd/system/

depending on the distribution.

Pay particular attention to:

Custom Units
Recent Changes
Unexpected Executables
Unexpected Users

Review relevant metadata in:

/tmp
/var/tmp

Look for:

Unexpected Executables
Recent Files
Unexpected Ownership
Files Related to Suspicious Processes

Do not delete potential evidence during collection.

For targeted locations, review recent modification times.

Example:

Terminal window
find /etc -type f -mtime -2 -print 2>/dev/null

Also consider:

Application Directories
User Home
Service Configuration
Scheduled Tasks

Timestamp interpretation requires care.

Timestamps can be affected by:

Normal Administration
Package Updates
Deployment
File Copying
Backup/Restore
System Behavior

For a suspicious file:

Terminal window
stat <file>

Record:

Path
Owner
Group
Permissions
Size
Timestamps

Prefer:

Metadata First

before modifying the file.

For an authorized suspicious file:

Terminal window
sha256sum <file>

Record:

SHA-256
File Path
Collection Time

A hash helps identify:

Which Exact File
Was Examined

and can support:

Integrity Verification
Threat Intelligence Correlation
Case Tracking

A hash alone does not determine whether a file is malicious.

If the suspicious file appears to belong to installed software, determine whether the package manager recognizes it.

On RPM-based systems, package-management queries can help.

On Debian-based systems, package-management queries can help.

Your objective:

File
Package?
Approved Software?
Expected Version?

Check package-management history using the facilities available on your distribution.

Questions:

Was Software Installed Recently?
Who Installed It?
Was It Approved?
Does the Time Match the Incident?
Did Installation Create a Service?

Relevant sources may include:

System Journal
Authentication Logs
Application Logs
Web Logs
Firewall Logs
Audit Logs
Package Logs
Cloud Logs

Do not search randomly.

Start from:

Known Alert Time

Then expand:

Before Alert
During Alert
After Alert

Review recent events:

Terminal window
journalctl --since "1 hour ago"

Or use an approved incident-specific time range.

For a service:

Terminal window
journalctl -u <service>
Known Timestamp
Known User
Known Process
Known Service
Related Events

Where relevant:

Terminal window
journalctl -k

Kernel evidence may include:

Device Events
Network Events
Security Control Messages
Resource Problems

On SELinux systems:

Terminal window
getenforce

Review relevant security denials using approved platform tools.

Security denials can help identify:

Unexpected Application Behavior
Incorrect Context
Blocked Unauthorized Activity

Do not automatically disable SELinux.

On AppArmor-based systems, review:

Profile Status
Relevant Denials
Affected Application

Mandatory access-control evidence may help explain what an application attempted to do.

If Linux auditing is configured:

Terminal window
systemctl status auditd

Where authorized:

Terminal window
sudo auditctl -l

Audit data may help answer:

Who Changed a File?
Who Changed an Account?
Which Process Performed an Action?
Which Security-Relevant Event Occurred?

Create:

timeline/incident-timeline.md

Use a structure such as:

Time Event User Process Source Evidence
01:55 Login failures alice sshd External IP Auth
02:06 Login success alice sshd External IP Auth
02:08 sudo used alice sudo Local Auth
02:11 Process started root process Local Process
02:14 External connection root process External IP Network

A useful incident timeline is:

Evidence-Based
Chronological
Source-Referenced
Timezone-Aware

Do not analyze events in isolation.

Example:

Login
+
sudo
+
New File
+
New Service
+
Outbound Connection
Potential Incident Chain
Did the Same User Perform the Actions?
Did Events Occur Close Together?
Does the Parent Process Match the Login?
Did the New Service Execute the File?
Did the File Initiate the Connection?

Examples:

Hypothesis A:
Legitimate Administrator Activity
Hypothesis B:
Application Deployment
Hypothesis C:
Compromised User Account
Hypothesis D:
Unauthorized Software Execution

Then test each hypothesis against evidence.

Do not search only for evidence supporting your first theory.

Also ask:

What Evidence Would Disprove
My Hypothesis?

Where evidence permits, determine how suspicious activity began.

Possible categories include:

Valid Credentials
Vulnerable Service
Application Weakness
Misconfiguration
Exposed Administrative Access
Software Supply Chain
Existing Internal Access

Do not claim an initial-access mechanism without supporting evidence.

Phase 53 — Determine Privilege Escalation

Section titled “Phase 53 — Determine Privilege Escalation”

Ask:

Did Activity Remain Under
the Original Account?

or:

Did It Gain Additional Privilege?

Review:

sudo
su
UID Changes
Privileged Services
Account Changes
Security Logs

Ask:

Would Access Survive
Logout or Reboot?

Review:

New Users
SSH Keys
Services
Timers
Cron
Startup Files
Application Startup

Ask whether the affected Linux host communicated with other internal systems.

Review:

SSH Activity
Application Connections
Internal Destinations
Authentication Logs
Network Telemetry
Cloud Flow Logs
Is This:
One Host
or
Multiple Hosts?

This distinction can radically change incident severity.

Phase 56 — Determine External Communication

Section titled “Phase 56 — Determine External Communication”

Review:

External IPs
Domains
Ports
Processes
Connection Frequency
Transferred Data Where Observable

Ask:

Expected Vendor?
Package Repository?
Monitoring Platform?
Backup Provider?
Unknown Destination?

Where relevant, assess:

Which Files Were Accessed?
Which Databases?
Which Credentials?
Which Application Data?
Which Secrets?

Do not claim:

Data Exfiltration

simply because an outbound connection exists.

Distinguish:

Possible Access
Observed Access
Confirmed Transfer

Evaluate:

CONFIDENTIALITY
INTEGRITY
AVAILABILITY

Questions:

Was Sensitive Data Accessed?
Was Configuration Modified?
Was Service Availability Affected?
Were Credentials Exposed?
Was Persistence Established?

Build a scope table:

Asset Evidence Status Priority
Linux Server A Confirmed activity Affected High
Linux Server B Same indicator Investigate High
Database Connection observed Validate High
Admin Account Suspicious login Investigate High

Search across:

SIEM
EDR
Firewall
Identity Logs
Cloud Logs
DNS
Proxy
Other Linux Hosts

for confirmed indicators.

Use categories such as:

Confirmed
Probable
Possible
Unknown

Example:

Confirmed:
Process contacted external IP.
Probable:
Process was started from suspicious session.
Possible:
Credentials may have been exposed.
Unknown:
Whether sensitive data left the environment.

This prevents overstatement.

Phase 61 — Decide Whether Containment Is Required

Section titled “Phase 61 — Decide Whether Containment Is Required”

Containment depends on:

Incident Severity
Business Impact
Active Threat
Evidence Requirements
System Criticality
Available Redundancy

Depending on organizational procedures:

Restrict Network Access
Disable Compromised Identity
Block Confirmed Malicious Destination
Stop Malicious Service
Isolate Host
Revoke Credentials
Remove Temporary Access

Containment actions can:

Disrupt Business
Alert an Adversary
Destroy Volatile Evidence
Change the Incident State

Coordinate with the incident-response lead.

Phase 62 — Short-Term vs Long-Term Containment

Section titled “Phase 62 — Short-Term vs Long-Term Containment”
Stop Immediate Threat

Examples:

Isolate Host
Disable Account
Block Confirmed Indicator
Restore Controlled Operations

Examples:

Network Segmentation
Credential Rotation
Security Policy Changes
Temporary Hardened Replacement

If credentials are confirmed or reasonably suspected to be compromised, follow approved identity-response procedures.

Consider:

Password
SSH Keys
API Tokens
Cloud Credentials
Application Secrets
Service Credentials

Do not focus only on the Linux password.

If the affected host is a cloud VM, expand the investigation.

Review:

CloudTrail
EC2 Metadata/Role Context
Security Groups
VPC Flow Logs
IAM Activity
Snapshots
CloudWatch

Review:

Azure Activity Logs
Entra Sign-In Logs
NSGs
Network Logs
Managed Identity
Defender Telemetry

Review:

Cloud Audit Logs
IAM
VPC Flow Logs
Firewall Logs
Service Accounts
Security Command Center
CLOUD CONTROL PLANE
+
LINUX OPERATING SYSTEM
=
COMPLETE INVESTIGATION

Phase 65 — Containerized Linux Workloads

Section titled “Phase 65 — Containerized Linux Workloads”

If containers are involved, expand to:

Container
Image
Runtime
Host
Registry
Orchestrator

Ask:

Was the Process Inside a Container?
Which Image?
Which User?
Which Mounts?
Which Network?
Did Activity Reach the Host?

For Kubernetes workloads:

Alert
Pod
Container
Node
Service Account
Kubernetes Audit
Cloud IAM

Do not investigate only the Linux node if orchestration evidence is available.

After containment and evidence collection, remove confirmed incident artifacts according to the approved plan.

This may include:

Unauthorized Account
Unauthorized SSH Key
Malicious File
Malicious Service
Scheduled Persistence
Compromised Package
Unsafe Configuration

Do not confuse:

Delete Artifact

with:

Remove Root Cause

If the original access path remains open, the incident can recur.

Ask:

Why Was This Possible?

Examples:

Exposed SSH
Compromised Credentials
Excessive sudo
Missing Patch
Weak Application Configuration
Poor Network Segmentation
Unmanaged SSH Key
Missing MFA Upstream
Overly Broad Cloud IAM
Suspicious Process
=
Symptom
Compromised Credential
=
Potential Cause

Remediation should address both.

Recovery may include:

Restore Service
Rebuild Host
Restore Clean Data
Apply Patches
Rotate Credentials
Restore Security Controls
Validate Configuration
Increase Monitoring

For serious compromise, organizations may prefer:

Known-Good Rebuild

over:

Attempt to Clean
Unknown Compromise

The decision depends on evidence, severity, system architecture, and organizational policy.

Before returning the system to normal operation, verify:

Unauthorized Access Removed
Credentials Rotated
Persistence Removed
Security Controls Active
Required Services Healthy
Network Exposure Correct
Logging Working
Monitoring Active

After recovery, temporarily increase monitoring for:

Repeated Indicators
Authentication Attempts
New Processes
Unexpected Services
Outbound Connections
Configuration Changes

Recovery does not end the investigation immediately.

Document confirmed indicators such as:

IP Addresses
Domains
File Hashes
File Paths
Process Names
Usernames
Service Names

Clearly label whether each indicator is:

Confirmed Malicious
Suspicious
Contextual
Benign

Use:

Finding Title
Observation
Evidence
Risk
Impact
Recommendation
Priority
Status

Finding Example — Suspicious Account Activity

Section titled “Finding Example — Suspicious Account Activity”
Finding:
Suspicious Administrative Authentication
Observation:
An administrative account successfully
authenticated from a source not associated
with normal administrative activity.
Evidence:
Authentication logs and centralized
security telemetry correlate the login
with subsequent privileged activity.
Risk:
Unauthorized use of administrative
credentials could permit system-level
changes and access to sensitive resources.
Recommendation:
Validate account ownership, revoke active
sessions where appropriate, rotate affected
credentials, review privilege assignments,
and investigate related activity.

Finding Example — Unauthorized Persistence

Section titled “Finding Example — Unauthorized Persistence”
Finding:
Unauthorized Persistent Service
Observation:
A previously undocumented systemd service
was configured to start automatically and
execute an unapproved binary.
Risk:
The service could provide continued
execution after reboot and maintain
unauthorized access.
Recommendation:
Preserve required evidence, identify the
installation source and related activity,
remove the service through the approved
incident process, and address the original
access mechanism.
Finding:
Insufficient Linux Security Telemetry
Observation:
Authentication and process activity could
not be fully reconstructed because required
security events were not centrally retained.
Risk:
Limited telemetry reduces detection,
investigation, and incident reconstruction
capabilities.
Recommendation:
Implement centralized security logging,
appropriate audit controls, time
synchronization, retention, and monitoring.

Your report should contain:

Explain:

What Happened
Affected Assets
Business Impact
Current Status

Document:

Detection Source
Alert
Timestamp
Initial Indicator

Document:

Affected Hosts
Affected Accounts
Affected Applications
Affected Data

Describe:

Authentication
Privilege
Processes
Network
Files
Persistence
Logs

Provide the evidence-based chronology.

Document relevant:

IPs
Domains
Hashes
Accounts
Processes
Services

Assess:

Confidentiality
Integrity
Availability

Document:

Action
Time
Owner
Reason
Result

Document what was removed or corrected.

Document restoration and validation.

State only what the evidence supports.

Prioritize:

Immediate
Short-Term
Long-Term
Incident ID:
Timezone:
--------------------------------------------------
Time:
Event:
User:
Host:
Process:
Source:
Evidence:
Analyst Notes:
--------------------------------------------------

Use:

Timestamp
Action Performed
Command / Tool
Observation
Evidence Location
Interpretation
Next Step

Separate:

Observation

from:

Interpretation

Example:

Observation:
TCP connection exists from PID 1234
to external address.
Interpretation:
Connection is not present in documented
application baseline and requires further
investigation.

For formal investigations, evidence handling may require:

Evidence Identifier
Collector
Collection Time
Source
Hash
Storage Location
Transfers
Access History

Follow organizational and legal requirements.

Escalate when evidence indicates or strongly suggests:

Root-Level Compromise
Credential Theft
Multiple Hosts
Sensitive Data Exposure
Active External Communication
Persistence
Production Impact
Regulated Data
Cloud Control-Plane Compromise

Incident communication should be:

Accurate
Evidence-Based
Timely
Need-to-Know
Free of Unsupported Conclusions

Avoid statements like:

"The attacker stole all data."

when the evidence only shows:

"An unauthorized process established
an outbound connection."

Severity should consider:

Asset Criticality
Privilege Level
Scope
Data Sensitivity
Persistence
External Communication
Business Impact
Active Threat

If investigation determines activity is legitimate:

Document Evidence
Identify Business Process
Close Incident
Tune Detection if Appropriate

Do not simply write:

False Positive

without evidence.

After closure ask:

Why Did Detection Work?
What Detection Was Missing?
Was Evidence Sufficient?
Was Containment Fast Enough?
Were Contacts Clear?
Was the Asset Baseline Accurate?
Could the Incident Have Been Prevented?

Lessons may lead to improvements in:

Linux Hardening
IAM
SSH
Patching
Firewall
Segmentation
Logging
Audit
EDR
SIEM
Cloud IAM
Monitoring

Turn investigation knowledge into detection opportunities.

Examples:

New UID 0 Account
Unexpected sudo Change
New SSH Key
New Enabled Service
Unexpected External Connection
New Listening Port
Security Control Disabled

The goal is:

Incident
Knowledge
Detection Improvement
ALERT RECEIVED
|
v
VALID?
| |
NO YES
| |
Close v
COLLECT CONTEXT
|
v
ACTIVE THREAT?
| |
NO YES
| |
| Evaluate
| Containment
| |
+---+---+
|
v
INVESTIGATE
|
v
BUILD TIMELINE
|
v
DETERMINE SCOPE
|
v
ROOT CAUSE
|
v
REMEDIATE
|
v
RECOVER
|
v
VALIDATE
|
v
REPORT
  • Record date/time
  • Record timezone
  • Identify hostname
  • Identify OS
  • Identify kernel
  • Review uptime
  • Identify current user
  • Review logged-in users
  • Review login history
  • Review failed authentication
  • Review privileged activity
  • Review UID 0
  • Review privileged groups
  • Capture process list
  • Identify suspicious PID
  • Identify user
  • Identify PPID
  • Identify executable
  • Review process tree
  • Review relevant open resources
  • Review interfaces
  • Review routes
  • Review listeners
  • Review active connections
  • Correlate connections with PIDs
  • Review firewall
  • Review running services
  • Review enabled services
  • Investigate unknown services
  • Review service configuration
  • Review cron
  • Review systemd timers
  • Review enabled services
  • Review SSH keys
  • Review user startup configuration
  • Review relevant systemd units
  • Identify suspicious files
  • Record metadata
  • Calculate hash
  • Review ownership
  • Review permissions
  • Review relevant recent changes
  • Review authentication
  • Review system journal
  • Review service logs
  • Review security-control events
  • Review audit evidence
  • Correlate timestamps
  • Determine affected users
  • Determine affected hosts
  • Determine affected applications
  • Determine external destinations
  • Determine potential data impact
  • Search confirmed indicators
  • Determine containment requirement
  • Preserve required evidence
  • Coordinate containment
  • Remove root cause
  • Recover
  • Validate
  • Monitor
  • Report

Avoid:

Rebooting Too Early
Killing Processes Before Collection
Deleting Suspicious Files Immediately
Clearing Logs
Assuming Unfamiliar = Malicious
Ignoring Process Parents
Ignoring Outbound Connections
Ignoring SSH Keys
Ignoring Service Accounts
Ignoring Scheduled Tasks
Ignoring Cloud Evidence
Ignoring Timezone Differences
Focusing Only on One Indicator
Stopping After Containment
Confusing Symptom with Root Cause
Overstating Data Loss
Failing to Document Actions

Memorize:

USER
PROCESS
PARENT
FILE
SERVICE
NETWORK
PERSISTENCE
LOGS
TIMELINE

Every Linux incident should eventually answer:

WHO?
WHAT?
WHEN?
WHERE?
HOW?
WHY?
HOW FAR?
WHAT IMPACT?
WHAT REMAINS?

A SOC alert reports an unexpected outbound connection from a Linux server. What do you investigate first?

Start by validating:

Host
Connection
PID
Process
User

Then expand into:

Parent
Executable
Authentication
Persistence
Timeline

You identify a suspicious process. Should you kill it immediately?

Not automatically.

First consider:

Active Risk
Evidence Preservation
Process Information
Connections
Parent Process
Incident Procedure

Immediate containment may still be necessary for a high-risk active incident.

Why is PPID useful?

Because it helps identify:

How the Process
Was Started

and supports reconstruction of execution relationships.

Why review SSH authorized keys?

Because unauthorized keys may provide:

Persistent Remote Access

even after a password is changed.

Why isn’t an outbound connection proof of data exfiltration?

Because it proves communication occurred, not necessarily:

Which Data
How Much Data
Whether Sensitive Data
Was Transferred

Additional evidence is required.

40 Linux Incident Response Interview Questions

Section titled “40 Linux Incident Response Interview Questions”
  1. What is Linux incident triage?
  2. What should you record when an alert arrives?
  3. Why is system time important?
  4. Why is evidence volatility important?
  5. Why should you avoid rebooting immediately?
  6. How do you identify logged-in users?
  7. How do you review login history?
  8. How would you investigate authentication failures?
  9. How do you identify UID 0 accounts?
  10. Why should privileged groups be reviewed?
  11. How do you capture running processes?
  12. Why is PPID important?
  13. How do you identify a process executable?
  14. What can /proc tell you?
  15. Why should process arguments be handled carefully?
  16. How do you identify listening ports?
  17. How do you map connections to processes?
  18. How do you investigate an unexpected external connection?
  19. Why review the host firewall?
  20. How do you identify running services?
  21. Why review enabled services?
  22. What Linux mechanisms can provide persistence?
  23. Why review cron?
  24. Why review systemd timers?
  25. Why review SSH authorized keys?
  26. Why review startup files?
  27. Why are file timestamps useful?
  28. Why calculate file hashes?
  29. What is event correlation?
  30. What is an incident timeline?
  31. How do you determine initial access?
  32. How do you investigate privilege escalation?
  33. How do you determine incident scope?
  34. What is containment?
  35. What is eradication?
  36. What is recovery?
  37. What is root cause?
  38. Why should cloud logs be reviewed for cloud Linux incidents?
  39. What should an incident report contain?
  40. What are the most common Linux incident-investigation mistakes?

The investigation is not complete merely because:

Alert Stopped

You should be able to explain:

What Happened
Which Assets Were Affected
Which Accounts Were Involved
Which Processes Were Involved
Which Connections Occurred
Whether Persistence Existed
How Access Was Obtained Where Known
What Impact Occurred
What Was Contained
What Was Remediated
How Recovery Was Validated

A successful Linux investigation produces:

Validated Alert
Preserved Evidence
Identity Analysis
Process Analysis
Network Analysis
Persistence Analysis
Event Timeline
Incident Scope
Impact Assessment
Containment Decision
Root-Cause Analysis
Recovery Validation
Incident Report
DETECT
VALIDATE
PRESERVE
IDENTIFY
TRIAGE
INVESTIGATE
CORRELATE
TIMELINE
SCOPE
CONTAIN
ERADICATE
RECOVER
VALIDATE
MONITOR
REPORT
IMPROVE

You now have a repeatable procedure for investigating suspicious activity on Linux systems.

The key transition is from:

"I Found Something Suspicious"

to:

I Can Explain:
What Happened
When It Happened
Which Identity Was Involved
Which Process Was Involved
How It Communicated
Whether It Persisted
How Far It Spread
What Evidence Supports the Conclusion
What Response Is Required

This is the difference between simply operating security tools and performing professional incident investigation.

➡️ Runbook 02 — Linux Security Assessment

In the next runbook, you will move from:

Reactive Investigation

to:

Proactive Security Assessment

You will build a repeatable procedure for assessing:

Asset Context
System Configuration
Identity and Access
Privileged Access
Authentication
Filesystem Security
Services
Network Exposure
Patching
Security Controls
Logging and Monitoring
Persistence Risk
Backup and Recovery
Findings
Risk Prioritization
Remediation Roadmap

Your Linux operational-security sequence is:

Runbook 01 — Linux Incident Investigation
Runbook 02 — Linux Security Assessment
Runbook 03 — Linux Server Hardening