This repository contains the different sandboxes that we're using as part of VITAL. It was historically used for POCs, but was converted to be a repo for the sandboxes as most of the POCs were sandbox related.
All sandboxes are docker based. Create a folder to put your sandbox in, create a Dockerfile which creates your sandbox container and push. See various existing examples.
Note that nothing is "automatic" as of yet. Adding a sandbox here doesn't mean it's available on the VITAL platform directly. There are a few manual steps, which we've not had the time to automate.
We will follow our "Explore-Exploit-Mitigate" way of learning. Place the content in a markdown file, that should look like this
---
server_id: <the server id available in the prod_env.js>
language: node|python|...
---
<!-- explore-start -->
Put the content for the "Explore" section
<!-- explore-end -->
<!-- exploit-start -->
Put the content for the "Exploit" section
<!-- exploit-end -->
<!-- mitigate-start -->
Put the content for the "Mitigate" section
<!-- mitigate-end -->server_id is the way the node backend, firebase, and UI identify a particular problem and its sandbox. The comments <!-- xxx-start/xxx-end --> are case sensitive are used to split the markdown file into the different areas.
First, update the /problems collection
- "Add document" under
/problems. Let the ID be Auto ID. - Add
difficulty,titleas strings andsupportas an array. - Follow the next section to add the details of the ids and support.
- Find the problem under
/problems. - Under
/ids, create a new map with name as your language. - Add a key called
server_idinside that map, and its value as theserver_idthat you've decided. - Add your language in the
supportarray as well.
Example of how a new problem should look
Now, update the /problem_contents
- Create an
.envfile insidecontent-generatorfolder. Add a keyGOOGLE_APPLICATION_CREDENTIALS, and value as the path to the JSON file that you can use to get admin access. For the file, look in Project settings > Service accounts > Generate new private key. FYI, you'll need to do this only once. - Add the path of markdown file you just wrote, relative the root of the repo, here.
- Run
node index.jsinsidecontent-generatorfolder. You will have to runnpm installto get the dependencies of the project once as well.
