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
add actor start from local file #529
Conversation
This is an awesome feature that I have wanted for a while. That being said, i like the approach that Selfishly, that opens the door to another feature I have wanted, which is pulling artifacts over the lattice instead of having the host reach out directly to the internet |
I think that feature should exist too. |
There are some subtle security and distributed systems caveats with this feature. From a distsys perspective, if you send a control interface command to one host with a file path, that same request delivered to a different host could fail because the path doesn't exist, or it could fail because the host doesn't even have an accessible local file system (think IoT or browser host). Once the actor is running in that host, no other host has convenient access to the actor bytes, so things like scaling an actor to multiple hosts or performing a live update can become problematic. From a security point of view, if the host is able to perform arbitrary file reads at the request of a control client, then the target host can become vulnerable to DDoS or things like "zip bomb" or other types of attacks. Further, the host has to read the file off of disk before getting its claims to run through the policy checker. This is a less secure option than having wash give the host an OCI or bindle URL. I'm not saying we shouldn't do this. I definitely think that we should be able to type something like I wonder if there's a secure way of implementing this from the developer's point of view without making the host read the file system and still have this work across the lattice. One possible way of having it both ways would be to add an environment variable like |
I totally agree. This feature, as implemented, should not be used in a production environment. How about I rework it to only work if |
I like the idea of having this be disabled by default for wasmCloud, but enabled by default for wash which is designed as a dev tool. As far as wash being used in production, our recommendation is to instead run NATS and the wasmCloud host on their own. However, we should revisit this and see what we could do. I think we've made solid decisions for wash like making every command have a JSON output option so it can be used with scripts. |
What are your thoughts on, before reading the file reference, examining the metadata of the file to make sure it's under some size limit? I'm not sure if that would mitigate zip bombs or just limit actor size (which we could comfortably cap at like 5MB) |
Playing devils advocate here, the |
From
|
huzzah, got updates working and tested scale as well need to add tests, but would love any guidance if there's things to fix cheers 😸
|
I think this is finally ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly nits!
Signed-off-by: pgray <contact@pgray.xyz>
addressed nits. sorry for the the force-pushing 🙃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice add @pgray !
@brooksmtownsend @pgray I noticed a typo introduced in this commit as I was looking through the codebase. I'm investigating locally for funsies and experience as we speak, but figured that I ought also to flag you now in case someone will want to spin out a new issue or whatever. (I haven't yet tried to witness any associated regression.) |
Oh boy, that's a great catch @nihil2501. Thankfully this is in a relatively niche area of the codebase with a config service, but your PR and catch is super helpful. Thank you |
Haven't written elixir before so I wanted to try with a tiny feature add.
This would allow a wasmcloud host to start an actor from the local filesystem.
Will try to add tests soon.