jmbejar

jmbejar

Introducing the Online Elixir Console

Hi everyone! I’ve been lately working on the launching of the Online Elixir Console application, so I want now to share with the community my feelings and ideas around this project.

This website aims to be a mirror of iex on the internet, although we still have several features to implement to be comparable with this tool. I think that it is imperative to provide a way to people coming from other languages to try out Elixir without installation requirements. By the way, it is another example of an application built with Phoenix LiveView :smile:

At the heart of the project, I’ve been playing with the idea of running Elixir from unknown users relying on a pure-Elixir solution. This solution is, of course, a controversial idea. I had conversations with some people that think that is a hazardous approach, and I empathize with that feeling to some extent. I’m not explicit here about the security implicates of this project because I already wrote about it in the README of the project. Please take a look at it if you find this topic interesting.

Why sticking to a pure-Elixir solution?

Let’s first mention the alternative to have an online application that accepts Elixir code from users and execute it. We could have a setup where the system spawns a dedicated node for each user and keep it around while the session is alive. The user could send subsequent commands, and the backend routes them to the isolated node, where any resource abuse is limited. Limiting some parts of Elixir/Erlang is easier on a per-node basis.

While this solution is more complicated in the infrastructure side, it is feasible and easier to reason from a security point of view. However, it still is my interest to explore further “how much Elixir” can be run with a solution that is more accessible for others. If we can archive that with a pure-Elixir solution, an Elixir package can include a reusable solution for this purpose.

Do I think it is possible to run Elixir code securely in this way? Well, I’m not 100% sure yet. I’m not saying that the deployed Elixir Web Console has known security issues. It does not have any that I’m aware of at the time of writing this. I’m kind of confident with what we have now. At the same time, I’m still waiting for more people using it to have a more solid opinion on the matter. I’m also aware that there are exciting aspects of Elixir that are not currently supported because it would require extra work and research to make it safe.

So, for me, this idea of implementing this so-called “Elixir Sandbox” is a research initiative. Let’s see how far it goes.

How is it going so far?

How is the application doing after its release, in terms of stability, security, and so? Well, the first day, we had a few incidents and security reports, but I was able to solve all these issues during the week. After that point, the application was up and running. We still could see some attempts to break it down in the logs, but this is not intrinsically evil. We think that the curiosity about the security of all this stuff motivated early users to try to prove how good it is the solution, and it’s helping us with the research after all. Keep doing, folks!

Among other existing functional issues that we still have to fix, we plan to add more capabilities (read the README to know the roadmap better). I’m confident about the chances to keep doing it well with a pure-Elixir solution. However, if we notice this is not possible or inconvenient, we will take the approach where the execution of the user code happens in an isolated node.

Regarding the current implementation side of this project, I would like to spend more time trying out some stuff that I learned recently. I’m pretty sure some parts of the code are more complicated than needed, but changes have to be done with caution since our app is already live :D. I can discuss these ideas in this thread if interest exists.

Your feedback is welcome!

If you want to know a little more about the Online Elixir Console and the “Sandboxed Elixir” thing, please take a look at the documentation in the project repository.

I would love to spark a conversation here about the limitations, the implementation, and the future roadmap, so please ask if you have questions. Comments or additional thoughts are more than welcome :relaxed:

Website: https://elixirconsole.wyeworks.com/
Github: GitHub - wyeworks/elixir_console: Elixir Web Console · GitHub

Where Next?

Popular in Discussions Top

CharlesO
Erlang :list.nth simple, but 1 - based nth(1, [H|_]) -> H; nth(N, [_|T]) when N > 1 -> nth(N - 1, T). Elixir Enum.at … coo...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31707 143
New
ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54996 245
New
tmbb
This is a post to discuss the new Phoenix LiveView functionality. From Chris’s talk, it appears that they generate all HTML on the serve...
342 18595 126
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31525 112
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New