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

sudo does not make admins escape from the sandboxes #74

Open
KellerFuchs opened this issue Feb 23, 2016 · 5 comments
Open

sudo does not make admins escape from the sandboxes #74

KellerFuchs opened this issue Feb 23, 2016 · 5 comments
Labels

Comments

@KellerFuchs
Copy link
Member

We are using pam_namespace's unmnt_remnt option, which should make pam_namespace perform a namespace switch when changing users.
Yet, sudo-ing to root doesn't make one escape the mount namespaces.

However, SSH-ing as root gives the expected result (no mount namespaces), so it isn't a misconfiguration on that side.

@KellerFuchs
Copy link
Member Author

pam_namespace fails to umount due to the /dev/pts mount:

Feb 23 03:24:14 to1 sudo[29103]: kellerfuchs : TTY=pts/1 ; PWD=/home/kellerfuchs/admin-tools ; USER=root ; COMMAND=/bin/journalctl -f
Feb 23 03:24:14 to1 sudo[29103]: pam_namespace(sudo:session): Unmount of /dev failed, Device or resource busy
Feb 23 03:24:14 to1 sudo[29103]: pam_unix(sudo:session): session opened for user root by (uid=0)

KellerFuchs added a commit to KellerFuchs/admin-tools that referenced this issue Feb 26, 2017
Using `sudo`, through the Ansible feature `become`, is problematic
due to hashbang/shell-etc#74 : sudo does not let Ansible escape the
namespace-based sandbox.

Since all admins have SSH keys deployed for `root`,
this is a good alternative.
@daurnimator
Copy link
Member

What is holding /dev open/in use?

@KellerFuchs
Copy link
Member Author

KellerFuchs commented Feb 27, 2017 via email

@daurnimator
Copy link
Member

okay, to go down the rabbit hole: why isn't /dev/pts being umounted first?

@KellerFuchs
Copy link
Member Author

IIRC, I looked in the pam_namespace code, and it's an ode to Cthulhu written in nightmare ink.
I have no idea if it that's a bug, or just not supported (but the manpage doesn't say anything about it...).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants