Live data from Hacker News

Codex just found a "workaround" of not having sudo on my PC

twitter.com

201–210 of 330 posts

Re: Codex just found a "workaround" of not having sudo on my PC

#201

Earlier quoted context omitted.

This very thread was an example where it unintentionally got root access though.

Because of how Docker works, not because of how Unix permissions work.

That's a terrible distinction to make on a topic about how the coding agent gained root inadvertently.

Re: Codex just found a "workaround" of not having sudo on my PC

#202

That's why your coding agent should never run as your identity.

I'm curious. How do you do that?

For some very basic level protection use devcontainers and install the agent into that....

A better approach is to use the Docker Sandboxes feature. Locks things way down so that the agent only has access to the files you give it and you can lock down its network access too. Also does things like keep any credentials outside of the container (microvm actually).

Re: Codex just found a "workaround" of not having sudo on my PC

#203
post #192

Earlier quoted context omitted.

Please stop spreading this toxic curl|sh nonsense. It's wildly corrosive to security and system stability.

Is it really that much worse than using a package manager that drops a binary that you're not going to inspect anyways?

Actually it is much worse, I agree with the commenter

Re: Codex just found a "workaround" of not having sudo on my PC

#204

Earlier quoted context omitted.

This was not always true and running rootless has been a benefit of Podman for a long time. Docker also does not run rootless by default afaik, thus making the attack surface greater by default. The other main improvement of Podman over Docker is that Podman is daemonless and therefor is incredibly lightweight and portable.

I don't understand why anyone still uses docker.

Because Docker works better

Re: Codex just found a "workaround" of not having sudo on my PC

#205

Earlier quoted context omitted.

No, Docker can run rootless too

This was not always true and running rootless has been a benefit of Podman for a long time. Docker also does not run rootless by default afaik, thus making the attack surface greater by default. The other main improvement of Podman over Docker is that Podman is daemonless and therefor is incredibly lightweight and portable.

I'm sorry but this is all just apologism/excuses. Docker's had rootless mode for 7 years. The attack surface is the local system, which always has a privilege escalation vuln of some kind, so Docker isn't a game-changer. And lightweight? I have never heard someone say "that Docker daemon is hogging all my resources".

Re: Codex just found a "workaround" of not having sudo on my PC

#206
post #95

Earlier quoted context omitted.

That's why adding your user account to the docker group is a separate step that explicitly does not happen as part of the installation: https://docs.docker.com/engine/install/linux-postinstall/ > Warning > The docker group grants root-level privileges to the user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.

wait so just being lazy and using sudo on Docker commands instead of figuring things out actually means I'm being safer? awesome.

No, because a malicious AI agent could just replace the sudo binary in your path with one that collects your password and uses it to execute arbitrary code as root. Nothing short of sandboxing everything or just never using AI agents or proprietary software will prevent this.

Re: Codex just found a "workaround" of not having sudo on my PC

#207

Earlier quoted context omitted.

wait so just being lazy and using sudo on Docker commands instead of figuring things out actually means I'm being safer? awesome.

No, because a malicious AI agent could just replace the sudo binary in your path with one that collects your password and uses it to execute arbitrary code as root. Nothing short of sandboxing everything or just never using AI agents or proprietary software will prevent this.

My agent has access to my email, my messages, my work, my finances, my life. But thank god it doesn't have access to root on my machine.

Re: Codex just found a "workaround" of not having sudo on my PC

#209
post #7

Every time I try to install Docker there's a warning that being in the "docker" group is equivalent to having root access. You should probably know about this workaround by now.

Install docker (systemd daemon) in a separate rootless Linux namespace (user). I wrote this down here [1]. Zero trust & separation of concerns.

[1]: https://du.nkel.dev/blog/2023-12-12_mastodon-docker-rootless...

Re: Codex just found a "workaround" of not having sudo on my PC

#210

Earlier quoted context omitted.

wait so just being lazy and using sudo on Docker commands instead of figuring things out actually means I'm being safer? awesome.

This feels like using Docker is just inherently unsafe.

Yes, that's why they warn you about it.
Post reply on HN