You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**ZSH**. Configured with Oh-My-ZSH and autocompletions for: **medusa**, **anvil**, **cast**, **forge**.
111
117
112
118
### Additional Repositories
119
+
113
120
-**building-secure-contracts**: Repository with security-focused Solidity examples.
114
121
115
122
### Notes
123
+
116
124
- Remember to disable telemetry. `Ctrl+Shift+P > Open Settings (UI) >` type `telemetry` and uncheck
117
125
all the boxes. Alternatively you can add them directly by going to `Open Settings (JSON)`, example:
126
+
118
127
```json
119
128
"telemetry.telemetryLevel": "off",
120
129
"gitlens.telemetry.enabled": false,
121
130
"partialDiff.enableTelemetry": false,
122
-
```
123
-
131
+
```
124
132
125
-
## Manual interventions & info
133
+
###Manual interventions & info
126
134
127
135
### Hardening: Enabling SELinux
136
+
128
137
SELinux (Security-Enhanced Linux) is a mandatory access control (MAC) system that restricts processes and users to only the resources they are explicitly allowed to access, enhancing system security.
129
138
130
139
You can check if you have this already enabled by running `sudo sestatus`
131
140
132
141
If you don't have SELinux installed, and you really want up your game, and protect your host from
133
142
container escapes go ahead and install it. Find whichever guide convinves you the most! Afterward,
134
143
enable it inside `/etc/docker/daemon.json` (it should be enabled by default afaik).
144
+
135
145
```bash
136
146
❯ cat /etc/docker/daemon.json
137
147
{
138
148
"selinux-enabled": true
139
149
}
140
150
```
141
151
142
-
To manually disable SELinux you can uncomment the following line:
152
+
### Hardening: Enabling seccomp
153
+
154
+
seccomp is a Linux kernel feature that restricts the system calls that a process can make. It's a more
155
+
restrictive security mechanism than SELinux.
156
+
157
+
To manually enable seccomp you can specify a profile like this:
158
+
143
159
```json
144
-
// Disable SELinux.
145
-
// "--security-opt", "seccomp=unconfined"
160
+
"--security-opt", "seccomp=profile.json"
146
161
```
147
162
148
163
### Hardening: Enabling AppArmor
164
+
149
165
AppArmor is a Linux security module that enforces file and network access restrictions for applications through profiles. It sometimes can be more straighforward than SELinux.
150
166
151
-
You can check it has been enabled by running `sudo apparmor_status`.
167
+
You can check it has been enabled by running `sudo apparmor_status`.
152
168
153
169
This has been enabled via the argument:
170
+
154
171
```json
155
172
"--security-opt", "apparmor:docker-default"`
156
173
```
157
174
158
-
159
175
### Hardening: Dropping capabilities
176
+
160
177
Capabilities in Linux are fine-grained permissions that allow processes to perform specific
161
178
privileged operations without granting full root privileges. They break down the all-or-nothing
162
179
nature of root access into smaller, specific rights, improving security.
163
180
164
-
We have done this by running the following argument:
181
+
We have done this by running the following argument:
182
+
165
183
```json
166
184
"--cap-drop=ALL"
167
185
```
@@ -170,21 +188,24 @@ This allows us to reduce attack surface by limiting privileged operations. And a
Currently semgrep supports [Solidity](https://semgrep.dev/docs/language-support/) in `experimental` mode. Some of the rules may not work until Solidity is in `beta` at least.
233
256
234
257
> **Important:** Some of the rules utilize the [taint mode](https://semgrep.dev/docs/writing-rules/data-flow/taint-mode), which is restricted to the same function in the open-source version of semgrep. To take advantage of intra-procedural taint analysis, you must include the `--pro` flag with each command. Please note that this requires semgrep Pro.
@@ -278,7 +301,9 @@ and manage multiple versions of tools like Go, Python, Node.js, and more, all in
278
301
especially useful for projects requiring specific tool versions.
- Article (references this repo's branch article): [Where do you run your code?](https://blog.theredguild.org/where-do-you-run-your-code/)
354
+
- Article (references this repo's branch article): [Where do you run your code II? - hardening](https://blog.theredguild.org/where-do-you-run-your-code-part-ii-2/)
324
355
- Workshop: [Come and build your own devContainer!](https://eth-security-explorations.notion.site/Come-and-build-your-own-devContainer-13b3c0d74d7f448f836419281d916369) @ the-mu
0 commit comments