Naereen / Peut-on-coder-avec-OCaml-Python-et-C-par-SMS

Je souhaite répondre à la question suivante : peut on coder avec OCaml, Python et C par SMS ? Oui ! Attention, proof of concept à héberger soi-même localement, et c'est payant avec Twilio.com, et très expérimental ! Mais amusant !
https://perso.crans.org/besson/publis/Peut-on-coder-avec-OCaml-Python-et-C-par-SMS.git/
MIT License
7 stars 1 forks source link

Use this knowledge of Camisole to try to write "bull-proof multi-language script launcher" for my teaching activites #2

Open Naereen opened 3 years ago

Naereen commented 3 years ago

I want to write a wrapper script like run-camisoled, that can read a file in Python/OCaml/C, and safely pass it to Camisole VM, and pretty-print its JSON results!

For my teaching next year this would be veryyy useful!. TODO: read https://github.com/mcandre/linters and https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis and about sandboxing in general

Overview of the goal

So the setup is like this:

$ ls TP1_etudiants/
Etudiant1.py Etudiant2.py ... Etudiant49.py
$ python EtudiantHackeur.py
==> all your data belogns to us!
==> destroying your laptop
==> cry and just quit your job already, old man!

To avoid such catastrophy, the solution would be

$ run-camisoled EtudiantHackeur.py
print output of this script, but ran from a FULLY secure isolated environment!

I want to have this "multi-language" launcher script that can execute Python3, OCaml 4.05+, C11 (and more) code, in a safe and secure environment.

A few reasons for that:

So my solution should:

Bonus idea?

Features for just OCaml

Features for just Python

Features for just C

Tools to use?

Naereen commented 3 years ago

See https://stackoverflow.com/questions/66287065/how-unsafe-can-it-be-to-read-ot-to-use-a-linter-of-an-untrusted-piece-of-code

Naereen commented 3 years ago

... I just discovered that python3 (and pypy3) command line have this option:

-I     : isolate Python from the user's environment (implies -E and -s)