UNIT 5 OS NOTES (1)
UNIT 5 OS NOTES (1)
Operating System (OS) Security is a critical aspect of computer security that focuses on
protecting the integrity, confidentiality, and availability of resources managed by an
operating system. This includes data, processes, and hardware, ensuring users and
applications interact securely within the computing environment.
1. User Authentication:
o Verifying user identity using mechanisms like passwords, biometrics, or
multi-factor authentication.
2. Access Control:
o Defining who can access or modify resources, implemented through
permissions and security policies.
3. Security Policies:
o Enforcing rules for acceptable system usage and interactions.
4. Data Protection:
o Encrypting sensitive data and securing storage to prevent leaks or theft.
5. Process Isolation:
o Ensuring processes operate in separate memory spaces to prevent
unauthorized interference.
6. Auditing and Monitoring:
o Tracking system activities to detect and respond to security breaches.
Threats to OS Security
1. Malware:
o Viruses, worms, and trojans can exploit OS vulnerabilities.
2. Privilege Escalation:
o Unauthorized users gaining higher-level access to perform restricted actions.
3. Denial-of-Service (DoS) Attacks:
o Overwhelming system resources to disrupt services.
4. Zero-Day Vulnerabilities:
o Exploiting unpatched flaws in the OS.
5. Social Engineering:
o Manipulating users into bypassing security measures.
By maintaining robust operating system security, organizations and users can significantly
reduce the risks of data breaches and system compromises while ensuring a reliable
computing environment.
Access control models are frameworks that define how access permissions are granted to
users, systems, and processes in an information system. These models are critical for
enforcing security policies and ensuring that sensitive data and resources are only accessible
to authorized entities.
Each model suits specific security requirements and operational contexts. The choice depends
on the organization's security goals, scalability needs, and complexity tolerance.
UNIX operating systems employ robust mechanisms for authentication and authorization to
control access to the system and its resources. These mechanisms ensure that only authorized
users can access specific files, directories, and processes.
1. Authentication in UNIX
Authentication is the process of verifying a user's identity before granting system access.
UNIX primarily uses username-password pairs for this purpose.
Password-Based Authentication:
o Passwords are stored in a hashed form in the /etc/shadow file (earlier in /etc/passwd for
simpler systems).
o Hashing algorithms like MD5, SHA-256, or bcrypt are used to enhance security.
Authentication Flow:
2. Authorization in UNIX
Authorization determines what authenticated users can do within the system. UNIX enforces
this through file and directory permissions.
Permission Types:
Symbol Meaning File Example Directory Example
Permission Representation:
Changing Permissions:
Command: chmod
o Numeric mode:
E.g., chmod 755 file.txt (Owner: all, Group: read/execute, Others:
read/execute).
o Symbolic mode:
E.g., chmod u+w file.txt (adds write permission for the owner).
Ownership:
1. Password Management:
o Enforce strong passwords and periodic changes.
o Use PAM for multi-factor authentication.
2. Restrict File Permissions:
o Follow the principle of least privilege.
o Regularly audit permissions and ownership.
3. Limit Root Access:
o Use sudo for executing privileged commands.
o Avoid direct root logins.
4. Monitor Access:
o Use tools like auditd or log files to track unauthorized access attempts.
1. Authentication Mechanisms
Username-Password Authentication:
o Most common method; passwords are stored in hashed form.
Biometric Authentication:
o Uses fingerprints, facial recognition, or retina scans for secure logins.
Two-Factor Authentication (2FA):
o Combines something the user knows (password) with something they have (e.g., a
phone).
Single Sign-On (SSO):
o Allows users to access multiple systems with one set of credentials.
Pluggable Authentication Module (PAM):
o A modular framework that supports various authentication methods.
3. Encryption Mechanisms
Encryption ensures that sensitive data is secure during storage and transmission.
File Encryption:
o Encrypts files to prevent unauthorized access.
o Example: BitLocker or Linux's LUKS.
Transport Layer Encryption:
o Secures communication over networks using protocols like HTTPS, TLS, and SSL.
Disk Encryption:
o Protects entire disk drives using full-disk encryption tools.
Key Management:
o Ensures secure storage and handling of encryption keys.
4. Process Isolation
Process isolation ensures that processes operate independently, preventing one process from
interfering with another.
Memory Protection:
o Operating systems use virtual memory to isolate process memory.
Sandboxing:
o Restricts applications to a controlled environment.
o Example: Web browsers like Chrome use sandboxes to limit damage from exploits.
Containerization:
o Isolates applications in containers using tools like Docker.
Firewalls:
o Control incoming and outgoing network traffic based on security rules.
Intrusion Detection and Prevention Systems (IDPS):
o Detect and respond to unauthorized access attempts.
Antivirus and Antimalware:
o Detect, quarantine, and remove malicious software.
Secure Boot:
o Verifies the integrity of the OS during startup to prevent boot-level attacks.
Logging and auditing track system activities and provide insights into potential security
breaches.
System Logs:
o Maintain records of logins, file access, and other activities.
o Example: Linux logs in /var/log/.
Audit Trails:
o Record user and system activities for forensic analysis.
Monitoring Tools:
o Tools like Splunk or ELK Stack monitor and analyze logs.
Automatic Updates:
o Keeps the system up-to-date with the latest security patches.
Vendor Notifications:
o Ensures administrators are informed about critical updates.
Managing user accounts and privileges reduces the risk of unauthorized access.
Regular Backups:
o Maintains copies of critical data.
Disaster Recovery Plans:
o Prepares systems for recovery from major failures or attacks.
Malware and threat analysis are critical aspects of cybersecurity aimed at identifying,
mitigating, and preventing malicious software and cyber threats. Malware refers to any
software intentionally designed to cause harm, steal information, or disrupt systems, while
threat analysis evaluates the techniques, tactics, and potential impact of such attacks.
Malware is short for "malicious software" and includes various forms of harmful programs.
1. Viruses:
o Attach to legitimate files and spread when executed.
o Example: File-infecting viruses.
2. Worms:
o Self-replicating programs that spread across networks without human intervention.
o Example: SQL Slammer Worm.
3. Trojans:
o Disguised as legitimate software but perform malicious actions.
o Example: Banking trojans that steal credentials.
4. Ransomware:
o Encrypts files and demands payment for decryption keys.
o Example: WannaCry.
5. Spyware:
o Secretly collects user data and sends it to attackers.
o Example: Keyloggers.
6. Adware:
o Displays intrusive advertisements, often bundled with legitimate software.
o Example: Browser hijackers.
7. Rootkits:
o Hide the presence of malware and provide attackers root-level access.
8. Bots and Botnets:
o Infect systems to perform tasks like DDoS attacks or spam distribution.
9. Cryptojacking:
o Uses compromised systems to mine cryptocurrency without user consent.
1. Delivery:
o The malware reaches the target system through phishing emails, malicious links, or
infected devices.
2. Exploit and Execution:
o Exploits vulnerabilities in software or user behavior to execute payloads.
3. Persistence:
o Maintains access by altering system settings or creating backdoors.
4. Execution of Malicious Actions:
o Encrypting data, stealing credentials, or disrupting operations.
5. Exfiltration and Propagation:
o Stealing sensitive data and spreading to other systems.
3. Threat Analysis
Threat analysis identifies and evaluates potential risks, focusing on understanding the
attacker's methods and objectives.
1. Identification of Threats:
o Use threat intelligence feeds and logs to detect suspicious activity.
2. Categorization:
o Classify threats based on their type (e.g., malware, phishing, insider threats).
3. Threat Modeling:
o Identify potential attack vectors and vulnerabilities in the system.
o Example: STRIDE model (Spoofing, Tampering, Repudiation, Information
Disclosure, Denial of Service, Elevation of Privileges).
4. Impact Assessment:
o Determine the potential consequences of a threat.
5. Mitigation Planning:
o Develop strategies to reduce vulnerabilities and limit impact.
Evidence of malware or cyber threats, such as unusual network traffic, changes in system
files, or unauthorized access attempts.
1. Preventive Measures:
o Regular software updates and patching.
o Use firewalls, antivirus software, and endpoint protection tools.
o Implement multi-factor authentication (MFA).
2. User Awareness:
o Train employees to recognize phishing and other social engineering attacks.
3. Network Segmentation:
o Limit malware spread by dividing the network into isolated segments.
4. Backup and Recovery:
o Maintain regular, secure backups to recover from ransomware attacks.
5. Incident Response Plans:
o Define steps to contain and eradicate malware during an attack.
6. Emerging Threats
AI-Driven Malware:
o Uses artificial intelligence for adaptive and sophisticated attacks.
Advanced Persistent Threats (APTs):
o Targeted attacks often associated with state-sponsored hacking groups.
IoT Threats:
o Exploiting vulnerabilities in Internet of Things (IoT) devices.
Zero-Day Exploits:
o Attacks targeting unpatched vulnerabilities.
Secure Software Development is a methodology that integrates security practices into every
phase of the software development lifecycle (SDLC) to reduce vulnerabilities and protect
applications from threats. It ensures that security is a fundamental aspect of design, coding,
testing, and deployment.
1. Requirement Analysis:
o Identify security requirements alongside functional requirements.
o Consider compliance with security standards.
o Use threat modeling frameworks like STRIDE or PASTA.
2. Design:
o Adopt secure design principles:
Least Privilege: Minimize access rights for users and systems.
Defense in Depth: Use multiple layers of security controls.
Fail-Safe Defaults: Deny access by default and explicitly grant permissions.
o Conduct Architectural Risk Analysis to identify design-level vulnerabilities.
o Use tools like OWASP Threat Dragon for threat modeling.
3. Development (Coding):
o Follow secure coding practices:
Validate all inputs to prevent injection attacks.
Avoid hardcoding sensitive information like passwords or API keys.
Implement proper error and exception handling to prevent information
leakage.
o Use secure coding standards:
OWASP Secure Coding Practices.
CERT Secure Coding Standards.
o Conduct Static Application Security Testing (SAST) to identify vulnerabilities in
the code.
4. Testing:
o Perform Dynamic Application Security Testing (DAST) to find vulnerabilities
during runtime.
o Conduct Penetration Testing to simulate real-world attacks.
o Use tools like Burp Suite, OWASP ZAP, or Veracode.
o Implement Fuzz Testing to uncover edge-case vulnerabilities.
5. Deployment:
o Harden deployment environments:
Disable unused services and ports.
Use HTTPS for secure communication.
o Verify that configurations adhere to security best practices.
o Scan for vulnerabilities in third-party libraries and dependencies.
6. Maintenance:
o Regularly update software to patch vulnerabilities.
o Monitor for threats using tools like intrusion detection systems (IDS).
o Conduct periodic security assessments and audits.
Dynamic Analysis OWASP ZAP, Burp Suite Test running applications for security flaws.
Threat Modeling Threat Dragon, Microsoft TMT Identify threats during design.
Shift Left:
o Address security earlier in the development lifecycle.
Zero Trust:
o Assume no part of the application or network is secure.
Security as Code:
o Automate security processes using tools and scripts.
Continuous Improvement:
o Regularly update security knowledge and adapt to emerging threats.
Evolving Threat Landscape: Keeping up with new vulnerabilities and attack techniques.
Balancing Security and Usability: Avoiding overly restrictive measures that hinder user
experience.
Time and Resource Constraints: Limited resources to implement comprehensive security
practices.
Third-Party Risks: Ensuring security in dependencies and APIs.
Network security and operating systems (OS) are interdependent components of modern
computing environments. The OS serves as the foundation for enforcing security policies,
while network security protects the communication channels and data traveling across
networks.
1. Access Control:
o Managing user permissions and ensuring secure access to network resources.
o Enforcing authentication mechanisms like passwords, biometrics, or tokens.
2. Data Protection:
o Ensuring the confidentiality, integrity, and availability of data stored on and
transmitted from the system.
3. Network Traffic Management:
o Monitoring and filtering incoming and outgoing network traffic.
o Configuring firewalls, proxies, and security policies.
4. System Hardening:
o Disabling unnecessary services, securing open ports, and minimizing vulnerabilities.
Unauthorized Access:
o Gaining access to systems or data without proper credentials.
o Example: Brute force attacks.
Man-in-the-Middle (MitM) Attacks:
o Intercepting and altering communication between two parties.
Denial of Service (DoS) and Distributed DoS (DDoS):
o Overwhelming a network or system with traffic to make it unavailable.
Eavesdropping:
o Capturing unencrypted network traffic to steal sensitive information.
Malware:
o Infecting systems to disrupt services or steal data.
Confidentiality:
o Ensuring that data is accessible only to authorized users.
o Achieved through encryption and access controls.
Integrity:
o Protecting data from unauthorized modifications.
o Implemented using hashing algorithms and secure protocols.
Availability:
o Ensuring that network services are accessible when needed.
o Achieved through redundancy and DoS protection.
3. Network Security Mechanisms
3.1 Firewalls
3.3 Encryption
Secures data in transit and at rest using algorithms like AES or RSA.
Protocols:
o TLS/SSL: Secures communication over HTTPS.
o IPSec: Provides encrypted communication at the network layer.
Ensures only authorized devices and users can connect to the network.
Example:
o Windows Defender Firewall.
o iptables or ufw in Linux.
Protocol Purpose
1. Evolving Threats:
o New vulnerabilities and exploits emerge continuously.
2. Complex Configurations:
o Misconfigurations in OS or network components can expose systems to attacks.
3. Zero-Day Vulnerabilities:
o Exploits for unknown vulnerabilities are hard to defend against.
4. Human Error:
o Weak passwords, phishing attacks, and negligence compromise security.
File system security involves protecting files and directories within an operating system from
unauthorized access, alteration, or destruction. It ensures the confidentiality, integrity, and
availability of data stored on a computer or network storage system.
1. Confidentiality:
o Prevent unauthorized users from accessing sensitive files.
o Example: Encrypting files to restrict access.
2. Integrity:
o Ensure files are not altered by unauthorized users or malicious software.
o Example: File checksums to verify integrity.
3. Availability:
o Ensure files and directories remain accessible to authorized users.
o Example: Protecting files from accidental deletion or corruption.
1. Authentication:
o Verifies the identity of users attempting to access files.
o Methods: Passwords, biometrics, tokens.
2. Access Control:
o Determines what actions a user or process can perform on a file or directory.
o Implemented using permissions and access control lists (ACLs).
3. Encryption:
o Protects the data stored in files by converting it into an unreadable format for
unauthorized users.
o Types:
Full-Disk Encryption: Encrypts all data on a storage device.
File-Level Encryption: Encrypts specific files or folders.
4. Auditing and Logging:
o Tracks file access and modifications for monitoring and forensics.
File permissions are represented in a rwx (read, write, execute) format for:
Example:
Commands:
Changing Permissions:
chmod 750 file.txt
Changing Ownership:
chown user:group file.txt
3.2 Permissions in Windows
Configuring Permissions:
2. Key Management:
o Securely storing and managing encryption keys is crucial to prevent unauthorized
access.
2. Backups:
o Regular backups protect against accidental deletion, corruption, or ransomware.
o Strategies:
Full Backup: Copies all files.
Incremental Backup: Copies only changed files since the last backup.
Differential Backup: Copies all changes since the last full backup.
1. Unauthorized Access:
o Exploiting weak or misconfigured permissions.
2. Malware Attacks:
o Ransomware encrypts files and demands payment for decryption.
3. Data Exfiltration:
o Stealing sensitive files through external devices or network connections.
4. Accidental Deletion:
o Users unintentionally deleting important files.