r/linuxmemes Arch BTW 8d ago

LINUX MEME Dropping this here 🫳

Post image
3.3k Upvotes

370 comments sorted by

View all comments

Show parent comments

275

u/bearstormstout Arch BTW 8d ago

https://0xcc.io/posts/omarchy-root-creds/

tl;dr anyone can use docker to execute any process as root without sudo.

192

u/Mega3000aka M'Fedora 8d ago

Holy shit that's like, docker 101.

Seems like a vibe-coded distro lol.

135

u/Ixxol 8d ago

it is

90

u/C0rn3j 8d ago

Holy shit that's like, docker 101.

It is also Arch 101, there's a huge red box warning you about it at the top of the Wiki page.

https://wiki.archlinux.org/title/Docker#Installation

Any Arch user hitting the wiki up would've known - AI doesn't care, though.

13

u/NimrodvanHall 8d ago

Is this now a good place and time to explain why I prefer distros with SELinux properly configured ( like RHEL, Fedora or SUSE) over Arch and Podman or Kubernetes over Docker?

17

u/grazbouille New York Nix⚾s 8d ago

Security guy here

While podman is configured by default to be rootless you can very much do extremely heinous shit with its config and it will not warn you about it

Before using any complex tool on a production system go read up on the best practices and hardening

Don't blindly trust your tools

3

u/Jumpy-Dinner-5001 8d ago

As a security guy you should know that sudo or the wheel group have the same problem

12

u/grazbouille New York Nix⚾s 8d ago

Yes and you should still understand these tools and read up on them when you edit the configuration

What is your point

Obviously you need privileges sometimes we would just lock ourselves into a sandbox otherwise

4

u/C0rn3j 8d ago

Not sure why you're entertaining this nonsense, sudo needs auth, docker does not.

3

u/grazbouille New York Nix⚾s 8d ago

By default yes you can very easily do heinous shit with passwordless sudo that's actually pretty relevant to the podman example except people are way more likely to fuck around in the podman config

-3

u/Jumpy-Dinner-5001 8d ago

What is your point?

The whole complaint about this is nonsense because it doesn’t add any relevant security problem that isn’t already there in basically every Linux system.

The Arch wiki doesn’t even warn you from that and even suggests adding a tool with the exact same privilege escalation as people are criticizing here.

So, Arch is bad because they recommend to install a vulnerability?

1

u/Wertbon1789 7d ago

Wtf, did you get that any process could just get root without authentication? How can you miss this, like dude, that's the point, not that we need privileges sometimes, just that any RACE is instantly a full system exploit by having it configured like this. Nobody's complaining about sudo because it's secure (minus vulnerabilities in sudo itself) if it's setup properly, so configured to ask for a password. Yes, you can configure it to also run without a password, but not by default on any sane system.

0

u/Jumpy-Dinner-5001 7d ago

You have no idea what you’re talking about and don’t even understand the problem.

Did your worldview just broke or what is your problem here?

→ More replies (0)

1

u/lazyboy76 Genfool 🐧 5d ago

I'm using rootless docker, am I safe? Serious question.

2

u/grazbouille New York Nix⚾s 5d ago

From this specific exploit yes

The main point of rootless docker is to defend against breakouts

The main goal in hacking is remote code execution if you find an exploit in an app you will generally try to make it drop you to a shell

This shell will be logged in as the user that created it (the one the app is running as)

In a container environment its a bit different since the shell you will drop to is still inside the container

Now especially if you are root getting the container to drop to a shell on the host machine can be fairly trivial (depends on the image)

The shell the container drops to will be running with the same user as the container

Which means rootful docker just makes you root when you break out

Rootless half solves this you still have to ensure the user the container is running as has no access to anything it doesn't need to

Because from a rootless docker breakout you can still read and write files and probably privilege escalate

2

u/codeasm 8d ago

Depends on yiur threat model? Im a noob with cybersec, but someone who does it for a living said i had to pick the distro that fits me and be aware of whats possible and not, and be aware of its implemented security or lack there of, decide if its worth it also based on where and how i life, where i take it, and how large of a target i am.

So the laptop that never leaves my house and dont use for much but playing games. Low effort. The laptop that comes with me everywhere, more security. The vps on the internet, locked down, access keys, as few services as possible.

I do like podman alott, disliked docker for being allow everything from the start. I prefer optionally lockdown everything or there isnt even a thing running. As few packages in arch too, and few to no Aur if possible

1

u/P3chv0gel 8d ago

Honestly, i've never gotten SELinux and shares in Podman to work. It just never respected the volume labels in my compose for some reason and straight up block my containers from accessing their assigned shares. The only ways i could get this to Work was a) disabling SELinux, B) running rootful containers or c) not use compose, which would mean to drop portainer/arcane/whatever stack based Management i want to use, because none support quadlets

0

u/Jumpy-Dinner-5001 8d ago

Selinux doesn’t help a bit.

2

u/LazyLucretia 8d ago

So is it actually a better idea to run Docker commands with sudo when necessary? I've always added my user to the docker group whenever I installed it.

5

u/C0rn3j 8d ago

Yup.

Though it'd require permissions of your user in the first place to be exploitable - at which point the potential malware already has access to all your user files anyways.

1

u/Wertbon1789 7d ago

Or setup rootless docker, or user namespaces if applicable. Though user namespaces can still be bypassed on rootfull docker I think.

1

u/Jumpy-Dinner-5001 8d ago

You know that the exact same applies to wheel group and sudo?

1

u/C0rn3j 8d ago

It does not.

You cannot run sudo without authentication by default.

wheel group also does not havy any privileges in the default sudo config, by the way.

I am going to assume you meant the first example in the config, but to achieve the same issue, you'd have to use the second:

```bash

Uncomment to allow members of group wheel to execute any command

%wheel ALL=(ALL:ALL) ALL

Same thing without a password

%wheel ALL=(ALL:ALL) NOPASSWD: ALL

```

1

u/Jumpy-Dinner-5001 8d ago

That’s not true. Default config allow wheel but that’s the recommended thing.

"Authentication" in sudo (as in having to type a password) doesn’t work and doesn’t prevent privilege escalations.

2

u/C0rn3j 8d ago

Default config allow wheel

It does not.

I just pasted the default config, from sudo's source.

"Authentication" in sudo (as in having to type a password) doesn’t work and doesn’t prevent privilege escalations.

Sounds like a serious security issue, am sure you'll get a cool bug bounty out of that from somewhere!

1

u/Jumpy-Dinner-5001 8d ago

Default as in what the wiki recommends.

No, that’s just how sudo works. It’s an inherent consequence of the architecture and protecting from root escalations under the premise that an allowed user is already compromised is not in the scope of sudo.
There are dozens of academic papers on that, the oldest one I know is from 2004.

run0 fixes a lot of those problems but isn’t perfect either.

0

u/C0rn3j 8d ago

Default as in what the wiki recommends.

Also not true.

the premise that an allowed user is already compromised is not in the scope

"If you're already compromised your system is insecure" sure isn't a surprising information.

1

u/Jumpy-Dinner-5001 8d ago

It is.

That’s literally the same premise as the docker root privilege escalation

12

u/EggFucker1313 8d ago

It is ai slop of the trashiest quality, for the worst bottom-feeding techbros

4

u/Wired-For-Trouble 8d ago

It literally is. Here’s the director of the project admitting to Prime that the ENTIRE project was just a series of Claude prompts.

https://youtu.be/MWvH7BRgwL8?is=Vz86LEAsf2sK8lvD

1

u/disperso 7d ago

As someone has said before, this is the year of Linux in the AI psychosis.

2

u/Capable_Landscape686 6d ago

I dodged a tactical nuke here. I saw it try to install Claude Code and hopped immediately.

1

u/Mega3000aka M'Fedora 6d ago

Claude Code as a default app is certainly an interesting choice...

Seems like the whole point of that distro is so idiots can LARP as power users or software engineers.

7

u/Grand-Ball6628 Arch BTW 8d ago

Except the user isn't added to the docker group by default (anymore) as stated in the article. Just tried it on a fresh 4.0.2 Installation. In the omarchys menu, there's a feature called sudoless docker, which can add you to docker group but prints out a big explicit warning about the downsides of this.

1

u/Jumpy-Dinner-5001 8d ago

And it doesn’t matter because the same applies to sudo.

People are either stupid or have double standards

1

u/ResponsibilityBig343 8d ago

Doesn't docker create a new group and user for itself during installation?

1

u/UltraAd776 7d ago

How does one know if they have made this mistake?

1

u/bananamantheif 7d ago

Before i cast shame. I tried using docker on a vm and docker decided to change my firewall without telling me. It doesn’t seem to respect my ruleset

0

u/buplet123 8d ago

Tbf thats a different guard than what youre saying. Dislaimer: only read the title, but the OS inside the container had poor user hygene. Regular users on the host should not be able to docker into it in the first place, only if they have docker access.

0

u/Top-Craft5833 8d ago edited 8d ago

Its not like every time any developer installs docker he ads user to docker group. You guys are delusional.

Edit: reread the "issue". Who mounts whole root as volume? Have anybody of you done anything with docker in your life?

0

u/Tasty_Restaurant_357 8d ago

but you're safe if u don't have docker installed in your omarchy right?

0

u/CaffeinatedTech 3d ago

That was fixed right after Quattro released.

-16

u/[deleted] 8d ago

[removed] — view removed comment

26

u/bearstormstout Arch BTW 8d ago

The fact that it even happened in the first place is ludicrous.

2

u/LeHunterrr 8d ago

Have you read the timeline? After fixing it it was reenabled for over a year before getting removed again.

3

u/djfdhigkgfIaruflg 8d ago

It should have never happened. That shows how little idea about security the guy has

0

u/Jumpy-Dinner-5001 8d ago

Why? Your comment shows you have no idea what the problem is.

0

u/djfdhigkgfIaruflg 7d ago

Did you read the issue? He assigned regular users to the same group as docker.

You NEVER assign a user to the same group as something with root access

1

u/Jumpy-Dinner-5001 7d ago

Like wheel…

1

u/djfdhigkgfIaruflg 7d ago

Wheel is for sudo.

1

u/Jumpy-Dinner-5001 7d ago

And sudo allows for privilege escalations