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
@@ -21,6 +21,8 @@ Socket is a security control, so the action that installs it should be pinned, t
21
21
22
22
Downloads and installs [Socket Firewall: Free](https://github.com/SocketDev/sfw-free) edition in your GitHub Action job, making it available to use in subsequent steps.
23
23
24
+
By default the action creates shims for all supported package managers. This means you do **not** need to prefix your commands with `sfw` — just run your package manager like normal and it will be automatically routed through Socket Firewall.
25
+
24
26
#### Most secure: pin to a commit SHA
25
27
26
28
```yaml
@@ -37,14 +39,17 @@ jobs:
37
39
with:
38
40
mode: firewall-free
39
41
42
+
# these commands are automatically intercepted by sfw
43
+
# no need to prefix with "sfw" anymore!
44
+
40
45
# javascript / typescript
41
-
- run: sfw npm install # or yarn, pnpm
46
+
- run: npm install # or pnpm, yarn
42
47
43
48
# rust
44
-
- run: sfw cargo fetch
49
+
- run: cargo fetch
45
50
46
51
# python
47
-
- run: sfw pip install -r requirements.txt
52
+
- run: pip install -r requirements.txt
48
53
```
49
54
50
55
#### Slightly less secure: pin to an immutable version tag
@@ -64,13 +69,27 @@ jobs:
64
69
mode: firewall-free
65
70
66
71
# javascript / typescript
67
-
- run: sfw npm install # or yarn, pnpm
72
+
- run: npm install # or pnpm, yarn
68
73
69
74
# rust
70
-
- run: sfw cargo fetch
75
+
- run: cargo fetch
71
76
72
77
# python
73
-
- run: sfw pip install -r requirements.txt
78
+
- run: pip install -r requirements.txt
79
+
```
80
+
81
+
#### Disable shims (explicit sfw prefix)
82
+
83
+
If you prefer to keep using the `sfw` prefix explicitly, you can turn off automatic shims:
84
+
85
+
```yaml
86
+
- uses: SocketDev/action@v1.3.1
87
+
with:
88
+
mode: firewall-free
89
+
shims: 'false'
90
+
91
+
# now you need to explicitly prefix commands with sfw
92
+
- run: sfw npm install
74
93
```
75
94
76
95
#### Dependabot config
@@ -92,23 +111,26 @@ Add a cooldown period if you want an extra buffer before newly published action
| `firewall-path-report` | Path to the generated firewall report JSON |
107
126
| `firewall-path-binary` | Path to the installed binary |
127
+
| `firewall-path-report` | Path to the generated firewall report JSON |
108
128
109
129
### Socket Firewall: Enterprise
110
130
111
-
Downloads and installs [Socket Firewall: Enterprise](https://github.com/SocketDev/firewall-release) edition in your GitHub Action job, making it available to use in subsequent steps as a wrapper.
131
+
Downloads and installs [Socket Firewall: Enterprise](https://github.com/SocketDev/firewall-release) edition in your GitHub Action job, making it available to use in subsequent steps.
132
+
133
+
Like the free edition, the action creates shims by default so you can use your package manager commands normally without the `sfw` prefix.
112
134
113
135
#### Most secure: pin to a commit SHA
114
136
@@ -127,14 +149,17 @@ jobs:
127
149
mode: firewall-enterprise
128
150
socket-token: ${{ secrets.SOCKET_API_KEY }}
129
151
152
+
# these commands are automatically intercepted by sfw
153
+
# no need to prefix with "sfw" anymore!
154
+
130
155
# javascript / typescript
131
-
- run: sfw npm install # or yarn, pnpm
156
+
- run: npm install # or pnpm, yarn
132
157
133
158
# rust
134
-
- run: sfw cargo fetch
159
+
- run: cargo fetch
135
160
136
161
# python
137
-
- run: sfw pip install -r requirements.txt
162
+
- run: pip install -r requirements.txt
138
163
```
139
164
140
165
#### Slightly less secure: pin to an immutable version tag
@@ -155,13 +180,13 @@ jobs:
155
180
socket-token: ${{ secrets.SOCKET_API_KEY }}
156
181
157
182
# javascript / typescript
158
-
- run: sfw npm install # or yarn, pnpm
183
+
- run: npm install # or pnpm, yarn
159
184
160
185
# rust
161
-
- run: sfw cargo fetch
186
+
- run: cargo fetch
162
187
163
188
# python
164
-
- run: sfw pip install -r requirements.txt
189
+
- run: pip install -r requirements.txt
165
190
```
166
191
167
192
#### Dependabot config
@@ -183,19 +208,83 @@ Add a cooldown period if you want an extra buffer before newly published action
| `firewall-path-report` | Path to the generated firewall report JSON |
199
224
| `firewall-path-binary` | Path to the installed binary |
225
+
| `firewall-path-report` | Path to the generated firewall report JSON |
226
+
227
+
### Supported Ecosystems
228
+
229
+
When `shims` is `true` (the default), the action creates shims so package manager commands are automatically routed through sfw. The supported ecosystems depend on the edition.
230
+
231
+
#### Free + Enterprise
232
+
233
+
Available in both [sfw-free][sfw-free-ecosystems] and [sfw-enterprise][sfw-enterprise-ecosystems]:
234
+
235
+
| Ecosystem | Package Manager |
236
+
| ------------------- | --------------- |
237
+
| JavaScript/Node | `npm` |
238
+
| JavaScript/Node | `pnpm` |
239
+
| JavaScript/Node | `yarn` |
240
+
| Python | `pip` |
241
+
| Python | `pip3` |
242
+
| Python | `uv` |
243
+
| Rust | `cargo` |
244
+
245
+
#### Enterprise only
246
+
247
+
Additional ecosystems available with [sfw-enterprise][sfw-enterprise-ecosystems]:
When shims are enabled the action exports `SFW_SHIM_DIR` as an environment variable pointing to the shim directory. If you need to bypass sfw for a specific step (e.g. `npm publish`), you can temporarily disable the shims by renaming them and restore them afterwards:
262
+
263
+
```yaml
264
+
# disable shims before publishing
265
+
- name: Disable sfw shims
266
+
run: |
267
+
if [ -n "$SFW_SHIM_DIR" ] && [ -d "$SFW_SHIM_DIR" ]; then
268
+
for SHIM in "$SFW_SHIM_DIR"/*; do
269
+
[ -f "$SHIM" ] && mv "$SHIM" "${SHIM}.disabled"
270
+
done
271
+
fi
272
+
273
+
- run: npm publish
274
+
275
+
# re-enable shims after publishing
276
+
- name: Restore sfw shims
277
+
if: always()
278
+
run: |
279
+
if [ -n "$SFW_SHIM_DIR" ] && [ -d "$SFW_SHIM_DIR" ]; then
280
+
for SHIM in "$SFW_SHIM_DIR"/*.disabled; do
281
+
[ -f "$SHIM" ] && mv "$SHIM" "${SHIM%.disabled}"
282
+
done
283
+
fi
284
+
```
285
+
286
+
### Checksum Validation
287
+
288
+
The action validates the SHA256 checksum of the downloaded firewall binary against the checksum file published alongside each release. This ensures the binary was not tampered with during download.
0 commit comments