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
,title
as strings andsupport
as 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_id
inside that map, and its value as theserver_id
that you've decided. - Add your language in the
support
array as well.
Example of how a new problem should look
Now, update the /problem_contents
- Create an
.env
file insidecontent-generator
folder. 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.js
insidecontent-generator
folder. You will have to runnpm install
to get the dependencies of the project once as well.