DEV Community

Faizan Nazir
Faizan Nazir

Posted on

Linux File Permissions & Ownership Explained for SOC Analysts (Day 10— Linux Phase)

Introduction
Linux is the backbone of modern infrastructure. From cloud servers and firewalls to SIEM platforms and security tools, Linux runs silently behind most enterprise environments. For a Security Operations Center (SOC) analyst, understanding Linux is not optional — it is a core skill.

One of the most critical security mechanisms in Linux is its file permission and ownership model. Attackers abuse permissions to execute malware, hide persistence, escalate privileges, and erase evidence. SOC analysts rely on permission analysis to detect anomalies, investigate incidents, and build accurate timelines.

Become a Medium member
This article covers Linux File Permissions and Ownership in deep detail from a SOC analyst’s perspective. It is designed to take you from absolute beginner to security-aware professional, with real-world examples, attack scenarios, and investigation insights.

Why Linux File Permissions Matter in SOC
In SOC operations, analysts constantly deal with:

Authentication logs
System logs
Application logs
Scripts and binaries
Configuration files
Evidence files during incident response
Every one of these objects is protected by Linux permissions.

From a SOC perspective:
Incorrect permissions = security risk
Permission changes = potential indicator of compromise
Executable permissions = possible malware
Ownership changes = possible log tampering
Understanding permissions allows SOC analysts to:

Detect unauthorized access
Identify privilege escalation
Spot malware execution
Preserve forensic evidence
Reconstruct attacker activity
Understanding Linux File Permission Basics
Linux follows a Discretionary Access Control (DAC) model. This means:

The owner of a file controls who can access it
Permissions define what actions are allowed
Every file and directory in Linux has:

A type
Permissions
An owner (user)
A group
These attributes decide:

Who can read the file
Who can modify it
Who can execute it
Viewing Permissions Using ls -l
The most common command to inspect permissions is:

ls -l
Example output:

-rw-r--r-- 1 root root 23456 Jan 20 10:30 auth.log
This single line contains critical security information.

Breaking Down ls -l Output

  1. File Type Indicator The first character represents the file type:
  • → Regular file d → Directory l → Symbolic link c → Character device b → Block device SOC Insight Unexpected symbolic links can indicate privilege abuse Writable directories can allow attackers to drop payloads Device files with wrong permissions can expose system resources
  • Permission String The next 9 characters represent permissions:

rw-r--r--
These are divided into three groups:

rwx | rwx | rwx
User Group Other
Each group defines what actions are allowed.

Understanding r, w, x Permissions
Read (r)
Allows viewing file content
Allows listing directory contents
SOC usage:

Reading logs
Reviewing configuration files

Inspecting scripts
Risk:

Unauthorized read access can leak sensitive data
Write (w)
Allows modifying file content
Allows deleting or renaming files
SOC risk:

Log tampering
Evidence deletion
Configuration manipulation
Write permission on logs is a major red flag.

Execute (x)
Allows running a file as a program
Allows entering a directory
SOC risk

Malware execution
Backdoor activation
Persistence mechanisms
Logs should never be executable.

User, Group, and Others Explained
Linux permissions apply to three categories:

User (Owner)
The file creator or assigned owner
Has primary control over the file
Group
A collection of users
Often used for team-based access
Others
All remaining users on the system
SOC Insight
System logs are usually owned by root
Normal users should not have write access to logs
Excessive access to “others” increases attack surface
Numeric Permission System
Linux represents permissions numerically for simplicity.

Permission Values
Read (r) = 4
Write (w) = 2
Execute (x) = 1
Values are added together.

Examples
7 = rwx (4+2+1)
6 = rw- (4+2)
5 = r-x (4+1)
4 = r-- (4)
Common Permission Modes (SOC-Relevant)
644 — rw-r--r--
Common for log files
Owner can read/write
Others can only read
755 — rwxr-xr-x
Common for scripts and binaries
Executable by all users
600 — rw-------
Used for sensitive files
SSH keys, credentials, tokens
777 — rwxrwxrwx
Extremely dangerous
Full access to everyone
Strong indicator of misconfiguration or compromise
Changing Permissions with chmod
The chmod command modifies permissions.

Syntax
chmod
Examples
chmod 644 auth.log
chmod 600 id_rsa
chmod 755 monitor.sh
SOC Relevance of chmod
Attackers often:

Add execute permission to malicious files
Remove write permission to logs after tampering
Change permissions to maintain persistence
Red Flags
Sudden execute permission on unknown files
Permission changes on /var/log
World-writable system files
Symbolic Permission Changes
Linux also supports symbolic notation:

chmod +x file.sh
chmod -w auth.log
SOC usage:

Detect when malware becomes executable
Identify defensive actions by attackers to lock logs
File Ownership Concepts
Each file has:

One owner (user)
One group
Ownership determines who can change permissions.

Typical SOC Observations
Logs owned by root
Configuration files owned by system users
Ownership changes are uncommon in normal operations
Changing Ownership with chown
The chown command changes ownership.

Syntax
chown user:group file
Example
chown root:root auth.log
chown user:group file
chown root:root auth.log
SOC Importance of Ownership Changes
Ownership changes can indicate:

Covering attacker activity
Persistence setup
Privilege escalation
SOC analysts should:

Record ownership changes
Correlate with login events
Include in incident timelines
Real-World SOC Attack Scenarios
Scenario 1: Log Tampering
Attacker gains access
Changes permissions to allow deletion
Deletes authentication logs
Removes write access to hide changes
SOC detection:

Permission audit
File metadata analysis
Timeline correlation
Scenario 2: Malware Execution
Malicious file uploaded
Execute permission added using chmod
File executed
Persistence established
SOC detection:

Unexpected executable files
Permission change logs
Process creation events
Scenario 3: Privilege Abuse
Misconfigured permissions allow normal user to modify system files
Attacker escalates privileges
SOC response:

Identify misconfiguration
Correct permissions
Document exposure
Permissions in Incident Response & Forensics
During incident response:

Permissions help preserve evidence
Incorrect permissions can contaminate forensic data
Analysts must avoid modifying timestamps
Best practice:

Always inspect permissions before analysis
Use read-only access when possible
Document original permissions
Why SOC Analysts Must Master Linux Permissions
Linux permissions are:

A defensive control
An attack vector
A forensic artifact
SOC analysts use permissions to:

Validate alerts
Detect compromise
Identify attacker behavior
Strengthen system hardening
Mastery of permissions separates a beginner from a job-ready SOC analyst.

Day 2 — Linux Phase Summary
Linux permissions control access and execution
Permissions are divided into user, group, and others
Numeric permissions simplify management
chmod modifies permissions
chown modifies ownership
Permission misuse is a strong indicator of compromise
SOC analysts must always analyze permissions during investigations
What’s Next?
In Day 10 of the Linux Phase, we move into:

Linux File System Hierarchy
/var/log deep dive
Log reading commands (cat, less, head, tail)
Real SOC log analysis
🚀 Final Note
If you are serious about becoming a SOC analyst, Linux permissions are not theory — they are daily reality. Every investigation starts and ends with access control. Learn it deeply, practice it daily, and analyze it critically.

Top comments (0)