Live data from Hacker News

Why GNU su does not support the `wheel' group (2002)

ftp.gnu.org

141–150 of 150 posts

Re: Why GNU su does not support the `wheel' group (2002)

#141
post #101

Earlier quoted context omitted.

That's why the same question really applies to standard but insane practice of using sudo to get root. There is no security difference between root and lowuser that can sudo into root. Sudoing into root from lowuser account is in some scenarios potentially more dangerous than just using both accounts separately, as the user who uses root regularly/very often gets accustomed to the fact his commands are powerful and c…

Yeah I don’t really understand why when I ssh into a VM in the cloud I have to first connect as a static dummy username like ec2-user then sudo to root.

Yeah. From http://ec2-downloads.s3.amazonaws.com/AmazonLinuxAMIUserGuid... :

> To prevent remote root exploits, the Amazon Linux AMI does not allow remote root login via SSH[...] By default, the only account that can log in remotely via SSH is ec2-user. The ec2-user has sudo privileges.

Can someone please explain how this makes any sense for better security. It seems to be just a security theater.

Re: Why GNU su does not support the `wheel' group (2002)

#142
post #16

Earlier quoted context omitted.

Yes, Unix was designed to protect users from each other but the modern need is to protect applications/invocations from each other. It is unfortunate that Unix wasn't really designed for the modern use case. Basically https://xkcd.com/1200/

The irony behind it is that one could argue that we are using UNIX wrong, because technically each program should run as its own user with its own groups. Which is what apparmor and firejail/sandboxes kind of want to embrace but in practice people just care too less.

Isn't this what Android does? Every app has it's own user and group and you only get to manipulate "kinda-global-state" thru platform APIs.

Re: Why GNU su does not support the `wheel' group (2002)

#143

Earlier quoted context omitted.

Have you heard of user namespaces? They would match all your requirements it seems.

I have but I don’t agree that they do. From what I understand, Linux user namespaces require you to reserve a UID range for each namespace to be mapped to its parent. Since you only have 32-bits to play with, you are forced to map multiple UIDs in the child namespace to the same UID in the parent, while many security decisions are based on the root user namespace UID only. So this is actually a lot more limiting and…

> you are forced to map multiple UIDs in the child namespace to the same UID in the parent

Is that really a limit or just a thing for convenience?

I don't think besides 0 in namespace being the actual user in the actual system as a good convenience, that there is any "need" for pids per root-pid, and even if that happened it would save "root-pids".

And I find it unlikely as of now that a system would reach the 16-bit limits of running more that 65000 applications on a single system without hitting some other limit like /proc/sys/kernel/pid_max or /proc/sys/fs/file-max first.

Re: Why GNU su does not support the `wheel' group (2002)

#144
post #138

Earlier quoted context omitted.

Snowden is using and recommending Qubes [0]. Only 25% of Xen bugs on average affect Qubes [1] and never lead to escapes. What is restrictive about Qubes? I do everything I need on it. [0] https://twitter.com/Snowden/status/781493632293605376 [1] https://www.qubes-os.org/security/xsa/

Don't do things just because twitter persona says so. Is there an independent security audit of Qubes that checks its factual capabilities in security? > Never lead to escapes Escape is the highest form of security failure. I'm talking about data access and exfiltration. Do you store all your important data on a VM with no internet access? Even Qubes users don't, it's hard to work with. Then it's Firefox/ kernel bug…

> twitter persona

Did you just call Snowden a "twitter persona"? You're not serious. Not sure if I should reply further after that.

> Do you store all your important data on a VM with no internet access? Even Qubes users don't

Yes, I do. And I'm a Qubes user. There are many more users like me on their forums. This is much more convenient than you think: you can easily and securely copy/paste passwords wherever needed.

Re: Why GNU su does not support the `wheel' group (2002)

#145
post #138

Earlier quoted context omitted.

Don't do things just because twitter persona says so. Is there an independent security audit of Qubes that checks its factual capabilities in security? > Never lead to escapes Escape is the highest form of security failure. I'm talking about data access and exfiltration. Do you store all your important data on a VM with no internet access? Even Qubes users don't, it's hard to work with. Then it's Firefox/ kernel bug…

> twitter persona Did you just call Snowden a "twitter persona"? You're not serious. Not sure if I should reply further after that. > Do you store all your important data on a VM with no internet access? Even Qubes users don't Yes, I do. And I'm a Qubes user. There are many more users like me on their forums. This is much more convenient than you think: you can easily and securely copy/paste passwords wherever needed…

I am serious. He is famous for leaking interesting US gov documents and running away, but then he's become a celebrity who talks and writes on the internet. What computer security work is Snowden known for that makes him an authority on computer security? If let's say Kevin Mitnick said Qubes is a solid product for data protection it would be interesting; Snowden, not much.

What about that audit?

If you keep all your important data off internet, that's good for you, and Qubes helps.

Re: Why GNU su does not support the `wheel' group (2002)

#146
post #117

Earlier quoted context omitted.

That limits your application though. It means you have to use the system file picker. For many apps that might be fine. But it means you can't have something like vim or emacs where you open files with a command. Or have an option that does something like open a sibling .h file when you are editing a .c file. Or search up the directory to find the applicable .editorconfig file.

So why does it work for Mac, Android, and iOS?

In fact, it doesn't work. Both Android and macOS apps will commonly ask for "full filesystem access" permissions for this exact purpose, which sort of defeats the point (for those apps at least). I don't use iOS enough to speak to how this is handled there, but the few times I've had to wrangle some files on there it made me want to smash my head into the wall.

Re: Why GNU su does not support the `wheel' group (2002)

#147

Earlier quoted context omitted.

I have but I don’t agree that they do. From what I understand, Linux user namespaces require you to reserve a UID range for each namespace to be mapped to its parent. Since you only have 32-bits to play with, you are forced to map multiple UIDs in the child namespace to the same UID in the parent, while many security decisions are based on the root user namespace UID only. So this is actually a lot more limiting and…

> you are forced to map multiple UIDs in the child namespace to the same UID in the parent Is that really a limit or just a thing for convenience? I don't think besides 0 in namespace being the actual user in the actual system as a good convenience, that there is any "need" for pids per root-pid, and even if that happened it would save "root-pids". And I find it unlikely as of now that a system would reach the 16-bit…

> I don't think besides 0 in namespace being the actual user in the actual system as a good convenience, that there is any "need" for pids per root-pid, and even if that happened it would save "root-pids".

What happens with filesystems though? I would assume the filesystem is using the root user namespace. Which means if you have two different UIDs and they map to the same UID in the root namespace, they get collapsed into one for file ownership/etc. That seems a rather major limitation.

> And I find it unlikely as of now that a system would reach the 16-bit limits of running more that 65000 applications on a single system

With 32-bit identifiers, if you make each level 16-bit, you only have room for two levels. What if you have need for a third?

Also, you have to design a mapping from however many levels you need to the 32-bit flat namespace. A mapping which works well for one use case might turn out to be a problematic limitation in another. With variable-length UIDs there is no mapping to bother with.

Re: Why GNU su does not support the `wheel' group (2002)

#148

Earlier quoted context omitted.

> you are forced to map multiple UIDs in the child namespace to the same UID in the parent Is that really a limit or just a thing for convenience? I don't think besides 0 in namespace being the actual user in the actual system as a good convenience, that there is any "need" for pids per root-pid, and even if that happened it would save "root-pids". And I find it unlikely as of now that a system would reach the 16-bit…

> I don't think besides 0 in namespace being the actual user in the actual system as a good convenience, that there is any "need" for pids per root-pid, and even if that happened it would save "root-pids". What happens with filesystems though? I would assume the filesystem is using the root user namespace. Which means if you have two different UIDs and they map to the same UID in the root namespace, they get collapse…

> Also, you have to design a mapping from however many levels you need to the 32-bit flat namespace. A mapping which works well for one use case might turn out to be a problematic limitation in another. With variable-length UIDs there is no mapping to bother with.

Yes, this thing is gonna make IPv4 NAT look like a nice thing in comparison.

Yes, it will probably mean horrible kludge mapping of isolated-applications to UIDs, but until you get to 2^15 ~ 2^16 count of isolated-applications it should work fine.

Yes, this will be on a per-system basis, the resulting filesystem will be only useable by your system, and no other system.

What I'm saying is that in theory the "filesystem" and the "UIDs are 32 bit" parts are mostly there. They're there from the multi-user-big-box days not being used (except by Android/Linux).

> With 32-bit identifiers, if you make each level 16-bit, you only have room for two levels. What if you have need for a third?

The main reason why 65536 UIDs and GIDs are often submapped to every user is because POSIX systems often have a hardcoded assumption that user nobody is UID 65534, GID 65534, and if you want to run nested POSIX systems under POSIX systems without too many changes, reserving that many UIDs and GIDs are required.

There's no good place for that universal "nobody" user anyways, and if you're rethinking how the UIDs and GID mechanisms relate to security, definitively no place for a universal nobody, so you might as well map only the required ammount of UIDs/GIDs per isolated-application.

That then leads to leaving unmapped UIDs unmapped on both host and isolated-applications.

Unless you're reaching the 2^15 ~ 2^16 count of isolated-applications then it should work fine.

Another option would be doing what Android (and supposedly flatpak) does: you should not be able to simply run whatever you want if you're a isolated-application. If as a isolated-application you need to run another isolated-application you need to invoke "the platform" via `am` or `flatpak-spawn` and use it to spawn another isolated-application.

> What happens with filesystems though? I would assume the filesystem is using the root user namespace. Which means if you have two different UIDs and they map to the same UID in the root namespace, they get collapsed into one for file ownership/etc. That seems a rather major limitation.

As far as I know most of what can be considered normal Linux filesystems (ext4, btrfs and I think xfs) support said 32-bit UIDs so you would not need to change filesystem code (and I believe changing and bugfixing filesystem code is always a scary proposition) to use a 32-bit mapping.

Nothing prevents you from using only UID/GIDs; there are other security mechanisms that could be used:

* present every isolated-applications with different overlay filesystems visible. So you can have several things read/write to the same places, but every one has it's own view of what is being read/written.

* displaying a entirely different file system for every isolated-application (bindfs as an example)

* every isolated-application has it's SELinux context (labels) or other forms of ACL applied to those files.

But I find this birthday attack scenario dubious, why would you "need" this UID overlap if the isolated-application don't overlap outside of both namespaces?

If they aren't the same isolated-application it's the wrong thing to do and a security risk.

If they do map to the same isolated-application with the same set of data then trusting everything will be fine is a reasonable assumption. It isn't getting any more data or more privileges from being at different UIDs or GIDs in different contexts.

Re: Why GNU su does not support the `wheel' group (2002)

#149

Earlier quoted context omitted.

> I don't think besides 0 in namespace being the actual user in the actual system as a good convenience, that there is any "need" for pids per root-pid, and even if that happened it would save "root-pids". What happens with filesystems though? I would assume the filesystem is using the root user namespace. Which means if you have two different UIDs and they map to the same UID in the root namespace, they get collapse…

> Also, you have to design a mapping from however many levels you need to the 32-bit flat namespace. A mapping which works well for one use case might turn out to be a problematic limitation in another. With variable-length UIDs there is no mapping to bother with. Yes, this thing is gonna make IPv4 NAT look like a nice thing in comparison. Yes, it will probably mean horrible kludge mapping of isolated-applications to…

You are really proving my point - multiple paragraphs of details and provisos, many of which would have been completely unnecessary if UIDs had been variable-length all along, as Windows SIDs are.

Re: Why GNU su does not support the `wheel' group (2002)

#150

Earlier quoted context omitted.

> Also, you have to design a mapping from however many levels you need to the 32-bit flat namespace. A mapping which works well for one use case might turn out to be a problematic limitation in another. With variable-length UIDs there is no mapping to bother with. Yes, this thing is gonna make IPv4 NAT look like a nice thing in comparison. Yes, it will probably mean horrible kludge mapping of isolated-applications to…

You are really proving my point - multiple paragraphs of details and provisos, many of which would have been completely unnecessary if UIDs had been variable-length all along, as Windows SIDs are.

[deleted]
Post reply on HN