Skip to content

Commit 0b0cd91

Browse files
committed
fix: make checksum validation mandatory, clean up ecosystem docs
1 parent ebc53fb commit 0b0cd91

5 files changed

Lines changed: 32 additions & 30 deletions

File tree

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ Add a cooldown period if you want an extra buffer before newly published action
113113

114114
| Input | Description | Required | Default |
115115
| --------------------- | ---------------------------------------------------------------- | -------- | -------------------- |
116-
| `checksum-validation` | Verify SHA256 checksum of downloaded binaries | No | `true` |
117116
| `firewall-version` | Specify the firewall version number | No | `latest` |
118117
| `github-token` | GitHub API Token used for downloading binaries | No | `${{ github.token}}` |
119118
| `job-summary` | Create a [job summary][job-summary] (`all`, `errors`, or `none`) | No | `all` |
@@ -211,7 +210,6 @@ Add a cooldown period if you want an extra buffer before newly published action
211210

212211
| Input | Description | Required | Default |
213212
| --------------------- | ---------------------------------------------------------------- | -------- | -------------------- |
214-
| `checksum-validation` | Verify SHA256 checksum of downloaded binaries | No | `true` |
215213
| `firewall-version` | Specify the firewall version number | No | `latest` |
216214
| `github-token` | GitHub API Token used for downloading binaries | No | `${{ github.token}}` |
217215
| `job-summary` | Create a [job summary][job-summary] (`all`, `errors`, or `none`) | No | `all` |
@@ -228,26 +226,37 @@ Add a cooldown period if you want an extra buffer before newly published action
228226

229227
### Supported Ecosystems
230228

231-
The following package managers are supported and will have shims created automatically (when `shims` is `true`):
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.
232230

233-
| Package Manager | Ecosystem | Command |
234-
| --------------- | ----------------- | --------------- |
235-
| `npm` | JavaScript/Node | `npm install` |
236-
| `pnpm` | JavaScript/Node | `pnpm install` |
237-
| `yarn` | JavaScript/Node | `yarn install` |
238-
| `pip` | Python | `pip install` |
239-
| `pip3` | Python | `pip3 install` |
240-
| `cargo` | Rust | `cargo fetch` |
231+
#### Free + Enterprise
241232

242-
### Checksum Validation
233+
Available in both [sfw-free][sfw-free-ecosystems] and [sfw-enterprise][sfw-enterprise-ecosystems]:
243234

244-
By default the action validates the SHA256 checksum of the downloaded firewall binary against the checksum file published alongside each release. This helps make sure the binary was not tampered with during download. You can disable this if needed:
235+
| Ecosystem | Package Manager |
236+
| ------------------- | --------------- |
237+
| JavaScript/Node | `npm` |
238+
| JavaScript/Node | `pnpm` |
239+
| JavaScript/Node | `yarn` |
240+
| Python | `pip` |
241+
| Python | `uv` |
242+
| Rust | `cargo` |
245243

246-
```yaml
247-
- uses: SocketDev/action@v1.3.1
248-
with:
249-
mode: firewall-free
250-
checksum-validation: 'false'
251-
```
244+
#### Enterprise only
245+
246+
Additional ecosystems available with [sfw-enterprise][sfw-enterprise-ecosystems]:
247+
248+
| Ecosystem | Package Manager | Note |
249+
| ------------------- | --------------- | ------------ |
250+
| .NET | `nuget` | |
251+
| Go | `go` | Linux only |
252+
| Ruby | `bundler` | |
253+
| Ruby | `gem` | |
254+
255+
[sfw-free-ecosystems]: https://github.com/SocketDev/sfw-free?tab=readme-ov-file#supported-package-managers
256+
[sfw-enterprise-ecosystems]: https://github.com/SocketDev/firewall-release/wiki#support-matrix
257+
258+
### Checksum Validation
259+
260+
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.
252261

253262
[job-summary]: https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries

action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ branding:
99
color: purple
1010

1111
inputs:
12-
checksum-validation:
13-
description: Verify SHA256 checksum of downloaded binaries
14-
default: 'true'
15-
1612
firewall-version:
1713
description: Specify the firewall version number
1814
default: latest

dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ process.on('unhandledRejection', errorHandler)
1818
process.on('uncaughtException', errorHandler)
1919

2020
const inputs = {
21-
checksumValidation: core.getBooleanInput('checksum-validation'),
2221
jobSummary: core.getInput('job-summary', { required: false }).toLowerCase(),
2322
mode: core.getInput('mode', { required: true }).toLowerCase(),
2423
patchCwd: core.getInput('patch-cwd'),

src/tools/firewall.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,9 @@ export default async function download ({ edition = 'free', ...inputs }) {
179179
// download the binary
180180
const pathDownload = await tool.downloadTool(url)
181181

182-
// if checksum validation is turned on, verify the download
183-
if (inputs.checksumValidation) {
184-
const checksumUrl = `${url}.sha256`
185-
await validateChecksum(pathDownload, checksumUrl)
186-
}
182+
// always validate the checksum to make sure the binary wasnt tampered with
183+
const checksumUrl = `${url}.sha256`
184+
await validateChecksum(pathDownload, checksumUrl)
187185

188186
// cache it so we dont have to download again next time
189187
pathCache = await tool.cacheFile(pathDownload, nameExec, ...cacheOptions)

0 commit comments

Comments
 (0)