-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restricted access to certain domains #32
Comments
Thanks for reaching out! Even though it is not part of the official spec goals, it is very much a personal goal of mine to facilitate domain name based firewalling. A couple examples of the intended level of permissions can be seen here. What is a hard goal, however, is that:
Merging In general, the limiting factor is the abstraction level this proposal is targeting. BSD-compatible sockets don't have a notion of domain names. So any solution that applies domainname-based restrictions on sockets is going to be an imperfect solution in some way or another. But that shouldn't stop us from trying to get the most out of it, ofcourse! The current direction I'm thinking in, is to let the Wasm module "proof" the relationship between a domain name and an ip address to the embedder by performing a DNS lookup. Example:
A while ago I made a POC to demonstrate this principle. This workflow is based on the presumption that applications usually perform a DNS lookup using the WASI-provided I don't know if this methodology is sound. There might be edge-cases. Other solutions are also welcome, ofcourse. |
Thanks a lot for sharing your thoughts on this! I think it makes sense to think about network capabilities in two different ways. For libraries which are not aware of capabilities, the network capability is more like a static link-time capability. It has no way to pass it around, and any call to I'd also like to keep the door open for a dynamic network capability, though. One that can be explicitly passed around by code that is aware of the existence of such a capability. It would also have a method to derive a more restricted capability from it (e.g. The relationship between those two is probably quite similar to the relationship between Does this make sense? |
I don't think the current proposal closes any of those doors :) |
With WASI there's the chance to introduce security guarantees not possible with POSIX. One I'd be really looking forward to, would be to allow only access to certain domain names.
For being able to do so, it would be required to combine name resolution and
connect
calls. If we would be able to directly callconnect
with a domain name and (optionally?) the desired address family, we would be able to design a capability that only allows connecting to certain domain names.Without that, sockets can only be limited to (potentially large) IP ranges, and code calling
connect
would always have the possibility to connect to any IP address in this range.As an example: I'd like to use a client library for accessing AWS S3 buckets and I'd like to ensure that this library isn't doing requests to anything else. I'd like to be able to pass a capability to that library that only allows access to the specific domain of the bucket (my_bucket.s3.amazonaws.com) and nothing else.
In a two-step approach with name resolution and address-based
connect
, there could be a capability that limits the name resolution to only resolve that domain but for the socket I'd need to allow access to all of AWS's IP-ranges for the desired region. There would be nothing that prevents the library from doing any other requests to any of the IPs in those ranges.If we would be able to directly specify domain names as remote addresses in the socket's
connect
, we could limit it to only that single domain, and wouldn't need to allow access to the whole set of IP-ranges.This would be a huge step forward in reducing software supply chain risks.
The text was updated successfully, but these errors were encountered: