If I enforce some settings for users as root, is there any way they would be able to bypass them?
from dontblink@feddit.it to linux@lemmy.ml on 19 Jan 17:13
https://feddit.it/post/14142815

Let’s say I want to enforce certain settings, such as the use of a proxy in network settings for certain users.

Isn’t this easily bypassable by for example by installing TOR browser or using a VPN app in the user space?

How does system mangers can be sure users will only use the system as planned by the sysadmin? I’m especially interested in network settings, but in general I would be interested to know more about this/be pointed towards the right direction.

Thank you!

#linux

threaded - newest

BCsven@lemmy.ca on 19 Jan 17:52 next collapse

Hopefully smarter people than I chime in, but if the users aren’t part of sudoers then they shouldn’t be able to install anything. However app images exist, and I’m not sure if those TOR out without network control

ShortN0te@lemmy.ml on 19 Jan 18:13 next collapse

You can simply just download a binary and run it.

vsouzas@lemmy.eco.br on 19 Jan 18:40 next collapse

Mounting home and temp partitions with noexec should prevent that.

lengau@midwest.social on 19 Jan 21:00 next collapse

Many electron apps will break because they install some executables into ~/. config

So double win!

balsoft@lemmy.ml on 20 Jan 14:12 collapse

Nah, still easy to circumvent. This should work: github.com/hackerschoice/memexec, or (for dynamic exes) just call them through ld-linux.

dontblink@feddit.it on 19 Jan 18:40 next collapse

And that would be enough to bypass root settings?

If someone wants to prevent users to mess with the system should he just disallow downloads entirely/confine the user into an intranet?

ShortN0te@lemmy.ml on 19 Jan 21:52 collapse

Depends on the root setting. And depends on your goal. What is the purpose of the proxy? I doubt that it is easy to bypass, but you still could run a Proxy or VPN as user, this would not bypass the proxy but any filtering/blocking would not be possible. Etc

BCsven@lemmy.ca on 19 Jan 19:18 collapse

Sure but will it bypass your established network routing if it can’t change it?

eager_eagle@lemmy.world on 19 Jan 18:41 collapse

besides just downloading and running a binary, there are plenty of package managers that work in the user space and don’t need root access.

BCsven@lemmy.ca on 19 Jan 19:17 collapse

If you are setting up a secure system though you would only use a package manager that needed sudo

eager_eagle@lemmy.world on 19 Jan 19:35 next collapse

Who’s setting up the system is not necessarily the same person using it.

BCsven@lemmy.ca on 20 Jan 16:39 collapse

If you only allow users as non sudoers, is what I assumed

balsoft@lemmy.ml on 20 Jan 14:14 collapse

Trying to “secure” a turing-complete computer system by some arbitrary limits like that will never work. Unless you manage to directly prevent traffic that isn’t going through your proxy, it’s all pointless as people will just hack stuff together, be it by downloading binaries themselves and placing them in the home dir, or even by running them in-memory.

catloaf@lemm.ee on 19 Jan 18:40 next collapse

You create a block at the network level for any traffic that isn’t going through the proxy.

MNByChoice@midwest.social on 19 Jan 21:24 next collapse

Yes, and no.

Some settings are harder to circumvent, like partition limits, cgroups, and sysconfig. Others are more suggestion than limit, like shell. DNS server and ssh server settings only require a knowledgeable person to circumvent.

It is best to use layers. Helpfully provide working configs. Kindly provide limits to dissuade ill use. Keenly monitor for the unexpected. Strongly block on many layers the forbidden. Come down like the hammer of god on anyone and anything that still gets through.

tabular@lemmy.world on 19 Jan 21:30 next collapse

Nice try, dad.

Washhouse0749@sh.itjust.works on 20 Jan 01:05 collapse

You could spawn their processes in a isolated network namespace, connected to a proxy via tun interface. You can then setup firewall rules on that interface to block all traffic, except the proxy an maybe your own dns - that should all be out of the users „reach“.