Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capability style package security via package users and groups #39033

Open
elspru opened this issue Apr 17, 2018 · 3 comments
Open

Capability style package security via package users and groups #39033

elspru opened this issue Apr 17, 2018 · 3 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@elspru
Copy link

elspru commented Apr 17, 2018

Issue description

While Linux doesn't support capabilities, NixOS is one of the best candidates as a transitional OS.
The Issue is that normal users and all apps have read and execute access to all items in the store,
this may allow people to use applications they shouldn't be using,
and take advantage of exploits which may be available in them.

Steps to reproduce

ls -l /nix/store

shows that everyone has read access to everything in the store.

Potential fix.

Can make a username and group for each package,
with the package-user being in groups of any run-time dependencies,
if they use setuid.
Then can disable read access to other in the store.

The normal users would be in the groups of the apps/packages they are allowed to use.

@elspru elspru changed the title Capability style package security Capability style package security via package users and groups Apr 17, 2018
@Ekleog
Copy link
Member

Ekleog commented Sep 13, 2018

The packages in the store are never setuid, so even if there are exploits in them it wouldn't allow an user to escalate privilege in the scenario you put forward, I think.

As a consequence, I'm not really sure what problem your solution is trying to solve? (also, there is a potential problem with it: if each package is setuid [some package-specific user], then it will be hard for it to eg. write files on request of the user who started them)

@MostAwesomeDude
Copy link
Contributor

I think that fixing this is beyond the scope of Nix. Not that it's not desirable, just far beyond anything we have the ability to build.

The problem that is trying to be solved is exactly what is stated: Being able to enumerate the Nix store is incompatible with package-capability isolation guarantees.

@stale
Copy link

stale bot commented Nov 28, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants