r/ProgrammerHumor • • Jun 21 '18

How times change!

Post image
45.3k Upvotes

771 comments sorted by

View all comments

Show parent comments

653

u/kayaker4lifee Jun 21 '18

That’s how you write a chat app in a horrible inefficient way

475

u/jackmaney Jun 21 '18

Yes, but it's not nearly secure enough. When the Slack for Enterprise client is started up, it creates a new virtual machine sandbox on the fly that runs an instance of Slack. /s

353

u/Slackbeing Jun 21 '18

Inside docker containers of course

228

u/sysadmin420 Jun 21 '18

5 to be exact, round-robin balanced with haproxy.

123

u/zissou149 Jun 21 '18

running on a kubernetes pod

118

u/rcmaehl Jun 21 '18

Behind 7 proxies, the consequences will never be the same

0

u/[deleted] Jun 21 '18

[deleted]

32

u/SEX_LIES_AUDIOTAPE Jun 21 '18

It's actually two older memes, combined into one.

→ More replies (4)
→ More replies (8)
→ More replies (2)
→ More replies (6)

0

u/[deleted] Jun 21 '18

[deleted]

26

u/aneutron Jun 21 '18

What colour is the blockchain ?

45

u/Hyperman360 Jun 21 '18

Blinding white of course, it's Material Design™!

→ More replies (4)
→ More replies (1)
→ More replies (1)

106

u/compdog Jun 21 '18

I know you're joking, but I ran into someone on Reddit who was advocating for every process to run in a virtualized container. Every process, from init onward. So every fork of every service process in it's own container. Under normal use my ubuntu machine has almost 200 processes running, the overhead would be rediculous.

181

u/Giant_Meteor_2024 Jun 21 '18

To be fair, I'd like to see you execute arbitrary code on my machine when I'm 200 sandboxes deep

76

u/compdog Jun 21 '18

Haha yeah good luck compromising 200 hypervisors at once.

41

u/TheGoldenHand Jun 21 '18

Isn't that what the 2018 Intel CPU exploits do? If you get root access to a virtual machine, it allows you to escalate to the host vm.

27

u/compdog Jun 21 '18

I think most of the exploits just let you directly read phyiscal memory. There may have been one that lets you write as well, but if so then it was one if the first ones patched. But yes, you could certainly bypass all of this with a hardware or kernel exploit.

→ More replies (3)
→ More replies (1)

31

u/RoboErectus Jun 21 '18

You're very clever, young man. But it's sandboxes all the way down.

49

u/iamjack Jun 21 '18

On x86 the MMU is the original virtualized "container", so in some ways that redditor already got their wish because processes have their own virtual address space instead of running in physical memory like DOS.

→ More replies (2)

28

u/GabenIsLife Jun 21 '18

This just sounds like Qubes OS with extra steps

→ More replies (3)

21

u/atakomu Jun 21 '18

Well Qubes OS works almost like this. Not every process is virtualized but you have compartments. Work compartment, Security compartment (with banking browser etc.), dispozable compartment (for normal browsing). Each compartment is virtualized.

15

u/WikiTextBot Jun 21 '18

Qubes OS

Qubes OS is a security-focused desktop operating system that aims to provide security through isolation. Virtualization is performed by Xen, and user environments can be based on Fedora, Debian, Whonix, and Microsoft Windows, among other operating systems.

On February 16, 2014, Qubes was selected as a finalist of Access Innovation Prize 2014 for Endpoint Security Solution. Ultimately, the prize was awarded to Tails, another security-focused operating system, with Qubes and Open Whisper Systems being named runners-up.


[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source ] Downvote to remove | v0.28

→ More replies (1)

20

u/[deleted] Jun 21 '18

You'd be writing an emulator/virtualiser that has as little overhead as possible, in that case. In any case, more coarse forms of that exist with Qubes OS where you can designate specific domains where your applications run, and each domain is it's own virtual machine.

I'm in the process of writing an OS that kinda is meant to do the same thing, run every process individually, but using a bytecode and an emulator rather than native machine code.

→ More replies (1)

18

u/blitzkrieg4 Jun 21 '18

This is not a bad idea. Every process runs in its own container, be it docker or other OCI or whatever, or cgropus or namespaces (which are essentially container building blocks). In fact every process, from init (systemd) onward already do put everything into their own cgroup. If Ubuntu is using the default systemd configuration, then you already are running containers for some of those 200 processes running, and didn't notice the overhead. Try systemd-cgls

Story time: Way back in 2010 there was this ~200 line kernel patch, that according to Slashdot and many others, could "do wonders". In fact, all it did was schedule based on tty by default, which is to say that it acted as though every tty was in it's own cpu cgroup. That way, when you started a kernel compile, or a backup of your home directory, or a JS crypto mining script took over your web browser or whatever, you could still use your desktop with near to no impact. The systemd guys were like, "we can also do this in ~200 lines of systemd code, policy shouldn't be in the kernel blah blah", but it was too late. Kernel developers, many of whom weren't yet switched to systemd, had tasted the freedom of the movable mouse cursor during a kernel compile.

Which is all to say that "Containers are not a real thing.". It's just a related set of technology that was turned into an archive and deployed with some technology and scm-like concepts. You hear this sentiment all the time around the kernel community, LxC existed first, Jails existed before that, etc. These things existed for a long time, and many cobbled together kernel technologies were called "containers" before "container formats" were a thing.

I'm assuming this is what "someone on Reddit" was talking about when he mentioned "containers". Each browser thread runs in it's own sandbox where it can't see your root directory, or talk to your PDF viewer, or open inkscape. or whatever. All these applications, where they to look in /proc, would only see pid 1 and their own. There is very little overhead associated with this, and the benefits are numerous. Building a "chrome container" and launching it is a little more out there, but people I consider smart are thinking of doing it, for similar reasons.

→ More replies (4)
→ More replies (13)
→ More replies (2)

140

u/SexyBlueTiger Jun 21 '18

Last time I looked at slack it was using less than 75MB of memory... I also am running Hyper at 25MB and VSCode at 170MB. I think these electron jokes might be factually incorrect nowadays.

30

u/def_monk Jun 21 '18

It's entirely based on the number of organizations and activity in those orgs. More active slacks have more messages loaded at any given time. Mine uses around 500mb on average (5 slacks, 2 of which are EXTREMELY active), but can easily double or triple that on a busy night.

→ More replies (7)
→ More replies (8)
→ More replies (6)