5 ms·
This is cool, and lays the groundwork for per-directory, per-app access controls like on current macOS. Is there a comparable thing for network access? Last I
by sneak 6y ago
This is cool, and lays the groundwork for per-directory, per-app access controls like on current macOS.
Is there a comparable thing for network access? Last I looked OpenSnitch seemed to be unmaintained, but looking just now it apparently has some commits on master recently again:
https://github.com/evilsocket/opensnitch https://github.com/evilsocket/opensnitch
- gruez 6y agoCan't you already do that? Just run every app in its own container, and firewall each container individually (since they can each have their own networking stack).
- bb88 6y agoSure, but why would I want to run 'ls' in it's own container?
- yjftsjthsd-h 6y agoBecause you want to prevent it from using network? You don't need a full "container", just a network namespace, but it's the same tech.
- hawski 6y agoI agree. Containers in the core are really two things, the latter is optional: unshare and cgroups.
- gruez 6y agocontainer is the only way for this to be airtight. Otherwise your malicious script can just call out to wget/curl (which is probably whitelisted) to bypass your firewall.
- nfoz 6y agoI'm not sure of all the history, but it feels to me like there were two cute ideas of the classic shell metaphor that we never quite achieved, and anyway we've totally outgrown: 1. That the shell's user is "in" a location of the filesystem (cwd), and can move around it like you're an avatar navigating rooms. 2. That the shell can "only" do program invocation, such that even its basic primitives like 'cd' and '[' can be just themselves programs. It's heretical, but, I don't think ls ought to be its own program. It's part of the shell, in particular part of my view of the filesystem. It's not really an app and I don't care if it happens to be implemented that way under the hood. As a user, I want a shell that lets me navigate the system (possibly multiple sets of systems), with a consistent set of primitives. It can let me invoke applications, and I want an absolute and extremely tight set of controls over those applications, and very specific ways that they're allowed to talk to each other. I'm running far off-topic but to your original point, I think "ls" isn't really the type of app we ought to be talking about here, just bake it into the shell...... ok I just want to abandon posix and work in new metaphors. That really is off-topic for discussions about a new Linux feature I guess.
- chungy 6y ago> 2. That the shell can "only" do program invocation, such that even its basic primitives like 'cd' and '[' can be just themselves programs. "cd" is one of a few commands that basically must be built-ins no matter what, since it has to modify the environment of the shell itself. Any external command can only modify its own environment, not the shell's environment.
- zerocrates 6y agoJust have cd spawn you a new shell that's in a new working directory, solved! Call it the immutable shell.
- HideousKojima 6y agoHave it contain a hash of the previous shell and cryptographically verify its authenticity with all of the electricity in Argentina and you can even get the crypto guys to promote it for you for free!
- deleted 6y ago[deleted]
- staticassertion 6y agoWell, why do you want to run 'ls' in a sandbox?
- fsflover 6y agoOr you can just use Qubes OS.
- heavyset_go 6y agoLinux has network namespaces for isolation and restriction, not sure if that's what you're looking for, though.
- touisteur 6y agoNamespaces + internal netns firewall + seccomp might do the trick :-)
- quaintdev 6y agoFirejail - https://github.com/netblue30/firejail https://github.com/netblue30/firejail
- megous 6y agoI use skuid based firewall rules + locked down permissions on the host so that processes can't elevate their privileges/change the user. Works fine enough for untrusted non-gui SW, and trusted GUI SW, that I know will not try to hack my PC, but apps running inside it may be able to access stuff I don't want them to on my network (like Firefox). cgroups may also work well for this without the need to use multiple UNIX users.
- n3mes1s 6y agoThere is a sort of opensnitch based on ebpf but not sure is fully feature completed as you intended: https://github.com/harporoeder/ebpfsnitch https://github.com/harporoeder/ebpfsnitch