Skip to content

Commit 4eccf72

Browse files
committed
update
1 parent 258cda6 commit 4eccf72

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

README.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A repo to help you run code in a safer manner in the web3 ecosystem. You open up your code in an isolated docker environment so you have a smaller chance of getting hacked.
66

7-
*Important: This isn't a fail-safe!*
7+
*Important: This isn't a fail-safe! There is no 100% secure way to run code you are unfamiliar with. But running code in an isolated environment is at least much better.*
88

99
You can read more about the importance of sandboxing, containers vs VMs, and more in the [Red Guild Blog](https://blog.theredguild.org/where-do-you-run-your-code/).
1010

@@ -28,6 +28,7 @@ You can read more about the importance of sandboxing, containers vs VMs, and mor
2828
- [Mounted](#mounted-1)
2929
- [Using on an existing project](#using-on-an-existing-project-1)
3030
- [Acknowledgements](#acknowledgements)
31+
- [Security considerations](#security-considerations)
3132

3233
## Why are dev containers important?
3334

@@ -121,9 +122,9 @@ You should get opened up into a new window that looks like this:
121122
<br />
122123
</p>
123124

124-
3. Clone your project into the `projects` folder
125+
You should be at `/workspace` folder.
125126

126-
You should be at `/workspace`.
127+
3. You can then clone a project into the `projects` folder and start working on it
127128

128129
```bash
129130
git clone https://github.com/Cyfrin/foundry-fund-me-cu # Example project
@@ -132,11 +133,11 @@ forge build
132133
forge test
133134
```
134135

135-
This will clone the project into the `projects` folder and you can start working with your projects, knowing that scripts are isloated to this dev container!
136+
Now, you can start working on the project knowing you're in a safer environment!
136137

137138
4. Tear down
138139

139-
When you're done, you can delete the docker container in your docker dashboard, or run `docker ps` to get the container ID and run `docker stop <container-id>` to stop the container.
140+
When you're done, you can delete the docker container in your docker dashboard, or run `docker ps` *on your host machine, not inside your dev container* to get the container ID and run `docker stop <container-id>` to stop the container.
140141

141142
To do it via the CLI, back on your host machine run:
142143

@@ -240,3 +241,15 @@ Resource Limits:
240241

241242
# Acknowledgements
242243
- [The Red Guild](https://blog.theredguild.org/where-do-you-run-your-code/)
244+
245+
# Security considerations
246+
247+
Using a dev container is not a 100% secure way to run code you are unfamiliar with. It is a safer way to run code, but it is not foolproof. You may still want to be nervous about running code you're unfamiliar with! There are a number of exploits to be aware of, including:
248+
249+
- Network access: Unless you restrict network access in your docker container, it can still access the internet. This means it can still send data to a remote server.
250+
- Resource constraints: Docker containers can still use up all your CPU and memory if you're not careful. You can also adjust your `Dockerfile` to account for these.
251+
- Docker escape exploits: There can still be ways to escape a docker container and access your host machine. These are rare, but they do exist.
252+
253+
There are a few things to consider that we've more or less covered for you in this repo, but important to know:
254+
- Never run a docker container with a `root` user, this is why we use the `vscode` user in the `Dockerfile`
255+
- Volume mounting: If you mount a volume from your host machine, the container can access your host machine's files. Be careful what you mount! This is why the default here is `unmounted`

img/dev-container-image.png

13.3 KB
Loading

0 commit comments

Comments
 (0)