News for hackers. Stuff that matters.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by pjmlp on Friday May 03, 2024 @01:50AM (#40244518)
OS security always requires a concept of a user, unless you want to run all processes under the same identity.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by ptman on Friday May 03, 2024 @03:31AM (#40245152)
You could do with some other concept than users. E.g. namespaces or capabilities.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by pjmlp on Friday May 03, 2024 @05:18AM (#40245702)
It is another way to call a "user", hence why I used the word indentity instead.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by josephg on Friday May 03, 2024 @05:35AM (#40245794)
No its not. There's all sorts of stuff you can do with capabilities that are really awkward to even think about with users. Like, when a database starts, you can hand it the capabilities it needs to access a specific directory, listen on a specific port and append (but not read) a specific log file.

User based security is usually done by the folder being owned by the database, or an ACL or something. But with capabilities, you don't need to make a database user or set any flags on the folder, or make sure the database's configuration matches the filesystem permissions. The capability is basically a pre baked file handle that can be used directly. And capabilities can do lots more stuff! They can be more fine grained - eg, "Whatsapp can only access these specific photos in my camera roll". And a program can pass a subset of its capabilities to a child process.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by pjmlp on Friday May 03, 2024 @08:06AM (#40246740)
Capabilites have ownership, ownership requires belonging to something, all the way up to booting the OS.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by josephg on Friday May 03, 2024 @08:56AM (#40247172)
Capabilities can just be variables. Variables all belong to something, all the way up to the OS. Would you say variables are a type of user permission? Obviously not. Variables are more versatile than that. So are capabilities.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by Zambyte on Friday May 03, 2024 @08:52AM (#40247140)
This is what uid and gid are used for in Linux respectively. There is only a concept of "user" and "group" when you add a Unix-like operating system in top such as GNU or Alpine.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by rvense on Friday May 03, 2024 @02:29AM (#40244763)
But if you're sandboxing and running all applications in a separate space, is it really correct to refer to it as "users" anymore?
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by jl6 on Friday May 03, 2024 @02:48AM (#40244891)
3rd party apps are written (controlled) by other people, and you are effectively granting that 3rd party permission to run their code on your device, so the user concept isn’t that far off the mark. Since ~nobody reads the source code of 3rd party apps, security vetting is usually a matter of deciding to trust the app’s author, same as how you would trust anyone else that you give a user account to.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by tech2 on Friday May 03, 2024 @03:12AM (#40245023)
You grant them capabilities, a handle which permits access to a particular directory, one which allows network access (or possibly even further limited than that) etc.

No user, just a series of object handles which permit them to perform the task and nothing more.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by jl6 on Friday May 03, 2024 @04:44AM (#40245520)
Sure, but capabilities and handles are technical terms of art below the level at which regular users need to understand. The idea that an app is another person using your computer is not a terrible abstraction in terms of helping people make sense of what's happening.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by josephg on Friday May 03, 2024 @05:41AM (#40245818)
Maybe. But they're a bad mental model for software developers because user based security is way more limited than what you can do with capabilities.

And they're confusing for users, too. Signal isn't another "user" on my phone. Its still me. I just decide what capabilities I grant it on the day. "Yes, you can use location tracking for now - but only until later in the day."

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by pjmlp on Friday May 03, 2024 @05:20AM (#40245716)
Capabilites are just another way of doing role management in processes, and require identities for administration anyway.

It is yet another way of managing processes identitities.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by josephg on Friday May 03, 2024 @05:42AM (#40245824)
A capability is not an identity. And the difference matters a great deal in how you build software that takes advantage of capability based security models.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by pjmlp on Friday May 03, 2024 @08:07AM (#40246744)
Identity is reflected by who owns the capability.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by josephg on Friday May 03, 2024 @08:54AM (#40247150)
Capabilities are often transient. Or in a capability based OS, capabilities are given to a process when it launches and the capabilities naturally go away when the program closes. "Who owns the capability" is the wrong way to think about it. But I'll lose this argument.

Because I suspect if you really want to, you really can think about all "permission systems" as identity systems, and shoehorn in users or something. This cognitive distortion is totally possible. My claim is that its a bad mental model. Its like if you mentally translate all programming ideas into assembler, or java or something, it would make it hard to properly understand and appreciate a lot of higher level programming ideas. Haskell's beauty doesn't make any sense if you mentally translate everything into java. There are programs you just can't write with this mindset, and you would be a terrible haskell programmer.

Its the same with capabilities. They're not user accounts. They're not identities. They can be transient or persisted. Fine grained or coarse grained. A capability can be a function argument - arguably the C FILE struct is a capability object. Or they can be a permission box. Its just, a bigger idea than identity.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by rvense on Friday May 03, 2024 @10:42AM (#40248257)
You're so obviously correct in this. TBH I think the only reason the term "users" come up when it comes to isolating programmes from one another is because that was the only hammer Unix had, so it was coopted. The original point stands, the actual multi-user aspect is completely secondary and unnecessary to 90% of people. I'm the only person who uses my computer, but still I want to be able to isolate application 1 from application 2.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by rbanffy on Friday May 03, 2024 @08:09AM (#40246754)
That sounds like just brutally quartering users into their granular permissions. ;-)
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by tech2 on Friday May 03, 2024 @09:41AM (#40247569)
Maybe? I guess the difference is that with a capability object model (or similar arrangement) the _only_ way the application has to interact with the outside world is via those objects/handles it's been granted. There's no risk of escape because they only have access to the handles the process has been provided.

It's almost the opposite of a permission model in some ways, permission models restrict access to a global array of functionality where capability models allow access only to what's been provided.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by rbanffy on Friday May 03, 2024 @10:25AM (#40248038)
Sorry. I was joking. It feels like you are giving applications small fragments of the user.
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by tech2 on Friday May 03, 2024 @11:01AM (#40248463)
Sorry, I appreciate the joke (really :) ) but I also worry that people keep trying to add the concept of "users" or an existing role or permissions model into capability-based systems when they're unnecessary.

You could maybe model or emulate a user in a capability system by providing the login's session manager an object with read/write access to the configured "user" directory, read and execute access to an applications collection, and full access to the root window. From there, when the user starts a new application it's given an object with access to a window created for it (by calling "createWindow" on the root window object, so it can't even do something like enumerate other windows or whatever), and whichever other requirements were configured as part of its install.

It's capabilities all the way down with no "user" involved.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by saagarjha on Friday May 03, 2024 @03:02AM (#40244966)
This is a very Android centric viewpoint ;)
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by lproven on Friday May 03, 2024 @04:40AM (#40245506)
Unpacking that witty but cryptic comment:

Yes, you can have privilege-based security without user accounts, if you accept that you do not have control over your own hardware because only the OS vendor has administrative rights.

In other words: yes, you can have no-sign-in and no user accounts, but it's still there and you don't have admin access to your own computer.

Stepping back a level:

Smartphone OSes do not show accounts and permissions, but they are still there, just concealed. Same as they still have complex filesystems, but they are hidden.

Stepping back another level:

This is a bad way to design OSes: when you need to hide away major parts of the functionality, then you shouldn't have that functionality. It should not be in your design in the first place.

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by logicprog on Sunday May 05, 2024 @08:50AM (#40264480)
> Yes, you can have privilege-based security without user accounts, if you accept that you do not have control over your own hardware because only the OS vendor has administrative rights.

Or maybe just that the really in-depth administration and modification of your operating system happens prior to the OS running on your device, when it's being built — as a sort of configuration or specification step that happens prior to even installing the operating system or booting up your computer in the the first place, in a continuous integration system in the cloud perhaps, or on another existing computer? That's kind of how Fedora Silverblue works — almost everything you do is completely in unprivileged space, in a container or with a flatpak sandbox, or through policykit; you basically never use the root account at all, because you can't really do a whole lot of really in-depth customization of your OS internals on the operating system image that's actually installed and running on your system. Instead, you specify the modifications you want to make to an upstream image using something like BlueBuild[1] and then those modifications are automated and happen prior to anything ever hitting your computer in an automated ci/cd system (which could theoretically be self-hosted).

Like, I think there is a way to adapt the security and reliability benefits of the way e.g. macOS works that doesn't take control away from the user, just moves it somewhere else. And I think it's much safer for all of the really deep modification of your system, all of the system administration you do as the root user, to be essentially air gapped from the computer that you're actually running various applications and installing and building things and curling to bash on, on a system that's ostensibly clean.

[1]: https://blue-build.org/

Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by pjmlp on Friday May 03, 2024 @05:25AM (#40245745)
Even iOS has different users for all those processes running on the device. :)
Re:Got an old Raspberry Pi spare? Try RISC OS. It is, someth... by saagarjha on Sunday May 05, 2024 @07:08AM (#40263933)
Not to any reasonable capacity