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

allow running orjail without sudo by having orjail run sudo internally #41

Open
adrelanos opened this issue Aug 28, 2018 · 3 comments
Open
Assignees

Comments

@adrelanos
Copy link
Collaborator

The flowing is a bit strange.

sudo orjail -y touch a

Will the file be owned by root or user? -> user But why since the whole command runs under sudo? A bit unexpected.

vs

sudo orjail -y sudo touch a

Will the file be owned by root or user? -> root That syntax is a bit long though.


So I was wondering why not run orjail without sudo, and then orjail would internally use sudo whenever required?

Maybe orjail could be running under user orjail and user orjail would have /etc/sudoers.d/orjail exceptions to run the required commands (ip, iptables, ...) under root using sudo.

The end result could be:

  • sudo orjail -y touch a -> owned by root
  • orjail -y touch a -> owned by user

If you're interested in this, I could try to come up with a pull request since I have some experiences running applications under user something and then having /etc/sudoers.d/ exceptions to allow user something do run required commands as root.

lesion added a commit that referenced this issue Aug 28, 2018
@lesion
Copy link
Collaborator

lesion commented Aug 28, 2018

seems reasonable, don't really know if I like it but I tried to experiment it in feat/nosudo branch (you can directly modify it).

notes: we're currently using sudo to drop privilege, this is not so good, we should probably use setuidgid, this is something important to investigate

@gibix
Copy link
Collaborator

gibix commented Aug 29, 2018

90% of the work done by orjail requires sudo, I'm sure about hiding this in the script.

@lesion lesion self-assigned this Feb 29, 2020
@tzugen
Copy link

tzugen commented May 30, 2022

netexec manages to run without sudo, maybe that could provide some pointers?

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

No branches or pull requests

4 participants