Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

Yep, back to passwords, but less secure ones.


uv run is using virtual envs, that's the de facto standard, and those are sandboxes for python deps. So it already is.

Plus inline deps mean you can pin python versions and 3rd party modules using pyproject.toml syntax in a comment of your script. This is not perfect locking, as it doesn't pin sub dependencies, but it's already more that any other tool out there.

If you want perfect locking, create a project, and use uv lock. You are already in a different category of code.


OP isn't talking about virtual environment style sandboxing, they're talking about sandboxes that prevent arbitrary code from deleting or stealing any information your user account has access to on your computer.


This has been attempted many times with python, and always been a failure because of the dynamism of the language, even by big actors.

The solution, therefor, as always been to use the OS tooling for that. Even the .Net ecosystem eventually went into that direction.

The JS ecosystem is making that mistake right now, and will of course, deprecate this API in 10 years after they realize they can't make it secure either unless they basically reimplement BSD jails entirely.


Deno has had this feature for five years already, since May 2020: https://deno.com/blog/v1


Run it in a Docker container?


Docker isn’t a sandbox and shouldn’t be treated like one. Admittedly if I’m going to run untrusted code I’ll run it in Docker, but I’m aware that whatever I’m running could break out. I wouldn’t blindly run some bullshit even in Docker unless I’m 90% sure it’s safe already.


Why is Docker (or extensions thereof) not a sandbox? Granted, it could access the internet, but that's necessary.


Docker's primary purpose is to give applications their own namespaces in which they can run without conflict. It does confine applications to their own root filesystem, own process namespace and so on, but this isn't intended as a security boundary. cgroup escapes happen.

Firecracker and gVisor provide much stronger isolation. Both are battle tested; clouds run millions of multi-tenant workloads on these every day. Docker would simply never even be a candidate for this purpose.


How do you get to 90% sure for code that has any dependencies?


>but I’m aware that whatever I’m running could break out

If you have a working docker escape exploit at hand, that works on unprivileged containers, you can earn some good money. Just saying.

Docker was not created as a sandbox, but people rely on it for security and it is a sandbox at this point. Hell, containerd is one of kuberbetes backends and it absolutely relies on it being a secure sandbox.


You know how you can "uv run" python code from a text file using just a URL?

No? Well, you can:

uv run https://pastebin.com/raw/RrEWSA5F

And since yesterday, you can even run a github gist:

uv run https://gist.github.com/charliermarsh/ea9eab7f56b1b3d41e5196...


Or more generally, pipe your script into stdin.

> print("hi")' | uv run -

> curl https://pastebin.com/raw/RrEWSA5F | uv run -


You can also get text from Gists by add .txt

https://gist.github.com/charliermarsh/ea9eab7f56b1b3d41e5196...


This is what the code does more or less.


It's lovely to see how PHP keeps growing. It's far from what it was when I used to code with it in V3. I really thought it would be lost in its bad design, but the core devs kept at it, and it is, indeed, a pretty decent language now.


> Someone should make a static-site social media platform for full compatibility.

Isn't that https://subreply.com/ ?


After 2001 the US lost the habeas corpus in total silence. The Snowden revelations demonstrated that you can have a stage level conspiracy unveiled, and again nothing Will happen.

The writing has been on the wall for 2 decades: laws don't matter there.


HN has been cheering for those types of people for as long as I have been here. Musk seldom even sees his 10 kids, except one. Jobs just decided that raising his daughter was not his problem.


HN has been very anti-grind, anti-working hard for as long as I’ve been reading it.


Really? We must have been reading two different HNs. I have the impression that posts appreciating work-life balance get more upvotes that the ones trying to sell you "your career is the most important thing you have" narrow outlook.


My sleep gets worse when I take creatine, so maybe it doesn't improve sleep, but rather helps mitochondria to get by without sleep?


I'm obese, have sleep apnea, and can't find any statement that I would consider lacking tact in OP's comments.

Yours on the other hand, I find plenty.


It's like saying Disney is an "image showing" company.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: