-
Notifications
You must be signed in to change notification settings - Fork 113
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
Restrict the labels that can be attached to pseudo-Nodes #1669
Comments
More formally, I think what we want to check is that each of those nodes, once instantiated, are able to write to a public channel, at least in principle, based on their label and privilege. For instance, the log node does not have any privilege, therefore the check boils down to whether its label is already public. If not, then we can probably fail at creation time rather than wait for the first message to arrive, since labels are static anyways. Note that the implementation of the log node does not actually write to any actual public oak channel, but the check is the same as if it were. Similarly, an HTTP client for domain example.com would already have the privilege to declassify the |
In fact I think this may be solved elegantly by calling Lines 753 to 759 in 2fbd54a
|
Using the terminology from the Flume paper, any native side effect that a pseudo-node performs is effectively modelled as an uncontrolled channel, which is not within the realm of IFC itself, but it may be considered as a public channel. |
There is a slight complication with implementing this check as part of node creation. I am doing something roughly similar to this as part of #1673 to fix #814 and ran into the issue. The label associated with a node is not passed to the |
An alternative (perhaps better) way of doing this may be to actually let the runtime perform this check automatically for "uncontrolled" nodes. We may pass a bool / enum that determines whether the node is uncontrolled, and if so then the runtime would perform the downgrade check after instantiation, but before returning from the |
It should work. It might still be a good idea for these nodes to also validate before taking actions that would violate IFC (e.g. the gRPC client node should check that it has the right label and privilege before connecting to an external service) as a defence-in-depth mechanism. This should keep the system safe even if there is a different code path that allows for bypassing the creationg checks. |
After some further investigation, I think we can do this in the runtime by adding |
👍 that's what I also meant when I was referring to "uncontrolled" or "native" nodes (though I don't like either of these names) and having a bool / enum to indicate that. not sure whether "external facing" is much better, though we can change the naming later on in any case. |
Yes, I assumed "uncontrolled" meant the same as "external facing". I also don't like any of them very much, so happy to change when we think of a better name. |
An Oak Application creates a pseudo-Node using the normal
node_create
ABI entrypoint, and this entrypoint includes alabel
parameter. However, each pseudo-Node type communicates with the world outside of Oak in some manner, so we should police the labels attached to pseudo-Node creation to ensure that information can't unexpectedly escape.public_untrusted
should fail.public_untrusted
node can create other Nodes, but such a node could create a logging pseudo-Node with label (say)user:X
and pass the associated logging channel handle to a Wasm Node also with labeluser:X
.)domain:*
should be rejected.user:*
or bearer token tags should be rejected.The text was updated successfully, but these errors were encountered: