Questions tagged [operating-systems]

The operating system is the software component that provides abstraction of physical hardware, and provides a generalized model for application software to execute without the need for specific hardware knowledge. Questions on the topic of operating system security should use this tag; you may also like to use one of the [windows], [linux] or [macos] tags.

Operating systems are critical to security because they provide the fundamental mechanisms for control of processes, separation of data, control of access to data, and control of access to system resources.

Questions you may have / recommended reading

Operating system architecture

Operating systems are built according, simply speaking, to two pure philosophies:

  • Monolithic Kernels - these are huge binary blobs containing the entire compiled code of the operating system (hence "monolithic"). Such code bases benefit from being able to directly alter (with locks) variables belonging to other kernel threads and using locks as concurrency guards; as such these types of kernels are often very quick.
  • Microkernels, by contrast, often contain a small core and push the majority of operating system features out into "servers" i.e. processes which send messages back to the core component and to other components to get work done. Due to the need for message queues and message processing, these kernels often perform more slowly.

A simple comparison is available which roughly explains the difference. The security implications of the design of each kernel lie in the use of the CPU's security features; microkernels are able to run much more of the operating system as unprivileged processes.

In reality, modern operating systems borrow features from both types of kernel design.

Access Control

A number of access control systems are in use / considered in operating systems:

  • Discretionary Access Control, a method of access control that allows child processes to inherit the privileges of the context (i.e. user or parent process) from which they were launched.
  • Mandatory Access Control - a method of access control through which each subject (process, user) is given explicit permissions on an object (resource) regardless of the parent's rights.
    • Role-based Access Control is a third and increasingly more prevalent method of access control through which more complicated organisational structures are used to determine privilege.

Currently, there are also a number of research-area access control methods including:

  • multi-level/multi-category security. These types of access control are often implemented on top of MAC and add labels and/or category requirements to further isolate data.
  • capability-based security is an entirely different concept to the use of access control lists (ACLs) and requires processes pass/inherit/ask for capabilities and possessing these capabilities gives them the right to perform actions. Capability-based security is strongly associated with microkernel-based design.

Process/Memory Isolation

Most operating systems provide some form of process isolation capability and utilise hardware to do so. By far the most common commodity chip is the x86 and descendant families of processor, which provide several abilities:

  • CPU "rings" or privilege levels. Labelled 0, 1, 2 and 3, these determine what an executing process can do to the system.
  • Memory segmentation is common in older x86 systems and was a method of dividing up the address space.
  • Memory paging - the ability to swap memory to and from disk as required, to keep virtual memory free.
  • Virtual memory - using the concept that memory can be paged out to increase free space, most operating systems take advantage of the ability to swap out entire processes when not in use and thus provide memory isolation (in addition to the protections provided by privilege levels). In addition, it is possible to design the operating system such that the OS and userland do not even share an address space.
  • No Execute bits, W^X etc implement software/hardware concepts of the idea that writeable memory for user processes should not also be executable, to prevent stack-based vulnerabilities.

Virtualization

Virtualization is the process of making an operating system run on emulated hardware, or co-exist on common hardware such that it is unaware it does not have complete control of the system. For more information, have a look at the closely-related tag.

Resources

417 questions
468
votes
13 answers

Are passwords stored in memory safe?

I just realized that, in any language, when you save a password in a variable, it is stored as plain text in the memory. I think the OS does its job and forbids processes from accessing each other's allocated memory. But I also think this is somehow…
Antoine Pinsard
  • 4,597
  • 4
  • 15
  • 27
154
votes
14 answers

Why is the OS obfuscation defense against "It's a Unix system!" not widely implemented?

The Jurassic Park scene referenced in the title is infamous for how ludicrous it sounds to those who are tech literate. But it also illustrates what seems to me to be a glaringly huge hole in web security, particularly IoT devices--as soon as…
Indigenuity
  • 1,323
  • 2
  • 7
  • 13
98
votes
13 answers

Why do we lock our computers?

It's common knowledge that if somebody has physical access to your machine they can do whatever they want with it1. So why do we always lock our computers? If somebody has physical access to my computer, it doesn't really matter if it's locked or…
Tom Marthenal
  • 3,272
  • 4
  • 22
  • 26
98
votes
9 answers

Can a virus destroy the BIOS of a modern computer?

In the late 1990s, a computer virus known as CIH began infecting some computers. Its payload, when triggered, overwrote system information and destroyed the computer's BIOS, essentially bricking whatever computer it infected. Could a virus that…
user73910
  • 791
  • 1
  • 5
  • 7
89
votes
9 answers

Hardening Linux Server

We have already had questions on here about Hardening Apache, Hardening PHP and Securing SSH. To continue this trend I am interested in what steps people take to harden Linux servers. As in what steps do people always take when setting up a new…
Mark Davidson
  • 9,367
  • 6
  • 43
  • 61
81
votes
8 answers

Risks of giving developers admin rights to their own PCs

I need to convince my internal IT department to give my new team of developers admin rights to our own PCs. They seem to think this will create some security risk to the network. Can anyone explain why this would be? What are the risks? What do IT…
carolineggordon
  • 928
  • 1
  • 7
  • 8
66
votes
4 answers

Is an up-to-date browser secure on an out-of-date OS?

Windows 7 support will end on January 14, 2020. Assuming that after that day I still use an updated browser, is it true that I'm still safe? Can it "patch" the OS-based security holes? Minor question: typically, how long would the browsers stop…
Ooker
  • 1,539
  • 1
  • 12
  • 17
63
votes
3 answers

How does the Windows "Secure Desktop" mode work?

Can anyone explain (or provide a link to a simple explanation) of what the Windows "Secure Desktop" mode is and how it works? I just heard about it in the KeePass documentation (KeePass - Enter Master Key on a Secure Desktop) and would like to…
snth
  • 965
  • 1
  • 9
  • 10
60
votes
10 answers

Why don't OS's make keystrokes available to only the current app?

Seems like a relatively obvious way to prevent (software) keylogging would be to force only the current (in-focus) app to be able to receive keystrokes. There could be a way to make explicit exceptions for macro apps etc. Querying the exception…
user66309
  • 679
  • 1
  • 5
  • 5
58
votes
8 answers

Is it safe to trust a Docker container?

When it comes to Docker, it is very convenient to use a third party container that already exist to do what we want. The problem is that those containers can be very complicated and have a large parent tree of other containers; they can even pull…
0x1gene
  • 783
  • 1
  • 6
  • 10
53
votes
7 answers

Can you hide your OS from programs? Can you trick a program into thinking you are on a different OS?

Is there a way or program to make another program think I am using a different system? For example, let's say currently I am on Windows 7 32-bit and I want the program to detect Windows 10 64-bit or perhaps Windows XP. Can I do something similar…
Wolwo
  • 599
  • 1
  • 4
  • 5
53
votes
4 answers

Old OS memory space protection - was it really that bad?

In his book Security Engineering, Anderson really focuses on how in the 90s and early 2000s programs would need to access memory that wasn't their own, and programmers programmed with the assumption the program would be run with administrative…
Celeritas
  • 10,039
  • 22
  • 77
  • 144
48
votes
5 answers

What does Mark Shuttleworth mean by "we have root"?

In a blog post in response to the Amazon privacy controversy, Mark Shuttleworth wrote: Don’t trust us? Erm, we have root. You do trust us with your data already. You trust us not to screw up on your machine with every update. You trust Debian,…
HighCommander4
  • 1,182
  • 1
  • 10
  • 11
45
votes
12 answers

Would it be more secure or not if all computers in the network use the same operating system?

If all the computers use the same operating system, attackers only need to focus on one operating system, would it be unsafe?
user8162924
  • 577
  • 4
  • 4
41
votes
10 answers

Are there any OSes that verify program signatures before executing them?

If so, what are these OSes? Are they specially crafted? How difficult is it to apply this kind of program verification to the everyday OSes we use? If not, why haven't people invented such OSes? Package signature verification is quite common with…
Cyker
  • 1,613
  • 11
  • 17
1
2 3
27 28