Live data from Hacker News

Cloudflare Sandbox SDK

sandbox.cloudflare.com

81–90 of 95 posts

Re: Cloudflare Sandbox SDK

#81
post #71

There is an open question about how file persistence works. The docs claim they persist the filesystem even when they move the container to an idle state but its unclear exactly what that means - https://github.com/cloudflare/sandbox-sdk/issues/102

Sandbox is built on top of their Durable Objects; the underlying storage is $0.20/ GB-month.

You’re saying the file system in the container is persisted to the durable object storage? That doesn’t sound right.

Re: Cloudflare Sandbox SDK

#82
post #75
post #72

Earlier quoted context omitted.

This code has to run inside their Worker's platform; _technically_ you can compile Go to WASM and get it to run; but practically it is Javascript only.

Python for Workers is coming eventually. https://developers.cloudflare.com/workers/languages/python/ https://blog.cloudflare.com/python-workers/

It's already live. Has been available for a while.

Re: Cloudflare Sandbox SDK

#83
post #72
post #58

My one annoyance with cloudflare. Everything is JavaScript. Every example, all the things. But I guess that's catering to their audience. Over the past year you could definitely seem them shift their services more inline with other cloud providers because that's the inevitable requirement to penetrate enterprise and a broader audience. But part of that should require opening up to a bigger audience from a language pe…

This code has to run inside their Worker's platform; _technically_ you can compile Go to WASM and get it to run; but practically it is Javascript only.

IIUC this particular product runs in Linux containers, not in V8 isolates like Workers uses. The upside of this is broader ecosystem compatibility (you can use whatever language you want even if it doesn't compile efficiently to Wasm); the downside is that each container instance runs in a particular data center and you have to worry about the latency implications of that, whereas every Worker runs in every location.

Re: Cloudflare Sandbox SDK

#84
I’ll never use metered Cloudflare services. Just reckless to expose myself to the hazard of mega bills for small mistakes or DoS attacks. I wish more companies allowed prepayment for plans like Bunny.net does.

Re: Cloudflare Sandbox SDK

#86
post #55

Earlier quoted context omitted.

You can restrict outbound network to HTTP using the outbound worker mentioned elsewhere in the thread and filter the domain name of the outbound request against a whitelist of domains you control. The DNS resolution of the domain happens within the CF network stack that you have no control over and that can’t be overwritten in anyway meaning if you restrict outbound to Google.com, there’s no way for that request to e…

When you say that the filter would disallow connecting directly to IP addresses, how would that work? When I open a tcp connection, there's no reference to any domain name. Do you think CF would proactively resolve all the domain names in my whitelist (repeatedly, in case the IPs change) and check the IP I'm connecting to against the list of IPs those domains would resolve to? That sounds like a very brittle solution…

It sounds like you haven’t done the requisite research and are asking me to do it for you. That’s not very nice. The TLDR is that the outbound request doesn’t go directly to the internet. It first goes through your interposer worker where you can sent direct TCP requests and only allow HTTP requests through after filtering for domain.

Re: Cloudflare Sandbox SDK

#87
post #59

Earlier quoted context omitted.

You can restrict outbound network to HTTP using the outbound worker mentioned elsewhere in the thread and filter the domain name of the outbound request against a whitelist of domains you control. The DNS resolution of the domain happens within the CF network stack that you have no control over and that can’t be overwritten in anyway meaning if you restrict outbound to Google.com, there’s no way for that request to e…

Can I send a UDP packet to a server on port 53 and receive a packet back?

You choose. But you can also choose to block that.

Re: Cloudflare Sandbox SDK

#90
post #22
post #15

Earlier quoted context omitted.

This simple feature bumps up the complexity of such a firewall by several orders of magnitude, which is why no similar runtime (like Deno) offers it. Networking as a whole can easily be controlled by the OS or any intermediate layer. For controlling access to specific sites you need to either filter it at the DNS level, which can be trivially bypassed, or bake something into the application binary itself. But if you…

The most convincing implementation I've seen of this so far is to lock down access to just a single IP address, then run an HTTP proxy server at that IP address which can control what sites can be proxied to. Then inject HTTP_PROXY and HTTPS_PROXY environment variables so tools running in the sandbox know what to use.

Codex remote environments seem to do this, we had to add support (via two lines of code) for these proxy environment variables to our CLI to support talking to GitHub from these environments.
Post reply on HN