Runbook 01 — Linux Incident Investigation
A security alert tells you:
Something May Be WrongIt does not automatically tell you:
What Happened
Who Did It
How It Happened
How Far It Spread
Whether It Is Still ActiveThat is the purpose of incident investigation.
This runbook provides a repeatable workflow for investigating suspicious activity on an authorized Linux system.
Runbook Information
Section titled “Runbook Information”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.
Mission Scenario
Section titled “Mission Scenario”Your SOC receives an alert:
Suspicious Outbound ConnectionDetected from Linux ServerThe affected host supports an important business application.
Initial monitoring shows:
Unexpected External IP +Unusual Process Activity +Recent Administrative LoginYou are assigned to investigate.
Your job is not simply to:
Block the IPor:
Kill the ProcessYour 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?Incident Investigation Philosophy
Section titled “Incident Investigation Philosophy”Use:
ALERT ↓VALIDATE ↓PRESERVE ↓TRIAGE ↓INVESTIGATE ↓CORRELATE ↓SCOPE ↓CONTAIN ↓REMEDIATE ↓RECOVER ↓DOCUMENTCore Principle
Section titled “Core Principle”During an investigation:
Evidence >AssumptionNever conclude:
Unfamiliar Process=MalwareInstead:
Observe ↓Collect ↓Correlate ↓Validate ↓ConcludeGolden Rule — Do Not Destroy Evidence
Section titled “Golden Rule — Do Not Destroy Evidence”When suspicious activity is discovered, avoid immediately:
Rebooting
Deleting Files
Killing Processes
Clearing Logs
Removing Users
Changing Every Configuration
Reinstalling the Serverunless 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 TimestampsInvestigation Priorities
Section titled “Investigation Priorities”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 ConfigurationExact evidence-collection order should follow organizational DFIR procedures.
Phase 01 — Receive the Alert
Section titled “Phase 01 — Receive the Alert”Start with the alert itself.
Document:
Alert Name:
Alert Time:
Detection Source:
Hostname:
IP Address:
User:
Process:
Destination:
Severity:
Alert Identifier:Initial Questions
Section titled “Initial Questions”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 KnownProduction Safety
Section titled “Production Safety”On production Linux servers, some actions may affect:
Availability
Application Performance
Evidence Integrity
Customer ServicesUse approved procedures.
Phase 03 — Start the Incident Record
Section titled “Phase 03 — Start the Incident Record”Create an investigation directory in your authorized environment:
mkdir -p ~/linux-incident-investigation/{system,identity,process,network,services,logs,persistence,files,timeline,reports}Move into it:
cd ~/linux-incident-investigationIncident Notes
Section titled “Incident Notes”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 ObservedPhase 04 — Record System Time
Section titled “Phase 04 — Record System Time”Capture:
dateThen:
date -uReview:
timedatectlSave where appropriate:
timedatectl > system/time-status.txtWhy This Matters
Section titled “Why This Matters”You may later correlate:
Linux Logs
SIEM
Firewall
Cloud Logs
Identity Provider
Application LogsTime consistency is essential.
Phase 05 — Identify the Host
Section titled “Phase 05 — Identify the Host”Collect:
hostnamehostnamectlcat /etc/os-releaseuname -aRecord:
Hostname
Distribution
OS Version
Kernel
Architecture
Virtual / Physical / Cloud ContextAsset Context
Section titled “Asset 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.
Phase 06 — Review Uptime
Section titled “Phase 06 — Review Uptime”Run:
uptimeRecord:
Current Time
Uptime
LoadInvestigation Value
Section titled “Investigation Value”Unexpected recent reboot may be relevant.
But:
Recent Rebootdoes not automatically mean:
Attacker Rebooted ServerCorrelate with:
Maintenance
Patching
Administrator Activity
Cloud EventsPhase 07 — Identify Current User
Section titled “Phase 07 — Identify Current User”Run:
whoamiThen:
idDocument the identity under which evidence is being collected.
This supports:
Accountability
Evidence Interpretation
Audit TrailPhase 08 — Review Logged-In Users
Section titled “Phase 08 — Review Logged-In Users”Run:
whoThen:
wReview:
Username
Terminal
Login Source
Login Time
Current ActivityInvestigation Questions
Section titled “Investigation Questions”Are These Users Expected?
Are Sources Expected?
Is a Privileged User Logged In?
Does Login Time Match the Alert?
Is an Unknown Session Active?Phase 09 — Review Login History
Section titled “Phase 09 — Review Login History”Run where appropriate:
lastReview:
Username
Source
Login Time
Session Duration
Reboot EventsAuthentication Timeline
Section titled “Authentication Timeline”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 ConnectionThe 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/securedepending on distribution.
Search for patterns rather than blindly copying entire sensitive logs.
Questions
Section titled “Questions”Which Account Was Targeted?
Which Source Generated Failures?
How Many Failures?
Was There a Later Success?
Was the Account Privileged?
Was the Source Expected?Suspicious Pattern Example
Section titled “Suspicious Pattern Example”Repeated Authentication Failures ↓Successful Authentication ↓Privilege Escalation ↓New ProcessThis warrants deeper investigation.
Phase 11 — Review Privilege Activity
Section titled “Phase 11 — Review Privilege Activity”Investigate:
sudo
su
Administrative Sessions
UID 0 ActivityYour objective:
WHO ↓Gained Which Privilege ↓WHEN ↓Performed What ActionPrivilege Questions
Section titled “Privilege Questions”Was Privilege Expected?
Was It Approved?
Was It Used by the Logged-In User?
Did It Occur Immediately Before Suspicious Activity?Phase 12 — Review Users
Section titled “Phase 12 — Review Users”Collect an account inventory:
getent passwdIdentify UID 0 identities:
awk -F: '$3 == 0 {print $1 ":" $3 ":" $7}' /etc/passwdLook for
Section titled “Look for”Unexpected User
Recently Created User
Unexpected UID 0
Unexpected Login Shell
Unexpected Service Account
Changed Group MembershipImportant
Section titled “Important”An unfamiliar account may belong to:
Application
Monitoring Agent
Backup Software
Automation
Vendor ProductValidate before classifying.
Phase 13 — Review Privileged Groups
Section titled “Phase 13 — Review Privileged Groups”Review:
getent groupPay attention to administrative or security-sensitive groups appropriate to the distribution.
Compare:
Expected Membershipagainst:
Actual MembershipPotential Finding
Section titled “Potential Finding”Unexpected Privileged Group Membershipmay indicate:
Misconfiguration
Privilege Creep
Unauthorized Change
Potential PersistencePhase 14 — Review Running Processes
Section titled “Phase 14 — Review Running Processes”Run:
ps auxThen:
ps -efCapture:
ps -ef > process/process-list.txtProcess Investigation Questions
Section titled “Process Investigation Questions”For suspicious processes determine:
PID
PPID
User
Start Time
Command
Executable
Parent
Network ActivityPhase 15 — Identify High Resource Usage
Section titled “Phase 15 — Identify High Resource Usage”Run:
ps aux --sort=-%cpu | head -20Then:
ps aux --sort=-%mem | head -20High CPU or memory may indicate:
Normal Workload
Application Failure
Runaway Process
Unexpected SoftwareIt is a lead, not a verdict.
Phase 16 — Investigate a Suspicious PID
Section titled “Phase 16 — Investigate a Suspicious PID”Suppose the alert identifies:
PID 1234Use:
ps -fp 1234Then:
ps -o pid,ppid,user,lstart,cmd -p 1234Investigation Chain
Section titled “Investigation Chain”PID ↓USER ↓PPID ↓PARENT ↓EXECUTABLE ↓START TIME ↓NETWORKPhase 17 — Identify the Executable
Section titled “Phase 17 — Identify the Executable”For an authorized running process:
readlink -f /proc/1234/exeReview command-line information:
tr '\0' ' ' < /proc/1234/cmdlineBe careful when collecting process data because arguments may contain:
Passwords
Tokens
Secrets
API KeysMinimize sensitive evidence.
Phase 18 — Review Parent Process
Section titled “Phase 18 — Review Parent Process”If:
Suspicious PID = 1234and:
PPID = 900investigate:
ps -fp 900Why Parent Processes Matter
Section titled “Why Parent Processes Matter”Suppose:
sshd ↓shell ↓unexpected processThis provides different context than:
systemd ↓approved serviceProcess ancestry helps reconstruct execution.
Phase 19 — Build the Process Tree
Section titled “Phase 19 — Build the Process Tree”Where available:
pstree -pLook for relationships such as:
sshd └── shell └── processor:
systemd └── service └── workerPhase 20 — Review Deleted Executables
Section titled “Phase 20 — Review Deleted Executables”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.
Phase 21 — Review Open Files
Section titled “Phase 21 — Review Open Files”Where available:
sudo lsof -p 1234This may show:
Executable
Libraries
Configuration
Files
Network SocketsTreat output carefully because it may expose sensitive file paths or data relationships.
Phase 22 — Review Network Interfaces
Section titled “Phase 22 — Review Network Interfaces”Run:
ip -brief addressThen:
ip routeDocument:
Interfaces
Addresses
Routes
Default GatewayThis establishes the network context for the incident.
Phase 23 — Review Listening Ports
Section titled “Phase 23 — Review Listening Ports”Run:
sudo ss -lntupLook for:
Unexpected Ports
Unexpected Bind Addresses
Unknown Processes
Administrative Services
Recently Introduced ServicesInvestigation Workflow
Section titled “Investigation Workflow”PORT ↓PROCESS ↓PID ↓USER ↓EXECUTABLE ↓SERVICE ↓BUSINESS REQUIREMENTPhase 24 — Review Active Connections
Section titled “Phase 24 — Review Active Connections”Run:
sudo ss -ntpReview:
Local Address
Local Port
Remote Address
Remote Port
State
PID
ProcessNetwork Investigation Questions
Section titled “Network Investigation Questions”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 aliceNow 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.
Phase 26 — Review DNS Context
Section titled “Phase 26 — Review DNS Context”Where relevant, investigate:
Destination Hostname
DNS Queries
Resolver Configuration
Application Logs
Central DNS LogsDo not rely exclusively on current DNS resolution because mappings can change.
Historical DNS telemetry may provide stronger incident context.
Phase 27 — Review Firewall State
Section titled “Phase 27 — Review Firewall State”Determine the host firewall technology.
Examples:
sudo firewall-cmd --list-allor:
sudo ufw status verboseor:
sudo nft list rulesetQuestions
Section titled “Questions”Was Suspicious Traffic Allowed?
Should It Have Been Allowed?
Were Firewall Rules Changed?
Is Administrative Access Overly Broad?Phase 28 — Review Running Services
Section titled “Phase 28 — Review Running Services”Run:
systemctl --type=service --state=runningReview:
Known Services
Unknown Services
Recently Introduced Services
Privileged ServicesPhase 29 — Review Enabled Services
Section titled “Phase 29 — Review Enabled Services”Run:
systemctl list-unit-files --type=service --state=enabledAn unexpected enabled service can be significant because it may:
Restart AutomaticallyAfter RebootPhase 30 — Investigate Suspicious Service
Section titled “Phase 30 — Investigate Suspicious Service”For an authorized service:
systemctl status <service>Then:
systemctl cat <service>Review:
Executable
User
Arguments
Dependencies
Restart Behavior
Environment
ConfigurationDo not expose secrets contained in environment or configuration data.
Phase 31 — Persistence Investigation
Section titled “Phase 31 — Persistence Investigation”Review common Linux mechanisms that can cause execution to continue across sessions or reboots.
Think:
SYSTEMD ↓SCHEDULED TASKS ↓SSH KEYS ↓ACCOUNTS ↓SHELL STARTUP ↓APPLICATION STARTUPPersistence Does Not Equal Malware
Section titled “Persistence Does Not Equal Malware”These mechanisms are used extensively by legitimate software.
Your question is:
Is This Mechanism Expected?Phase 32 — Review Cron
Section titled “Phase 32 — Review Cron”For your authorized account:
crontab -lReview appropriate system scheduling locations.
For another authorized account:
sudo crontab -u <user> -lCron Questions
Section titled “Cron Questions”Which User?
Which Command?
Which Script?
Who Owns the Script?
Can It Be Modified by Others?
When Was It Added?
Is It Expected?Phase 33 — Review systemd Timers
Section titled “Phase 33 — Review systemd Timers”Run:
systemctl list-timers --allInvestigate unexpected timers.
A timer may launch:
Maintenance
Backups
Updates
Monitoring
Custom Scriptsor unauthorized execution.
Phase 34 — Review SSH Authorized Keys
Section titled “Phase 34 — Review SSH Authorized Keys”For authorized accounts, review:
~/.ssh/authorized_keysFocus on:
Unknown Key
Recently Added Key
Privileged Account Key
Shared Key
Key Without OwnerNever 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
.bashrcdepending on the shell and distribution.
Investigate:
Unexpected Commands
External Connections
Unexpected Executables
Recent ChangesPhase 36 — Review systemd Unit Files
Section titled “Phase 36 — Review systemd Unit Files”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 UsersPhase 37 — Review Temporary Locations
Section titled “Phase 37 — Review Temporary Locations”Review relevant metadata in:
/tmp
/var/tmpLook for:
Unexpected Executables
Recent Files
Unexpected Ownership
Files Related to Suspicious ProcessesDo not delete potential evidence during collection.
Phase 38 — Review Filesystem Changes
Section titled “Phase 38 — Review Filesystem Changes”For targeted locations, review recent modification times.
Example:
find /etc -type f -mtime -2 -print 2>/dev/nullAlso consider:
Application Directories
User Home
Service Configuration
Scheduled TasksImportant
Section titled “Important”Timestamp interpretation requires care.
Timestamps can be affected by:
Normal Administration
Package Updates
Deployment
File Copying
Backup/Restore
System BehaviorPhase 39 — Review File Metadata
Section titled “Phase 39 — Review File Metadata”For a suspicious file:
stat <file>Record:
Path
Owner
Group
Permissions
Size
TimestampsEvidence Rule
Section titled “Evidence Rule”Prefer:
Metadata Firstbefore modifying the file.
Phase 40 — Hash Relevant Files
Section titled “Phase 40 — Hash Relevant Files”For an authorized suspicious file:
sha256sum <file>Record:
SHA-256
File Path
Collection TimeWhy Hashes Matter
Section titled “Why Hashes Matter”A hash helps identify:
Which Exact FileWas Examinedand can support:
Integrity Verification
Threat Intelligence Correlation
Case TrackingA hash alone does not determine whether a file is malicious.
Phase 41 — Review Package Ownership
Section titled “Phase 41 — Review Package Ownership”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?Phase 42 — Review Software Changes
Section titled “Phase 42 — Review Software Changes”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?Phase 43 — Review Logs
Section titled “Phase 43 — Review Logs”Relevant sources may include:
System Journal
Authentication Logs
Application Logs
Web Logs
Firewall Logs
Audit Logs
Package Logs
Cloud LogsLog Strategy
Section titled “Log Strategy”Do not search randomly.
Start from:
Known Alert TimeThen expand:
Before Alert
During Alert
After AlertPhase 44 — Query the Journal
Section titled “Phase 44 — Query the Journal”Review recent events:
journalctl --since "1 hour ago"Or use an approved incident-specific time range.
For a service:
journalctl -u <service>Investigation Approach
Section titled “Investigation Approach”Known Timestamp ↓Known User ↓Known Process ↓Known Service ↓Related EventsPhase 45 — Review Kernel Events
Section titled “Phase 45 — Review Kernel Events”Where relevant:
journalctl -kKernel evidence may include:
Device Events
Network Events
Security Control Messages
Resource ProblemsPhase 46 — Review SELinux Evidence
Section titled “Phase 46 — Review SELinux Evidence”On SELinux systems:
getenforceReview relevant security denials using approved platform tools.
Security denials can help identify:
Unexpected Application Behavior
Incorrect Context
Blocked Unauthorized ActivityDo not automatically disable SELinux.
Phase 47 — Review AppArmor Evidence
Section titled “Phase 47 — Review AppArmor Evidence”On AppArmor-based systems, review:
Profile Status
Relevant Denials
Affected ApplicationMandatory access-control evidence may help explain what an application attempted to do.
Phase 48 — Review Audit Evidence
Section titled “Phase 48 — Review Audit Evidence”If Linux auditing is configured:
systemctl status auditdWhere authorized:
sudo auditctl -lAudit data may help answer:
Who Changed a File?
Who Changed an Account?
Which Process Performed an Action?
Which Security-Relevant Event Occurred?Phase 49 — Build an Event Timeline
Section titled “Phase 49 — Build an Event Timeline”Create:
timeline/incident-timeline.mdUse 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 |
Timeline Principle
Section titled “Timeline Principle”A useful incident timeline is:
Evidence-Based
Chronological
Source-Referenced
Timezone-AwarePhase 50 — Correlate Events
Section titled “Phase 50 — Correlate Events”Do not analyze events in isolation.
Example:
Login +sudo +New File +New Service +Outbound Connection ↓Potential Incident ChainCorrelation Questions
Section titled “Correlation Questions”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?Phase 51 — Develop Hypotheses
Section titled “Phase 51 — Develop Hypotheses”Examples:
Hypothesis A:Legitimate Administrator Activity
Hypothesis B:Application Deployment
Hypothesis C:Compromised User Account
Hypothesis D:Unauthorized Software ExecutionThen test each hypothesis against evidence.
Good Investigation Practice
Section titled “Good Investigation Practice”Do not search only for evidence supporting your first theory.
Also ask:
What Evidence Would DisproveMy Hypothesis?Phase 52 — Determine Initial Access
Section titled “Phase 52 — Determine Initial Access”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 AccessDo 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 Underthe Original Account?or:
Did It Gain Additional Privilege?Review:
sudo
su
UID Changes
Privileged Services
Account Changes
Security LogsPhase 54 — Determine Persistence
Section titled “Phase 54 — Determine Persistence”Ask:
Would Access SurviveLogout or Reboot?Review:
New Users
SSH Keys
Services
Timers
Cron
Startup Files
Application StartupPhase 55 — Determine Lateral Movement
Section titled “Phase 55 — Determine Lateral Movement”Ask whether the affected Linux host communicated with other internal systems.
Review:
SSH Activity
Application Connections
Internal Destinations
Authentication Logs
Network Telemetry
Cloud Flow LogsScope Question
Section titled “Scope Question”Is This:One HostorMultiple 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 ObservableAsk:
Expected Vendor?
Package Repository?
Monitoring Platform?
Backup Provider?
Unknown Destination?Phase 57 — Determine Data Access
Section titled “Phase 57 — Determine Data Access”Where relevant, assess:
Which Files Were Accessed?
Which Databases?
Which Credentials?
Which Application Data?
Which Secrets?Do not claim:
Data Exfiltrationsimply because an outbound connection exists.
Distinguish:
Possible Access
Observed Access
Confirmed TransferPhase 58 — Determine Impact
Section titled “Phase 58 — Determine Impact”Evaluate:
CONFIDENTIALITY
INTEGRITY
AVAILABILITYQuestions:
Was Sensitive Data Accessed?
Was Configuration Modified?
Was Service Availability Affected?
Were Credentials Exposed?
Was Persistence Established?Phase 59 — Determine Incident Scope
Section titled “Phase 59 — Determine Incident Scope”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 |
Scope Expansion
Section titled “Scope Expansion”Search across:
SIEM
EDR
Firewall
Identity Logs
Cloud Logs
DNS
Proxy
Other Linux Hostsfor confirmed indicators.
Phase 60 — Classify Evidence
Section titled “Phase 60 — Classify Evidence”Use categories such as:
Confirmed
Probable
Possible
UnknownExample:
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 RedundancyPotential Containment Options
Section titled “Potential Containment Options”Depending on organizational procedures:
Restrict Network Access
Disable Compromised Identity
Block Confirmed Malicious Destination
Stop Malicious Service
Isolate Host
Revoke Credentials
Remove Temporary AccessImportant
Section titled “Important”Containment actions can:
Disrupt Business
Alert an Adversary
Destroy Volatile Evidence
Change the Incident StateCoordinate with the incident-response lead.
Phase 62 — Short-Term vs Long-Term Containment
Section titled “Phase 62 — Short-Term vs Long-Term Containment”Short-Term
Section titled “Short-Term”Stop Immediate ThreatExamples:
Isolate Host
Disable Account
Block Confirmed IndicatorLong-Term
Section titled “Long-Term”Restore Controlled OperationsExamples:
Network Segmentation
Credential Rotation
Security Policy Changes
Temporary Hardened ReplacementPhase 63 — Credential Containment
Section titled “Phase 63 — Credential Containment”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 CredentialsDo not focus only on the Linux password.
Phase 64 — Cloud Linux Incident
Section titled “Phase 64 — Cloud Linux Incident”If the affected host is a cloud VM, expand the investigation.
AWS Example
Section titled “AWS Example”Review:
CloudTrail
EC2 Metadata/Role Context
Security Groups
VPC Flow Logs
IAM Activity
Snapshots
CloudWatchAzure Example
Section titled “Azure Example”Review:
Azure Activity Logs
Entra Sign-In Logs
NSGs
Network Logs
Managed Identity
Defender TelemetryGoogle Cloud Example
Section titled “Google Cloud Example”Review:
Cloud Audit Logs
IAM
VPC Flow Logs
Firewall Logs
Service Accounts
Security Command CenterCloud Incident Model
Section titled “Cloud Incident Model”CLOUD CONTROL PLANE +LINUX OPERATING SYSTEM =COMPLETE INVESTIGATIONPhase 65 — Containerized Linux Workloads
Section titled “Phase 65 — Containerized Linux Workloads”If containers are involved, expand to:
Container
Image
Runtime
Host
Registry
OrchestratorAsk:
Was the Process Inside a Container?
Which Image?
Which User?
Which Mounts?
Which Network?
Did Activity Reach the Host?Phase 66 — Kubernetes Context
Section titled “Phase 66 — Kubernetes Context”For Kubernetes workloads:
Alert ↓Pod ↓Container ↓Node ↓Service Account ↓Kubernetes Audit ↓Cloud IAMDo not investigate only the Linux node if orchestration evidence is available.
Phase 67 — Eradication
Section titled “Phase 67 — Eradication”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 ConfigurationImportant
Section titled “Important”Do not confuse:
Delete Artifactwith:
Remove Root CauseIf the original access path remains open, the incident can recur.
Phase 68 — Root Cause
Section titled “Phase 68 — Root Cause”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 IAMRoot Cause vs Symptom
Section titled “Root Cause vs Symptom”Suspicious Process=Symptom
Compromised Credential=Potential CauseRemediation should address both.
Phase 69 — Recovery
Section titled “Phase 69 — Recovery”Recovery may include:
Restore Service
Rebuild Host
Restore Clean Data
Apply Patches
Rotate Credentials
Restore Security Controls
Validate Configuration
Increase MonitoringRebuild Decision
Section titled “Rebuild Decision”For serious compromise, organizations may prefer:
Known-Good Rebuildover:
Attempt to CleanUnknown CompromiseThe decision depends on evidence, severity, system architecture, and organizational policy.
Phase 70 — Validate Recovery
Section titled “Phase 70 — Validate Recovery”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 ActivePhase 71 — Heightened Monitoring
Section titled “Phase 71 — Heightened Monitoring”After recovery, temporarily increase monitoring for:
Repeated Indicators
Authentication Attempts
New Processes
Unexpected Services
Outbound Connections
Configuration ChangesRecovery does not end the investigation immediately.
Phase 72 — Document Indicators
Section titled “Phase 72 — Document Indicators”Document confirmed indicators such as:
IP Addresses
Domains
File Hashes
File Paths
Process Names
Usernames
Service NamesClearly label whether each indicator is:
Confirmed Malicious
Suspicious
Contextual
BenignPhase 73 — Document Findings
Section titled “Phase 73 — Document Findings”Use:
Finding Title
Observation
Evidence
Risk
Impact
Recommendation
Priority
StatusFinding Example — Suspicious Account Activity
Section titled “Finding Example — Suspicious Account Activity”Finding:Suspicious Administrative Authentication
Observation:An administrative account successfullyauthenticated from a source not associatedwith normal administrative activity.
Evidence:Authentication logs and centralizedsecurity telemetry correlate the loginwith subsequent privileged activity.
Risk:Unauthorized use of administrativecredentials could permit system-levelchanges and access to sensitive resources.
Recommendation:Validate account ownership, revoke activesessions where appropriate, rotate affectedcredentials, 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 servicewas configured to start automatically andexecute an unapproved binary.
Risk:The service could provide continuedexecution after reboot and maintainunauthorized access.
Recommendation:Preserve required evidence, identify theinstallation source and related activity,remove the service through the approvedincident process, and address the originalaccess mechanism.Finding Example — Insufficient Logging
Section titled “Finding Example — Insufficient Logging”Finding:Insufficient Linux Security Telemetry
Observation:Authentication and process activity couldnot be fully reconstructed because requiredsecurity events were not centrally retained.
Risk:Limited telemetry reduces detection,investigation, and incident reconstructioncapabilities.
Recommendation:Implement centralized security logging,appropriate audit controls, timesynchronization, retention, and monitoring.Phase 74 — Write the Incident Report
Section titled “Phase 74 — Write the Incident Report”Your report should contain:
1. Executive Summary
Section titled “1. Executive Summary”Explain:
What Happened
Affected Assets
Business Impact
Current Status2. Detection
Section titled “2. Detection”Document:
Detection Source
Alert
Timestamp
Initial Indicator3. Scope
Section titled “3. Scope”Document:
Affected Hosts
Affected Accounts
Affected Applications
Affected Data4. Investigation
Section titled “4. Investigation”Describe:
Authentication
Privilege
Processes
Network
Files
Persistence
Logs5. Timeline
Section titled “5. Timeline”Provide the evidence-based chronology.
6. Indicators
Section titled “6. Indicators”Document relevant:
IPs
Domains
Hashes
Accounts
Processes
Services7. Impact
Section titled “7. Impact”Assess:
Confidentiality
Integrity
Availability8. Containment
Section titled “8. Containment”Document:
Action
Time
Owner
Reason
Result9. Eradication
Section titled “9. Eradication”Document what was removed or corrected.
10. Recovery
Section titled “10. Recovery”Document restoration and validation.
11. Root Cause
Section titled “11. Root Cause”State only what the evidence supports.
12. Recommendations
Section titled “12. Recommendations”Prioritize:
Immediate
Short-Term
Long-TermPhase 75 — Incident Timeline Template
Section titled “Phase 75 — Incident Timeline Template”Incident ID:
Timezone:
--------------------------------------------------
Time:Event:User:Host:Process:Source:Evidence:Analyst Notes:
--------------------------------------------------Phase 76 — Analyst Investigation Notes
Section titled “Phase 76 — Analyst Investigation Notes”Use:
Timestamp
Action Performed
Command / Tool
Observation
Evidence Location
Interpretation
Next StepSeparate:
Observationfrom:
InterpretationExample:
Observation:TCP connection exists from PID 1234to external address.
Interpretation:Connection is not present in documentedapplication baseline and requires furtherinvestigation.Phase 77 — Chain of Custody
Section titled “Phase 77 — Chain of Custody”For formal investigations, evidence handling may require:
Evidence Identifier
Collector
Collection Time
Source
Hash
Storage Location
Transfers
Access HistoryFollow organizational and legal requirements.
Phase 78 — Escalation Criteria
Section titled “Phase 78 — Escalation Criteria”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 CompromisePhase 79 — Communication
Section titled “Phase 79 — Communication”Incident communication should be:
Accurate
Evidence-Based
Timely
Need-to-Know
Free of Unsupported ConclusionsAvoid statements like:
"The attacker stole all data."when the evidence only shows:
"An unauthorized process establishedan outbound connection."Phase 80 — Incident Severity
Section titled “Phase 80 — Incident Severity”Severity should consider:
Asset Criticality
Privilege Level
Scope
Data Sensitivity
Persistence
External Communication
Business Impact
Active ThreatPhase 81 — False Positive Handling
Section titled “Phase 81 — False Positive Handling”If investigation determines activity is legitimate:
Document Evidence ↓Identify Business Process ↓Close Incident ↓Tune Detection if AppropriateDo not simply write:
False Positivewithout evidence.
Phase 82 — Lessons Learned
Section titled “Phase 82 — Lessons Learned”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?Phase 83 — Improve Security Controls
Section titled “Phase 83 — Improve Security Controls”Lessons may lead to improvements in:
Linux Hardening
IAM
SSH
Patching
Firewall
Segmentation
Logging
Audit
EDR
SIEM
Cloud IAM
MonitoringPhase 84 — Detection Engineering
Section titled “Phase 84 — Detection Engineering”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 DisabledThe goal is:
Incident ↓Knowledge ↓Detection ImprovementPhase 85 — Investigation Decision Tree
Section titled “Phase 85 — Investigation Decision Tree”ALERT RECEIVED | vVALID? | | 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 REPORTPhase 86 — Quick Linux Triage Checklist
Section titled “Phase 86 — Quick Linux Triage Checklist”System
Section titled “System”- Record date/time
- Record timezone
- Identify hostname
- Identify OS
- Identify kernel
- Review uptime
Identity
Section titled “Identity”- Identify current user
- Review logged-in users
- Review login history
- Review failed authentication
- Review privileged activity
- Review UID 0
- Review privileged groups
Processes
Section titled “Processes”- Capture process list
- Identify suspicious PID
- Identify user
- Identify PPID
- Identify executable
- Review process tree
- Review relevant open resources
Network
Section titled “Network”- Review interfaces
- Review routes
- Review listeners
- Review active connections
- Correlate connections with PIDs
- Review firewall
Services
Section titled “Services”- Review running services
- Review enabled services
- Investigate unknown services
- Review service configuration
Persistence
Section titled “Persistence”- 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
Response
Section titled “Response”- Determine containment requirement
- Preserve required evidence
- Coordinate containment
- Remove root cause
- Recover
- Validate
- Monitor
- Report
Common Investigation Mistakes
Section titled “Common Investigation Mistakes”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 ActionsLinux Investigation Mental Model
Section titled “Linux Investigation Mental Model”Memorize:
USER ↓PROCESS ↓PARENT ↓FILE ↓SERVICE ↓NETWORK ↓PERSISTENCE ↓LOGS ↓TIMELINEInvestigation Questions
Section titled “Investigation Questions”Every Linux incident should eventually answer:
WHO?
WHAT?
WHEN?
WHERE?
HOW?
WHY?
HOW FAR?
WHAT IMPACT?
WHAT REMAINS?Interview Scenario 01
Section titled “Interview Scenario 01”A SOC alert reports an unexpected outbound connection from a Linux server. What do you investigate first?
Start by validating:
Host
Connection
PID
Process
UserThen expand into:
Parent
Executable
Authentication
Persistence
TimelineInterview Scenario 02
Section titled “Interview Scenario 02”You identify a suspicious process. Should you kill it immediately?
Not automatically.
First consider:
Active Risk
Evidence Preservation
Process Information
Connections
Parent Process
Incident ProcedureImmediate containment may still be necessary for a high-risk active incident.
Interview Scenario 03
Section titled “Interview Scenario 03”Why is PPID useful?
Because it helps identify:
How the ProcessWas Startedand supports reconstruction of execution relationships.
Interview Scenario 04
Section titled “Interview Scenario 04”Why review SSH authorized keys?
Because unauthorized keys may provide:
Persistent Remote Accesseven after a password is changed.
Interview Scenario 05
Section titled “Interview Scenario 05”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 TransferredAdditional evidence is required.
40 Linux Incident Response Interview Questions
Section titled “40 Linux Incident Response Interview Questions”- What is Linux incident triage?
- What should you record when an alert arrives?
- Why is system time important?
- Why is evidence volatility important?
- Why should you avoid rebooting immediately?
- How do you identify logged-in users?
- How do you review login history?
- How would you investigate authentication failures?
- How do you identify UID 0 accounts?
- Why should privileged groups be reviewed?
- How do you capture running processes?
- Why is PPID important?
- How do you identify a process executable?
- What can
/proctell you? - Why should process arguments be handled carefully?
- How do you identify listening ports?
- How do you map connections to processes?
- How do you investigate an unexpected external connection?
- Why review the host firewall?
- How do you identify running services?
- Why review enabled services?
- What Linux mechanisms can provide persistence?
- Why review cron?
- Why review systemd timers?
- Why review SSH authorized keys?
- Why review startup files?
- Why are file timestamps useful?
- Why calculate file hashes?
- What is event correlation?
- What is an incident timeline?
- How do you determine initial access?
- How do you investigate privilege escalation?
- How do you determine incident scope?
- What is containment?
- What is eradication?
- What is recovery?
- What is root cause?
- Why should cloud logs be reviewed for cloud Linux incidents?
- What should an incident report contain?
- What are the most common Linux incident-investigation mistakes?
Runbook Completion Criteria
Section titled “Runbook Completion Criteria”The investigation is not complete merely because:
Alert StoppedYou 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 ValidatedRunbook Success Criteria
Section titled “Runbook Success Criteria”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 ReportFinal Operational Workflow
Section titled “Final Operational Workflow”DETECT ↓VALIDATE ↓PRESERVE ↓IDENTIFY ↓TRIAGE ↓INVESTIGATE ↓CORRELATE ↓TIMELINE ↓SCOPE ↓CONTAIN ↓ERADICATE ↓RECOVER ↓VALIDATE ↓MONITOR ↓REPORT ↓IMPROVERunbook Complete
Section titled “Runbook Complete”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 RequiredThis is the difference between simply operating security tools and performing professional incident investigation.
What’s Next?
Section titled “What’s Next?”➡️ Runbook 02 — Linux Security Assessment
In the next runbook, you will move from:
Reactive Investigationto:
Proactive Security AssessmentYou 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 RoadmapYour Linux operational-security sequence is:
Runbook 01 — Linux Incident Investigation ↓Runbook 02 — Linux Security Assessment ↓Runbook 03 — Linux Server Hardening