Skip to content

Lab 05 — Linux Security

Welcome to the final hands-on lab in the Linux lab series.

You have already worked through:

Lab 01 — Linux Administration
Lab 02 — Linux Hardening
Lab 03 — Linux IAM
Lab 04 — Linux Networking

Now you will bring those skills together into:

Lab 05 — Linux Security

This lab changes your perspective from:

How Do I Administer
This Linux Server?

to:

Is This Linux Server Secure?
What Is Exposed?
Who Has Access?
What Is Running?
What Has Changed?
What Looks Suspicious?
Can We Investigate It?
How Should We Remediate It?

Lab: Linux Security
Level: Intermediate
Estimated Time: 150–210 minutes
Environment: Authorized disposable Linux VM
Primary Role: Linux Security Engineer
Secondary Roles: SOC Analyst, Incident Responder, Cloud Security Engineer, Security Consultant, DevSecOps Engineer

Your organization is preparing an important Linux application server for a security review.

The server is operational, but the security team wants an independent assessment before approving it for production.

You have been assigned to review:

Operating System
Accounts
Privileges
Authentication
Filesystem
Processes
Services
Software
Network
Firewall
Logging
Auditing
Scheduled Execution
Security Controls
Suspicious Activity

You must distinguish:

Expected

from:

Unexpected

and convert technical observations into professional security findings.

By completing this lab, you should be able to:

  • Establish a Linux security baseline
  • Identify the operating system and kernel
  • Review user and service identities
  • Identify privileged accounts
  • Review groups and sudo access
  • Evaluate authentication exposure
  • Review SSH security
  • Assess filesystem permissions
  • Identify world-writable resources
  • Review SUID and SGID executables
  • Identify unusual processes
  • Review running and enabled services
  • Assess installed software
  • Review patch status
  • Identify network listeners
  • Investigate active connections
  • Review host firewall controls
  • Evaluate SELinux or AppArmor
  • Review system and authentication logs
  • Review Linux auditing
  • Investigate scheduled execution
  • Identify basic persistence indicators
  • Build a security timeline
  • Document findings and remediation
  • Produce a Linux security assessment report
+----------------------------------+
| Security Analyst |
+----------------+-----------------+
|
| SSH / Console
|
v
+----------------------------------+
| Linux Server |
| |
| Identity Processes |
| Privilege Services |
| Filesystem Packages |
| Network Firewall |
| SSH Logs |
| Audit Persistence |
| SELinux / AppArmor |
+----------------+-----------------+
|
v
+----------------------------------+
| Security Findings & Evidence |
+----------------------------------+

Use:

ASSET
IDENTITY
PRIVILEGE
SOFTWARE
PROCESS
SERVICE
NETWORK
LOGGING
SECURITY CONTROL
EVIDENCE

Do not assume:

Unfamiliar
=
Malicious

Instead:

Observe
Collect Evidence
Compare Baseline
Establish Context
Determine Risk

Part 01 — Prepare the Security Workspace

Section titled “Part 01 — Prepare the Security Workspace”

Create:

Terminal window
mkdir -p ~/linux-security-lab

Enter it:

Terminal window
cd ~/linux-security-lab

Create:

Terminal window
mkdir baseline evidence findings reports

Your structure becomes:

linux-security-lab/
├── baseline/
├── evidence/
├── findings/
└── reports/

Before conducting any security assessment, confirm:

System Is Authorized
Scope Is Known
Assessment Window Is Known
Permitted Actions Are Known
Evidence Handling Is Defined

This lab should be performed only against:

Your Own Linux VM
Authorized Training Infrastructure
Approved Enterprise Systems

Run:

Terminal window
hostname

Then:

Terminal window
cat /etc/os-release

Then:

Terminal window
uname -a

Review:

Hostname
Distribution
Version
Kernel
Architecture

Create:

Terminal window
{
echo "Linux Security Baseline"
echo "======================="
echo "Date: $(date)"
echo "Hostname: $(hostname)"
echo "Kernel: $(uname -r)"
echo "User: $(whoami)"
echo
cat /etc/os-release
} > baseline/system.txt

Security findings require context.

For example:

Vulnerability
Affected Software Version
Specific Operating System

Without an accurate inventory, vulnerability and configuration analysis becomes unreliable.

Run:

Terminal window
uptime

Record:

Uptime
Load Average
Current Time

Uptime can help answer questions such as:

Was the System Recently Rebooted?
Could a Security Update Be Waiting for Reboot?
Does the Timeline Match the Incident?

It is evidence, not proof by itself.

Run:

Terminal window
whoami

Then:

Terminal window
id

Document:

Username
UID
Primary Group
Supplementary Groups
Administrative Capability

Run:

Terminal window
getent passwd

Save:

Terminal window
getent passwd > baseline/users.txt

Review accounts as:

Human Accounts
Administrative Accounts
Service Accounts
System Accounts

A useful starting point is:

Terminal window
getent passwd | grep -E '/bin/(bash|sh|zsh|fish)$'

Exact shell paths vary by environment.

Ask:

Who Owns This Account?
Does It Need Interactive Login?
Is It Still Required?
Does Its Access Match Its Role?

Run:

Terminal window
awk -F: '$3 == 0 {print $1 ":" $3 ":" $7}' /etc/passwd

UID 0 represents root-equivalent identity.

Unexpected UID 0 accounts should receive immediate review.

Finding:
Unexpected Privileged Identity
Observation:
An account other than the approved root
identity has UID 0.
Risk:
The account possesses root-equivalent
operating-system privileges.
Recommendation:
Validate ownership and business need and
remove unauthorized root-equivalent
identity assignments through the approved
change process.

Run:

Terminal window
getent group

Save:

Terminal window
getent group > baseline/groups.txt

Focus on groups that may grant:

Administrative Access
Application Access
Sensitive File Access
Device Access

For your authorized account:

Terminal window
sudo -l

Review appropriate administrative groups and sudo configuration.

Security questions:

Who Can Elevate Privilege?
What Can They Execute?
Is Broad Access Necessary?
Is Privileged Activity Logged?
Is Access Individually Attributable?
Standard User
Approved Administrative Requirement
Controlled sudo
Logging
Review

Part 10 — Look for Shared Administrative Access

Section titled “Part 10 — Look for Shared Administrative Access”

Shared privileged identities weaken accountability.

Poor model:

Admin A ─┐
Admin B ─┼──> shared-admin ──> root
Admin C ─┘

Better:

Admin A ──> Individual Identity ──> sudo
Admin B ──> Individual Identity ──> sudo
Admin C ──> Individual Identity ──> sudo
Finding:
Shared Privileged Account
Risk:
Administrative activity cannot be
reliably attributed to an individual.
Recommendation:
Use individually attributable identities
with controlled privilege escalation.

Identify accounts associated with:

Web Servers
Databases
Monitoring Agents
Backup Agents
Application Services

Ask:

Does the Service Need a Login Shell?
Does It Need a Home Directory?
Does It Need sudo?
Which Files Does It Own?
Which Network Resources Does It Access?

Prefer:

Application
Dedicated Service Account
Minimum Required Privilege

rather than:

Application
root

unless a legitimate technical requirement exists.

Run:

Terminal window
who

Then:

Terminal window
w

Review:

User
Terminal
Source
Login Time
Current Activity

Where available:

Terminal window
last

Ask:

Are Sources Expected?
Are Login Times Expected?
Are Privileged Users Expected?
Are There Unusual Patterns?

Part 13 — Review Authentication Failures

Section titled “Part 13 — Review Authentication Failures”

Authentication evidence varies by distribution.

Possible sources include:

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

Use the appropriate source for your system.

Look for patterns such as:

Repeated Failures
Unknown Users
Unexpected Sources
Successful Login After Many Failures

A failed-login spike can represent:

User Error
Automation Failure
Credential Misconfiguration
Scanning
Password Guessing

Investigate context before assigning cause.

Determine whether SSH is active:

Terminal window
systemctl status sshd

or:

Terminal window
systemctl status ssh

depending on the distribution.

Review the effective SSH configuration where supported:

Terminal window
sudo sshd -T

Ask:

Is Root Remote Login Required?
Which Authentication Methods Are Enabled?
Are Unnecessary Users Allowed?
Which Networks Can Reach SSH?
Are SSH Events Logged?
Are Authorized Keys Managed?

For authorized identities, review:

~/.ssh/
authorized_keys

Do not copy private key material into your evidence.

Ask:

Who Owns Each Key?
Is It Still Required?
Is It Shared?
Is It Stale?
Can It Be Revoked?
Finding:
Unmanaged SSH Authorization
Observation:
An SSH public key is authorized for an
administrative account but its current
owner cannot be confirmed.
Risk:
An unauthorized or former key holder
may retain remote access.
Recommendation:
Validate key ownership and remove stale
or unauthorized keys.

Linux filesystem permissions are fundamental security controls.

Start with sensitive locations such as:

/etc
/root
/home
/var
Application Directories
SSH Directories
Log Directories

Check metadata rather than exposing sensitive contents.

For example:

Terminal window
ls -l /etc/passwd

and:

Terminal window
sudo ls -l /etc/shadow

Do not copy password hashes into reports.

Run:

Terminal window
ls -ld /home/*

Review:

Owner
Group
Permissions

Ask:

Can Other Users Read Data
They Do Not Need?

Part 18 — Search for World-Writable Files

Section titled “Part 18 — Search for World-Writable Files”

In an authorized disposable lab:

Terminal window
sudo find / -xdev -type f -perm -0002 -print 2>/dev/null

Do not classify every result as a vulnerability automatically.

For each result determine:

Purpose
Owner
Location
Business Requirement
Exposure

Part 19 — Review World-Writable Directories

Section titled “Part 19 — Review World-Writable Directories”

Shared writable directories may be legitimate.

Review:

Permissions
Sticky Bit
Ownership
Purpose

Check:

Terminal window
ls -ld /tmp

A common secure shared-directory pattern includes the sticky bit.

Run:

Terminal window
sudo find / -xdev -type f -perm -4000 -print 2>/dev/null

SUID files can execute with the effective privileges of their owner.

Do not remove SUID permissions blindly.

Investigate:

File
Owner
Package
Purpose
Baseline
Business Requirement

Run:

Terminal window
sudo find / -xdev -type f -perm -2000 -print 2>/dev/null

Again:

Expected?
Known Package?
Required?
Approved?

Security assessments should consider files whose UID or GID no longer maps cleanly to an active identity.

Why?

Deleted Identity
Files Remain
UID/GID Reused
Unexpected Ownership

Review orphaned ownership carefully in authorized environments.

Part 23 — Review Recently Modified Files

Section titled “Part 23 — Review Recently Modified Files”

During investigation, file timestamps can provide useful leads.

For a controlled directory:

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

This example identifies files with modification times in a recent window.

Recent modification does not equal compromise.

It may represent:

Patch
Configuration Change
Deployment
Administrator Activity
Automation

Correlate timestamps with approved changes and logs.

Security-sensitive files may require monitoring for unexpected change.

Examples:

SSH Configuration
sudo Configuration
Authentication Configuration
Application Configuration
Scheduled Tasks

A mature environment may use:

File Integrity Monitoring

to detect unauthorized modifications.

Run:

Terminal window
ps aux

Then:

Terminal window
ps -ef

Review:

PID
PPID
User
CPU
Memory
Command
PROCESS
PID
USER
PARENT
EXECUTABLE
NETWORK
FILES
TIMELINE

Part 26 — Identify Resource-Heavy Processes

Section titled “Part 26 — Identify Resource-Heavy Processes”

Run:

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

Then:

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

High resource usage can indicate:

Normal Application Load
Runaway Process
Misconfiguration
Unexpected Software

Do not conclude malicious activity from resource usage alone.

For an authorized PID:

Terminal window
ps -fp <PID>

You can inspect its parent relationship:

Terminal window
ps -o pid,ppid,user,lstart,cmd -p <PID>

Ask:

Which User Started It?
What Is Its Parent?
When Did It Start?
What Executable Is Running?
Is It Expected?

Linux exposes runtime process information through:

/proc

For an authorized PID, information may be available under:

/proc/<PID>/

This can help analysts understand:

Executable
Command Line
Environment
Open Resources
Process State

Be careful: process environments can contain sensitive information.

Do not copy secrets into evidence unnecessarily.

Run:

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

Then review enabled services:

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

Ask:

What Is Running?
Why?
Who Owns It?
Does It Need Network Access?
Should It Start Automatically?

Run:

Terminal window
sudo ss -lntup

Create a matrix:

Service Process Port Bind Address Required
SSH sshd 22 Review Yes
Application Review Review Review Yes
Unknown Review Review Review Investigate

Every network listener should have:

Owner
Purpose
Approved Exposure

If you discover an unexpected listener:

PORT
PID
PROCESS
USER
EXECUTABLE
SERVICE
START METHOD
BUSINESS REQUIREMENT

Do not identify software as malicious solely because it uses an unusual port.

Part 32 — Review Active Network Connections

Section titled “Part 32 — Review Active Network Connections”

Run:

Terminal window
sudo ss -ntp

Review:

Local Address
Remote Address
State
Process
PID

For unexpected outbound communication ask:

Which Process?
Which User?
Which Destination?
Which Port?
When Did It Begin?
Is It Required?
Does It Match the Baseline?

Part 33 — Investigate an Outbound Connection

Section titled “Part 33 — Investigate an Outbound Connection”

Use:

NETWORK CONNECTION
PID
PROCESS
PARENT PROCESS
USER
EXECUTABLE
LOGS
BUSINESS CONTEXT

This is a powerful Linux incident-analysis workflow.

Determine the active host-firewall technology.

Possible examples:

firewalld
nftables
ufw

For firewalld:

Terminal window
sudo firewall-cmd --list-all

For UFW:

Terminal window
sudo ufw status verbose

For nftables:

Terminal window
sudo nft list ruleset
Is the Firewall Active?
Which Services Are Allowed?
Which Sources Are Allowed?
Is Administrative Access Restricted?
Are Unnecessary Ports Exposed?
Does IPv6 Receive Equivalent Protection?
Finding:
Administrative Service Broadly Accessible
Observation:
The Linux remote-administration service
is reachable from a broader network range
than required.
Risk:
Unnecessary exposure increases the
opportunity for authentication attacks
and exploitation.
Recommendation:
Restrict administrative access to
approved management sources and enforce
strong authentication and monitoring.

Debian-family example:

Terminal window
dpkg -l

RPM-family example:

Terminal window
rpm -qa

Save an inventory where appropriate.

Is the Package Required?
Is It Supported?
Is It Updated?
Which Repository Supplied It?
Does It Introduce a Service?

Use the package-management tools appropriate to your distribution to identify available updates.

Do not automatically apply production updates during an assessment.

Follow:

Discover
Assess
Prioritize
Test
Approve
Deploy
Validate

Remember:

Available Update

does not automatically mean:

Currently Exploitable Vulnerability

Similarly:

No Available Package Update

does not prove:

No Security Risk

Security analysis requires context.

Review configured repositories.

Ask:

Are They Approved?
Are They Expected?
Are They Trusted?
Are Unsupported Sources Present?
Finding:
Unapproved Software Repository
Observation:
The server references a package repository
that is not part of the approved software
supply-chain configuration.
Risk:
Software from an untrusted or unmanaged
source could introduce unsupported or
malicious components.
Recommendation:
Validate the repository requirement and
restrict software installation to approved
trusted sources.

On systems using SELinux:

Terminal window
getenforce

Then, where available:

Terminal window
sestatus

Possible states include:

Enforcing
Permissive
Disabled

Do not use:

Disable SELinux

as a generic troubleshooting solution.

Instead:

Application Problem
Standard Permissions
Configuration
SELinux Evidence
Context / Policy
Correct Remediation

For an authorized file:

Terminal window
ls -Z <file>

For a directory:

Terminal window
ls -Zd <directory>

When a legitimate application is blocked, investigate whether:

Label Is Incorrect
Boolean Is Required
Policy Is Missing
Application Is Behaving Unexpectedly

On distributions using AppArmor, review active profiles with the supported tools available on the platform.

Understand:

Enforce
Complain
Unconfined

The security objective is:

Application
Minimum Required Capability

Start with:

Terminal window
journalctl -n 100

Review:

Errors
Warnings
Service Activity
Authentication
Kernel Events
Terminal window
journalctl -b

This may reveal:

Service Failures
Filesystem Problems
Device Problems
Security Control Issues

Depending on distribution:

/var/log/auth.log

or:

/var/log/secure

may contain authentication-related information.

The system journal may also contain relevant evidence.

Look for:

Failed Login
Successful Login
sudo Activity
Account Changes
SSH Sessions

Your goal is to answer:

Who Elevated Privilege?
When?
What Happened?
Was It Expected?

Correlate:

Authentication Logs
sudo Logs
Shell History Where Appropriate
Change Records
System Logs

Do not treat shell history as authoritative forensic evidence by itself.

Some Linux systems use:

auditd

Check:

Terminal window
systemctl status auditd

where available.

Review configured rules:

Terminal window
sudo auditctl -l

where authorized.

Linux auditing can provide evidence related to:

Security-Relevant System Calls
Identity Changes
Sensitive File Activity
Administrative Actions

Understand the distinction:

Application/System Logs
What Components Reported

versus:

Audit Framework
Security-Relevant OS Activity

Both can be useful.

Run:

Terminal window
timedatectl

Review:

System Time
Timezone
Synchronization

Incident timelines may combine:

Linux Logs
Firewall Logs
Cloud Logs
SIEM Events
Application Logs

If clocks disagree significantly:

Timeline Reconstruction

becomes much harder.

Run:

Terminal window
crontab -l

Review authorized system scheduling locations.

Also check:

Terminal window
systemctl list-timers --all

For every scheduled execution ask:

Which User?
Which Command?
Which Script?
Who Owns the Script?
Can Another User Modify It?
Is It Expected?
When Does It Run?

Attackers and legitimate administrators may use some of the same operating-system mechanisms.

Potential persistence locations can include:

Scheduled Tasks
systemd Services
Startup Configuration
SSH Authorized Keys
User Accounts
Application Startup Mechanisms

The presence of one does not prove malicious activity.

The question is:

Is It Expected?

An unexpected enabled service may start automatically after reboot.

Review:

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

Compare against:

Approved Server Baseline

Systemd configuration can exist in locations such as:

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

depending on distribution.

Pay special attention to:

Unexpected Custom Units
Recently Modified Units
Unknown Executables
Unusual Users

Part 51 — Review Authorized Keys as Persistence

Section titled “Part 51 — Review Authorized Keys as Persistence”

An unauthorized public key added to:

authorized_keys

can create continued remote access.

Review:

Key Owner
Account
File Modification Time
Business Requirement
Associated Change Record

Never expose private keys.

User shell startup files may include:

.bashrc
.profile
.bash_profile

depending on the environment.

Unexpected commands in startup files may require investigation.

Again:

Custom

does not mean:

Malicious

Security investigations may include directories such as:

/tmp
/var/tmp

because applications and users frequently write there.

Review:

Unexpected Executables
Unexpected Ownership
Unusual Modification Times

Do not delete suspicious files before deciding whether they are needed as evidence.

When suspicious activity is discovered, avoid unnecessary destructive actions.

Before remediation consider capturing:

Process Information
Network Connections
File Metadata
Relevant Logs
User Information
Service Configuration
Timestamps
Detect
Preserve
Understand
Contain
Remediate

not:

Detect
Delete Everything

Suppose you observe:

02:10 Failed SSH Logins
02:16 Successful Login
02:18 sudo Activity
02:21 New User Created
02:24 New Service Started
02:27 External Connection

Individually these events may have multiple explanations.

Together they create:

Investigation Context
Time Event Identity Source Evidence
02:10 Failed login user IP Auth log
02:16 Successful login user IP Auth log
02:18 Privilege use user Local sudo log
02:21 Account creation root Local Audit/log
02:24 Service start service Local Journal
02:27 Connection process Remote IP Socket/network evidence

Security analysis becomes stronger when multiple sources agree.

Authentication Log
+
Process Information
+
Network Connection
+
Filesystem Metadata
+
Audit Evidence
Higher-Confidence Conclusion

Part 57 — Security Investigation Scenario

Section titled “Part 57 — Security Investigation Scenario”

Monitoring reports:

Unexpected Outbound Connection
from Linux Server

Your workflow:

01 Confirm Alert
02 Identify Destination
03 Identify Local Port
04 Identify PID
05 Identify Process
06 Identify User
07 Identify Parent Process
08 Review Executable
09 Review Start Time
10 Review Authentication Activity
11 Review Persistence
12 Build Timeline
13 Determine Business Context

Part 58 — Investigate Without Immediate Destruction

Section titled “Part 58 — Investigate Without Immediate Destruction”

Do not immediately:

Kill Process
Delete File
Remove User
Reboot Server

unless immediate containment is required by your incident-response procedure.

These actions can alter:

Volatile Evidence
Timestamps
Connections
Process State

Part 59 — Security Finding: Unexpected Service

Section titled “Part 59 — Security Finding: Unexpected Service”
Finding:
Unexpected System Service
Observation:
A running and enabled service is not
included in the approved server baseline
and its business owner cannot initially
be identified.
Risk:
An unauthorized service may increase
attack surface or provide persistent
execution.
Recommendation:
Identify the service owner, executable,
configuration, network exposure, and
installation source. Disable or remove
the service if it is confirmed to be
unauthorized.

Part 60 — Security Finding: Excessive Privilege

Section titled “Part 60 — Security Finding: Excessive Privilege”
Finding:
Excessive Administrative Access
Observation:
A standard user has broad administrative
privileges beyond the requirements of
their documented role.
Risk:
Compromise of the account could provide
full system control.
Recommendation:
Reduce privileges to the minimum required
and periodically review privileged access.

Part 61 — Security Finding: Weak File Permissions

Section titled “Part 61 — Security Finding: Weak File Permissions”
Finding:
Sensitive File Permissions Too Broad
Observation:
A security-sensitive file can be accessed
by users who do not require that access.
Risk:
Unauthorized users may read or modify
sensitive configuration or data.
Recommendation:
Restrict ownership and permissions
according to least privilege and validate
application compatibility.

Part 62 — Security Finding: Missing Security Logging

Section titled “Part 62 — Security Finding: Missing Security Logging”
Finding:
Insufficient Security Event Visibility
Observation:
Important authentication or
administrative activity is not retained
with sufficient detail for investigation.
Risk:
Security incidents may be difficult to
detect, investigate, or reconstruct.
Recommendation:
Enable appropriate system and security
logging, protect logs, synchronize time,
and forward required events to a
centralized monitoring platform.

Part 63 — Security Finding: Unexpected External Connection

Section titled “Part 63 — Security Finding: Unexpected External Connection”
Finding:
Unexpected External Communication
Observation:
A Linux process communicates with an
external destination that is not part
of the documented server workflow.
Risk:
The communication could represent
misconfiguration, unauthorized software,
or malicious activity.
Recommendation:
Correlate the connection with process,
identity, executable, destination,
timeline, and business context before
determining containment and remediation.

Part 64 — Security Finding: Mandatory Access Control

Section titled “Part 64 — Security Finding: Mandatory Access Control”
Finding:
Mandatory Access Control Not Enforcing
Observation:
The platform's expected SELinux or
AppArmor security control is not operating
in its approved enforcement state.
Risk:
Processes may have fewer restrictions
than required by the security baseline.
Recommendation:
Determine why enforcement is unavailable,
resolve compatibility issues, and restore
the approved security state.

Prioritize findings using context.

Consider:

Exposure
Privilege
Exploitability
Data Sensitivity
Business Criticality
Existing Controls
Potential Impact

A simple model:

LIKELIHOOD
×
IMPACT
=
RISK
Finding:
Unused Local Package
Exposure:
Low
Privilege:
Low
Impact:
Limited
Priority:
Lower

Compare with:

Finding:
Internet-Reachable Administrative Service
Exposure:
High
Privilege:
High
Impact:
High
Priority:
High

Your assessment should determine whether controls are merely:

Configured

or actually:

Effective

Example:

Firewall Installed

does not prove:

Firewall Protecting Server

Likewise:

auditd Installed

does not prove:

Useful Audit Rules Exist

Security testing should validate denied behavior where safe and authorized.

Examples:

Unauthorized User
Cannot Access Sensitive Directory
Unapproved Network Source
Cannot Reach Administrative Service
Service Account
Cannot Log In Interactively
Standard User
Cannot Perform Administrative Action

A secure Linux server should not depend on one control.

Think:

Identity
+
Least Privilege
+
Filesystem Permissions
+
SELinux/AppArmor
+
Firewall
+
Patching
+
Logging
+
Monitoring
+
Backups

For an EC2 Linux workload:

AWS IAM
VPC
Security Group
EC2 Instance
Linux IAM
Linux Firewall
Application

A Linux assessment must consider that some controls may exist outside the operating system.

Microsoft Entra ID
Azure RBAC
Virtual Network
NSG
Linux VM
Linux Security

Part 71 — Linux Security in Google Cloud

Section titled “Part 71 — Linux Security in Google Cloud”
Google Cloud IAM
VPC Firewall
Compute Engine
Linux IAM
Host Security

Do not assess:

Linux VM

in isolation from:

Cloud Control Plane

Container security depends heavily on Linux.

Container
Runtime
Linux Kernel

Relevant Linux controls include:

Namespaces
Capabilities
Filesystem Permissions
SELinux/AppArmor
Seccomp
Users
Networking

Kubernetes workloads ultimately execute on Linux nodes in many environments.

Kubernetes
Container Runtime
Linux Node
Kernel

Linux security therefore supports:

Node Hardening
Runtime Security
Container Isolation
Incident Response

Part 74 — Linux Security and SOC Operations

Section titled “Part 74 — Linux Security and SOC Operations”

Linux telemetry can help SOC teams investigate:

Suspicious Login
Privilege Escalation
New User
New Service
Unexpected Process
Unknown Port
Outbound Connection
Persistence
Configuration Change
ALERT
HOST
USER
PROCESS
NETWORK
FILES
LOGS
TIMELINE
DECISION

Part 75 — Linux Security and Incident Response

Section titled “Part 75 — Linux Security and Incident Response”

Security assessment asks:

Is the Server Secure?

Incident response asks:

What Happened?

Strong Linux skills support both.

Part 76 — Build the Linux Security Report

Section titled “Part 76 — Build the Linux Security Report”

Create:

Linux Security Assessment Report

Your report should contain the following sections.

Include:

Assessment Scope
Overall Security Posture
Critical Observations
Highest-Risk Findings
Recommended Priorities

Document:

Hostname
Distribution
Version
Kernel
Server Role
Assessment Date

Document:

Human Accounts
Service Accounts
UID 0 Accounts
Dormant Accounts
Group Memberships

Document:

sudo
Administrative Groups
Shared Accounts
SUID/SGID
Root Access

Document:

SSH
Authorized Keys
Authentication Logs
Remote Access Exposure

Document:

Sensitive Permissions
World-Writable Resources
Home Directories
Special Permissions
Unexpected Changes

Document:

Unexpected Processes
High Resource Processes
Process Ownership
Parent/Child Relationships

Document:

Running Services
Enabled Services
Unexpected Services
Business Requirements

Document:

Listening Ports
Bind Addresses
Active Connections
Firewall
Unexpected Destinations

Document:

Packages
Pending Updates
Repositories
Unsupported Software

Document:

SELinux/AppArmor
Logging
Auditing
Time Synchronization

Document:

Scheduled Tasks
systemd Units
SSH Keys
Startup Configuration

For every finding:

Title
Severity
Observation
Evidence
Risk
Recommendation
Owner
Status
Finding Risk Priority
Excessive sudo Privilege abuse High
Broad SSH exposure Remote attack surface High
Unknown listener Unapproved exposure High
Stale account Unauthorized access Medium
Weak permissions Data exposure Medium
Unnecessary package Attack surface Low/Medium
Missing centralized logging Detection gap Medium/High

Risk depends on actual context.

Security evidence should be:

Relevant
Accurate
Timestamped
Protected
Minimized
Traceable

Do not place:

Passwords
Password Hashes
Private Keys
API Tokens
Application Secrets

into ordinary assessment reports.

Capture appropriate evidence for:

  • System identity
  • OS and kernel
  • Uptime
  • User inventory
  • Group inventory
  • UID 0 review
  • sudo review
  • SSH review
  • Authentication activity
  • Filesystem permissions
  • World-writable resources
  • SUID files
  • SGID files
  • Process inventory
  • Service inventory
  • Package inventory
  • Listening ports
  • Active connections
  • Firewall
  • SELinux/AppArmor
  • Logging
  • Auditing
  • Time synchronization
  • Scheduled tasks
  • Persistence review
  • Security findings

Without relying on a graphical security scanner, determine:

01 Which Linux system is this?
02 Which users can log in?
03 Who has administrative access?
04 Which service accounts exist?
05 Which sensitive permissions are excessive?
06 Which SUID/SGID files exist?
07 Which processes are running?
08 Which services start automatically?
09 Which ports are listening?
10 Which processes own those ports?
11 Which external connections exist?
12 Which firewall controls are active?
13 Is SELinux/AppArmor enforcing?
14 Are important events logged?
15 Is auditing available?
16 Which scheduled tasks exist?
17 Are there unexpected persistence mechanisms?
18 What changed recently?
19 What is the highest-risk issue?
20 What should be remediated first?

Part 81 — Professional Security Assessment Workflow

Section titled “Part 81 — Professional Security Assessment Workflow”

Use this workflow in real environments:

01 Authorization
02 Scope
03 Asset Identification
04 Baseline Collection
05 Identity Review
06 Privilege Review
07 Authentication Review
08 Filesystem Review
09 Process Review
10 Service Review
11 Software Review
12 Network Review
13 Security Control Review
14 Logging Review
15 Persistence Review
16 Evidence Correlation
17 Risk Assessment
18 Findings
19 Remediation
20 Validation
21 Reporting

Part 82 — Common Linux Security Mistakes

Section titled “Part 82 — Common Linux Security Mistakes”

Avoid:

Assuming Unknown Means Malicious
Deleting Evidence Immediately
Disabling SELinux to Fix Applications
Disabling Firewall to Troubleshoot
Using chmod 777
Ignoring Service Accounts
Ignoring SSH Keys
Ignoring Outbound Connections
Ignoring IPv6
Ignoring Scheduled Tasks
Ignoring systemd Persistence
Ignoring Cloud-Level Controls
Trusting Shell History as Complete Evidence
Applying Hardening Without Business Context
Reporting Findings Without Evidence
Patch When Needed
Manual Account Management
Basic Firewall
Documented Hardening
Access Reviews
Central Logging
Approved Services
Configuration Management
SIEM
EDR
Automated Compliance
Central IAM
Vulnerability Management
Continuous Monitoring
Configuration Drift Detection
Automated Response
Policy as Code
Just-in-Time Privilege
Threat Detection

The skills practiced in this lab directly support:

Linux Security Engineer
SOC Analyst
Incident Responder
Cloud Security Engineer
Security Consultant
DevSecOps Engineer
Platform Security Engineer
Cybersecurity Analyst
Security Architect

You discover an unfamiliar Linux process. What should you do?

Identify PID
Identify User
Identify Parent
Identify Executable
Review Network Activity
Review Logs
Compare Baseline
Determine Context

You find an unknown listening port. Is the server compromised?

Not necessarily.

Investigate:

Process
Service
User
Executable
Business Requirement
Network Exposure
Logs

before concluding.

You discover suspicious activity. Should you immediately delete the suspicious file?

Usually not before considering evidence requirements and the incident-response procedure.

First determine whether you need to preserve:

File Metadata
Process Information
Connections
Logs
Timeline

A server is fully patched. Is it secure?

Not necessarily.

It may still have:

Weak IAM
Excessive sudo
Bad SSH Configuration
Open Ports
Weak Permissions
Disabled Logging
Poor Security Controls

Why is Linux administration knowledge essential for security analysts?

Because you cannot reliably identify:

Abnormal Linux Behavior

without understanding:

Normal Linux Behavior
  1. What is Linux security?
  2. What is a Linux security baseline?
  3. Why is asset identification important?
  4. How do you identify the Linux distribution?
  5. Why is kernel information security-relevant?
  6. What is UID 0?
  7. How would you identify privileged accounts?
  8. Why are service accounts security-sensitive?
  9. What is least privilege?
  10. Why are shared administrator accounts risky?
  11. How would you review sudo access?
  12. Why should SSH keys be reviewed?
  13. What is a stale SSH key?
  14. What are world-writable files?
  15. What is the sticky bit?
  16. What is SUID?
  17. What is SGID?
  18. Why should special-permission files be baselined?
  19. What are orphaned files?
  20. Why are file timestamps useful?
  21. What is file integrity monitoring?
  22. How would you investigate an unknown process?
  23. Why is PPID useful during investigation?
  24. What information does /proc expose?
  25. How would you identify running services?
  26. What is the difference between running and enabled services?
  27. How do you identify listening ports?
  28. Why is a wildcard bind security-relevant?
  29. How would you investigate an outbound connection?
  30. Why should egress traffic be monitored?
  31. What is host firewalling?
  32. Why is IPv6 part of a security assessment?
  33. Why should installed packages be inventoried?
  34. Why are software repositories security-relevant?
  35. What is SELinux?
  36. Why should SELinux not simply be disabled?
  37. What is AppArmor?
  38. Why is centralized logging important?
  39. What is Linux auditing?
  40. Why is time synchronization important?
  41. Why should scheduled tasks be reviewed?
  42. How can systemd relate to persistence?
  43. Why are authorized SSH keys part of persistence review?
  44. What is evidence preservation?
  45. Why is timeline reconstruction important?
  46. What is event correlation?
  47. What is defense in depth?
  48. How does Linux security relate to cloud security?
  49. How does Linux security support Kubernetes security?
  50. What is your Linux security assessment methodology?
  • Identified OS
  • Identified kernel
  • Reviewed uptime
  • Created baseline
  • Recorded assessment scope
  • Reviewed users
  • Reviewed UID 0
  • Reviewed groups
  • Reviewed service accounts
  • Reviewed logged-in users
  • Reviewed login history
  • Reviewed sudo
  • Reviewed administrative groups
  • Reviewed shared privileged identities
  • Reviewed SUID
  • Reviewed SGID
  • Reviewed SSH
  • Reviewed authorized keys
  • Reviewed authentication events
  • Reviewed remote access exposure
  • Reviewed sensitive permissions
  • Reviewed home directories
  • Reviewed world-writable files
  • Reviewed shared directories
  • Reviewed recent changes
  • Understood file integrity monitoring
  • Reviewed running processes
  • Reviewed CPU usage
  • Reviewed memory usage
  • Investigated process ancestry
  • Correlated processes with identities
  • Reviewed running services
  • Reviewed enabled services
  • Mapped services to business requirements
  • Investigated unexpected services
  • Reviewed listening ports
  • Mapped ports to processes
  • Reviewed active connections
  • Reviewed unexpected destinations
  • Reviewed firewall controls
  • Reviewed installed packages
  • Reviewed patch status
  • Reviewed repositories
  • Identified unnecessary software
  • Reviewed SELinux/AppArmor
  • Reviewed logging
  • Reviewed auditing
  • Reviewed time synchronization
  • Reviewed scheduled tasks
  • Reviewed systemd timers
  • Reviewed enabled services
  • Reviewed SSH keys
  • Reviewed startup mechanisms
  • Built an event timeline
  • Correlated multiple evidence sources
  • Preserved relevant evidence
  • Identified suspicious activity
  • Distinguished evidence from assumptions
  • Created findings
  • Assigned risk
  • Created recommendations
  • Documented evidence
  • Produced final assessment report

When approaching any Linux server, think:

WHAT IS THIS SYSTEM?
WHO CAN ACCESS IT?
WHO HAS PRIVILEGE?
WHAT SOFTWARE EXISTS?
WHAT IS RUNNING?
WHAT IS EXPOSED?
WHO IS IT TALKING TO?
WHAT HAS CHANGED?
WHAT STARTS AUTOMATICALLY?
WHAT SECURITY CONTROLS EXIST?
CAN WE SEE WHAT HAPPENED?
WHAT IS DIFFERENT FROM BASELINE?

You have completed the five core Linux labs:

Lab 01 — Linux Administration
Lab 02 — Linux Hardening
Lab 03 — Linux IAM
Lab 04 — Linux Networking
Lab 05 — Linux Security

You have progressed from:

Linux User

to:

Linux Administrator
Linux Security Administrator
Linux Security Analyst

More importantly, you now understand the security workflow:

BASELINE
OBSERVE
COLLECT
CORRELATE
ANALYZE
PRIORITIZE
REMEDIATE
VALIDATE
DOCUMENT

➡️ Runbook 01 — Linux Incident Investigation

The labs taught you individual technical skills.

The runbooks will now teach you how to apply those skills as repeatable professional operational procedures.

In the next runbook, you will learn how to respond when:

SOC Alert
Suspicious Linux Host
Initial Triage
Identity Investigation
Process Investigation
Network Investigation
Persistence Review
Log Correlation
Timeline Reconstruction
Scope Assessment
Containment Decision
Evidence and Reporting

Your Linux journey now moves into operational security:

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