Docsity

CS155 Computer and Network Security, Lecture notes of Computer Networks

Partial preview of the text

Download CS155 Computer and Network Security and more Lecture notes Computer Networks in PDF only on Docsity!

Security Principles and OS Security

CS155 Computer and Network Security

Vulnerabilities are Inevitable

Any single buffer overflow, use-after-free, or null pointer

dereference might allow an attacker to run malicious code

We’re getting better at finding and preventing bugs, but

vulnerabilities are still common. There will always be bugs.

Example: In January 2021, Qualys discovered a heap overflow

in sudo that allows users to run programs with the security

privileges of another user. The bug was introduced in 2011

(CVE-2021-3156) and affected Linux, Mac OS, and BSD.

Systems must be designed to be

resilient in the face of both software

vulnerabilities and malicious users

Defense in Depth Systems should be built with security protections at multiple layers Example: What if there’s a vulnerability in Chrome’s Javascript interpreter?

  • Chrome should prevent malicious website from accessing other tabs
  • OS should prevent access to other processes (e.g., Password Manager)
  • HW should prevent permanent malware installation in device firmware
  • Network should prevent malware from infecting nearby computers

Principles of Secure Systems ✓ Defense in depth ✓ Principle of least privilege ✓ Privilege separation ✓ Open design (Kerckhoffs's principle) ✓ Keep it simple

Least Privilege Users should only have access to the data and resources needed to perform routine, authorized tasks Real World Examples:

  • Faculty can only change grades for classes they teach
  • Only employees with background checks have access to classified documents

Privilege Separation Least Privilege requires dividing a system into parts to which we can limit access Known as Privilege Separation Segmenting a system into components with the least privilege needed can prevent an attacker from taking over the entire system

Security Subjects Least privilege and privilege separation apply to more than just users!

  • UNIX: A^ User^ should only be able to read their own^ files
  • UNIX: A^ Process^ should not be able to read another process’s memory
  • Mobile: An^ App^ should not able to edit another app’s data
  • Web: A^ Domain^ should only be able to read its own cookies
  • Networking: Only trusted a^ Host^ should be able to access^ file server Least Privilege: Users Subjects should only have access to access the data and resources needed to perform routine, authorized tasks

UNIX Security Model

UNIX Security Model

Subjects (Who?)

  • Users, processes

Objects (What?)

  • Files, directories
  • Files: sockets, pipes, hardware devices, kernel objects, process data

Access Operations (How?)

  • Read, Write, Execute

UNIX Security Model

Subjects (Who?)

  • Users, processes

Objects (What?)

  • Files, directories
  • Files: sockets, pipes, hardware devices, kernel objects, process data

Access Operations (How?)

  • Read, Write, Execute

UNIX Security Model

Subjects (Who?)

  • Users, processes

Objects (What?)

  • Files, directories
  • Files: sockets, pipes, hardware devices, kernel objects, process data

Access Operations (How?)

  • Read, Write, Execute

UNIX Security Model

Subjects (Who?)

  • Users, processes

Objects (What?)

  • Files, directories
  • Files: sockets, pipes, hardware devices, kernel objects, process data

Access Operations (How?)

  • Read, Write, Execute

Users UNIX systems have many accounts

  • Service accounts
    • Used to run background processes (e.g., web server)
  • User accounts
    • Typically tied to a specific human Every user has a unique integer ID — User ID — UID UID 0 is reserved for special user root that has access to everything - Many system operations can only run as root