# Protection and Security in Operating Systems

An operating system manages some of the most important resources in a computer.

It controls:

*   Memory
    
*   Processes
    
*   Files
    
*   Devices
    
*   User accounts
    
*   Network resources
    

If every program and user had unlimited access to these resources, a single mistake or malicious program could compromise the entire system.

This is why operating systems use protection and security mechanisms.

What Is Protection?

Protection is the set of mechanisms used by an operating system to control how processes and users access system resources.

The main idea is:

«Who is allowed to access what, and what are they allowed to do?»

For example:

Process A ↓ Request Access ↓ Operating System ↓ Allowed / Denied ↓ Resource

Protection focuses on controlling access to resources.

What Is Security?

Security is the broader effort to protect the computer system and its data from unauthorized access, misuse, modification, and other threats.

Security can involve:

*   Authentication
    
*   Authorization
    
*   Access control
    
*   Encryption
    
*   Auditing
    
*   Secure system design
    

Protection is an important part of overall system security.

Why Are Protection and Security Needed?

Imagine a computer with no access controls.

A program could potentially:

*   Read another user's files
    
*   Modify protected system data
    
*   Access another process's memory
    
*   Use resources without permission
    

That would create a very unsafe environment.

Operating systems therefore enforce boundaries between users, processes, and resources.

Authentication

Authentication answers:

«"Who are you?"»

A system may authenticate a user using:

*   Passwords
    
*   Security keys
    
*   Biometrics
    
*   Multi-factor authentication
    

For example:

User ↓ Authentication ↓ Identity Verified

Authentication establishes the identity of the person or entity requesting access.

Authorization

After authentication, the system needs to determine what that identity is allowed to do.

This is called authorization.

Who are you? ↓ Authentication ↓ What can you access? ↓ Authorization

For example, a user may be allowed to read a file but not modify it.

Access Control

Access control determines which users or processes can access particular resources and what operations they can perform.

A simplified example:

File: report.txt

User A → Read ✓ User A → Write ✓

User B → Read ✓ User B → Write ✗

The operating system enforces these rules.

File Permissions

File permissions are one common form of access control.

Unix-like systems commonly use permissions such as:

*   Read
    
*   Write
    
*   Execute
    

These can apply to:

*   Owner
    
*   Group
    
*   Others
    

For example:

Owner → Read / Write Group → Read Others → No Access

This provides a basic layer of protection for files.

Process Isolation

Operating systems also isolate processes from one another.

Normally, one process cannot simply access another process's private memory.

Process A ┌──────────────┐ │ Private │ │ Address Space│ └──────────────┘

Process B ┌──────────────┐ │ Private │ │ Address Space│ └──────────────┘

This isolation helps prevent one faulty application from corrupting another application's memory.

User Mode and Kernel Mode

Privilege separation is another important protection mechanism.

Applications generally run in user mode.

The operating system kernel runs with greater privileges in kernel mode.

User Mode ↓ Restricted Access ↓ System Calls ↓ Kernel Mode ↓ Privileged Operations

This prevents ordinary applications from directly performing many sensitive operations.

Memory Protection

Memory protection helps prevent processes from accessing memory they are not authorized to use.

Modern systems can also use memory permissions such as:

Read Write Execute

For example, a memory region may be readable and writable but not executable.

These protections can help reduce the impact of certain software vulnerabilities.

Protection Domains

A protection domain describes the set of resources and operations that a process or user is allowed to access.

For example:

User A ↓ Files A ↓ Allowed Operations

User B ↓ Files B ↓ Allowed Operations

The operating system enforces these boundaries.

Principle of Least Privilege

An important security principle is least privilege.

It means a user, process, or program should receive only the permissions necessary to perform its task.

For example:

Application ↓ Needs Read Access ↓ Give Read Access ↓ Don't Give Unnecessary Privileges

If a program is compromised, limiting its privileges can reduce the damage it can cause.

Protection and Malware

Protection mechanisms are extremely important when defending against malware.

Malware may attempt to:

*   Access sensitive files
    
*   Steal credentials
    
*   Modify system settings
    
*   Access other processes
    
*   Gain higher privileges
    
*   Disable security controls
    

Operating-system protections can make these actions more difficult.

However, vulnerabilities or stolen privileges can sometimes allow malware to bypass normal restrictions.

Security and Malware Analysis

For malware analysts, understanding operating-system protection is essential.

When analyzing malware, researchers may ask:

*   What permissions does the process have?
    
*   Which files does it access?
    
*   Does it attempt privilege escalation?
    
*   Does it interact with other processes?
    
*   Does it access protected system resources?
    

These questions help reveal what the malware is trying to accomplish.

Protection vs Security

Although the terms are closely related, they are not identical.

Protection ↓ Controls access to resources

Security ↓ Protects the entire system against threats and unauthorized activity

Protection is therefore one important component of operating-system security.

Final Thoughts

Operating-system protection and security mechanisms help keep users, processes, data, and hardware separated and controlled.

The key ideas include:

«Authentication → Who are you? Authorization → What are you allowed to do? Access Control → What resources can you access? Least Privilege → Give only the permissions needed. Isolation → Keep processes and resources separated.»

These concepts form an important foundation for understanding Linux and Windows security.

In the next article, we'll explore Unix Inode Structure and see how Unix-like file systems store information about files.
