Skip to content
This repository was archived by the owner on Jun 21, 2018. It is now read-only.

Conversation

@KellerFuchs
Copy link
Member

  • the unmnt_remnt option makes sudo switch to the destination user's namespace;
  • {/var,}/tmp and /run/{shm,lock} are poly-instantiated on a per-user basis;
    root gets to escape this and see all instances.

I have been fairly conservative, so this shouldn't break anything.
In particular, I would like (in a future patch) to:

  • also poly-instantiate /run/user, and possibly more things in /run, as many services get rather dirty in there;
  • have a namespaced /dev which only allows access to pseudo-devices (null, zero, random, ...);
  • enforce “read-onlyness” of the system files (equivalent to systemd.exec's ProtectSystem=full);
  • only make visible that user's home, to avoid issues like Users have access to others home directory including mail. #11.

Also, I discussed with @lrvick the possibility of using network namespacing to give each user their own IPv6 (though this requires getting IPv6 connectivity first ...).

@KellerFuchs
Copy link
Member Author

Ping?

@daurnimator
Copy link
Member

I don't understand the consequences of this enough; it's new to me :) Hoping someone else might know more. @deleriux2 ping?

@KellerFuchs
Copy link
Member Author

2 notes before this gets applied:

  1. the directories have to be created (and chmod 000, but that's enforced by pam_namespace);
    systemd-tmpfiles-* need to be restarted;
  2. we have to terminate user sessions after applying this to a shell server (otherwise, the user will end up with some different processes having a different idea of what /tmp is, for instance preventing them from connecting to a running tmux).

@KellerFuchs
Copy link
Member Author

Also, ping @lrvick

@KellerFuchs
Copy link
Member Author

No-one interected in reviewing that? :(

FYI, the same config is currently deployed at the local hackerspace, and works great.

@daurnimator
Copy link
Member

If no one else replies; I say give it a try and see if it works out :P

@lrvick
Copy link
Member

lrvick commented Nov 1, 2015

+1 to tias

On Sat, Oct 31, 2015 at 11:17 PM, daurnimator notifications@github.com
wrote:

If no one else replies; I say give it a try and see if it works out :P


Reply to this email directly or view it on GitHub
#28 (comment).

Lance R. Vick


Cell - 407.283.7596
Gtalk - lance@lrvick.net
Website - http://lrvick.net
PGP Key - http://lrvick.net/0x36C8AAA9.asc
keyserver - subkeys.pgp.net


@KellerFuchs
Copy link
Member Author

tias == Try it and see ?

Anyhow, I guess I will try it on da1, once I have the needed access and warned the people using it.

@RyanSquared
Copy link
Member

If you want, I think we can set up a temporary server for testing this.

@lrvick
Copy link
Member

lrvick commented Nov 6, 2015

Yeah do1 is probably fine for the scope of this, then use admin tools to
roll to rest if all is good.

On Fri, Nov 6, 2015 at 7:22 AM, Charles Heywood notifications@github.com
wrote:

If you want, I think we can set up a temporary server for testing this.


Reply to this email directly or view it on GitHub
#28 (comment).

Lance R. Vick


Cell - 407.283.7596
Gtalk - lance@lrvick.net
Website - http://lrvick.net
PGP Key - http://lrvick.net/0x36C8AAA9.asc
keyserver - subkeys.pgp.net


@KellerFuchs
Copy link
Member Author

This shoud also poly-instanciate /dev, given how annoying deployment is going to be.

@KellerFuchs KellerFuchs force-pushed the user-confine branch 2 times, most recently from f69087b to 8c9bd36 Compare February 9, 2016 02:44
@KellerFuchs
Copy link
Member Author

Also, let's merge that once emergency root access is sorted out.

@KellerFuchs KellerFuchs force-pushed the user-confine branch 3 times, most recently from fc18ecf to fab447e Compare February 9, 2016 03:10
@KellerFuchs
Copy link
Member Author

Emergency root access is happening now: hashbang/admin-tools#12 and #62

- the unmnt_remnt option makes sudo switch to the destination user's namespace;
- {/var,}/tmp and /run/{shm,lock} are poly-instantiated on a per-user basis
  root gets to escape this and see all instances
On stock Debian, /bin/sh is dash, which does not have a -p option.
See upstream bug #624842:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624842
We are not using this, since we do not polyinstanciate homedirs.
Even if we did, users getting fresh homedirs and losing their
  config all the time isn't the desired behaviour.
It is based on what systemd allows with PrivateDevices=yes.
What could possibly go wrong?  :>

The /run/shm polyinstance is dropped, since /run/shm is a
  symlink to /dev/shm by default.
@KellerFuchs
Copy link
Member Author

Ok, now that emergency root access is sorted out, I will TIAS this on to1.

KellerFuchs added a commit that referenced this pull request Feb 21, 2016
Compartment user sessions using pam_namespace
@KellerFuchs KellerFuchs merged commit 070b905 into hashbang:master Feb 21, 2016
@KellerFuchs
Copy link
Member Author

Deployed and tested on to1. Caught a pty issue that I didn't hit when testing on my own machine.

That can be deployed to the other boxes by running sync.yml, then terminating all user session (but you might as well just reboot and make us sure nothing is still using the old (vulnerable) libc).

@KellerFuchs
Copy link
Member Author

For the record: deployed everywhere.

@KellerFuchs KellerFuchs deleted the user-confine branch February 22, 2016 01:09
@KellerFuchs KellerFuchs mentioned this pull request Apr 25, 2016
3 tasks
lrvick pushed a commit that referenced this pull request Jun 15, 2017
Compartment user sessions using pam_namespace
KellerFuchs added a commit that referenced this pull request Sep 20, 2017
Compartment user sessions using pam_namespace
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants