68 points · by yapret · 3y ago · 58 comments
Immutable or chain-of-trust based host OS (e.g. nix or iOS)
Minimal software installed (including docker, which itself is heavy and full of vulns or opens the door to them)
Do everything on ephemeral remote environments where the configuration is stored in reviewable tools (e.g. GitHub) and the state can be wiped at will. This means you reduce your surface area for persistent malware to supply chain and network attacks, which require careful practices to avoid but which are well-understood
Remote envs are preferred to local virtualization (e.g. quebes) because they lend themselves to team use and sharing more, and so are more likely to be widely adopted and collectively improved. Also easier to create different hardware configurations as needed (when you need a bigger GPU temporarily), as well as different environment types - e.g. always-on previews for QA testing. Also eliminates persistent paths in the local OS for malware storage
> Immutable or chain-of-trust based host OS (e.g. nix or iOS)
Pegassus ?
Did you notice that Apple fixes vulnerabilities only after they are find by third parties ?
There's steps you can take that involve incredibly secure procurement processes of air gapped devices, but even that will not prove absolute security.
[1]: https://fedoraproject.org/silverblue/
[2]: https://docs.fedoraproject.org/en-US/fedora-silverblue/toolb...
Perfomance wise my containers take a couple MB of rams and no perceptible CPU usage when not in use. At least as far as I can tell.
[1] https://github.com/89luca89/distrobox/blob/main/docs/usage/d...
[2] https://github.com/89luca89/distrobox/blob/main/docs/usage/d...
On Linux, the pledge utility[1] seems like a better fit for this. I'm not aware of what the macOS alternative would be, but considering this functionality stems from OpenBSD, maybe it can be ported to Darwin?
Seems super painful and indirected for a nebulous gain to me, but find your joy however you want I guess
Setup correctly, if any one container was to get compromised, it shouldn't leak out to anywhere of the other ones. Would be super inconvenient, I'm guessing to actually have a semblance of efficiency there would still likely be a "main" container and you'd SSH into others in order to do tasks associated with that container. Not too much different than the "clean OS" described here, probably the helper scripts could be similarly adapted to utilize the individual containers instead of docker containers.
I personally would be hard pressed to consider something like that, but seems like the logical continuation of this type of machine configuration/setup.
Right now you can set up a VM or an LXC container. In comparison to docker/podman, LXC is more like being a sysadmin.
Guessing someone who tried to use a system like this would probably have their own custom containers / linux distributions, or at least have custom install scripts that would function much like the docker compose file does in getting everything installed on that container for different use cases.
Also notice how the shell snippets in the article doesn't use sudo to run docker. That indicates that the author probably added their user to the docker group, which is equivalent to always logging in as root. That's terrible, terrible security practice.
I can't agree that root inside the container is different from root on the host, either. The kernel makes no such distinction unless user namespacing is enabled. When containerized processes gain access to host resources, whether intentional or not, they'll have the same level of access as root on the host.
This reminds me a lot of the cycle of sandboxing:
Also consider QubesOS. Where everything runs in a VM (if you can find appropriate hardware on which to run it).
Less flexible but easier to install is ChromeOS FLEX (or a high end Chromebook). Like QubesOS, ChromeOS lets you run Linux in a VM but with the ability to open native windows.
1 - https://github.com/yapret/toolship/blob/main/src/node/functi...
A business today can reduce the blast radius by quite a lot with separate laptops ("customer/project laptop"), sample data and restricted/time limited access to production data.
In an ideal world no npm dependency could affect my online banking, icloud photo library or private messengers.
I even have a portable LXD environment which always looks the same, on a USB flash drive. wherever I go, I have the same environment.
Linux on ChromeOS is probably better because its file system is separate. Files and directories must be explicitly shared from the main OS.
I think both have the ability to open windows on the main desktop so you can run graphical IDEs and the like in the VM which is nice.
Uses the same Linux primitives as docker etc, but can be a bit more ergonomic for this use case
You need something like org/image@sha256:<hash> instead.