Skip to content

sfw and taskgate: pnpm through Socket Firewall, and every workflow step one task - #50

Merged
aledbf merged 7 commits into
mainfrom
sfw
Oct 24, 2026
Merged

aledbf merged 7 commits into
mainfrom
sfw

Conversation

@aledbf

@aledbf aledbf commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What

go tool sfw: pnpm is the one package manager, and it installs through Socket Firewall

  • go tool sfw pnpm install ... runs pnpm through Socket Firewall Free, which refuses packages Socket has confirmed as malware before they are downloaded.
    • The binary is pinned by sha256 for linux and darwin, amd64 and arm64, in cmd/sfw/versions.yaml, which the command embeds.
    • It is fetched once into the user's cache and checked against its pin on every run, because Socket does not sign the binaries.
    • The version is v1.15.4: v1.15.6 was a day old, and the rule here is a week.
  • go tool sfw check fails on:
    • npm, npx, yarn, bun or bunx anywhere a command is written, through the firewall or not;
    • a pnpm command that fetches without the firewall;
    • package-lock.json, npm-shrinkwrap.json, yarn.lock or bun.lock;
    • a package.json without "packageManager": "pnpm@<version>".

go tool taskgate: every workflow step is one task

  • Every run: step of a workflow or composite action has to be a single task ... or go tool task ... line. What CI does is written once, in the Taskfile, and a developer runs the same thing.
  • -allow <file> lists the steps that are not a task on purpose, as <file>/<job>/<step> # why. A line that matches no step fails too.

This repository

  • ci.yml and pages.yml run only tasks. The coverage summary and mutate's choice of base were shell in the workflow; they are now task coverage and task mutate.
  • The only two exemptions are the steps that read Task's pin before Task exists. go-tools is a library, so it does not take Task into its go.mod: its importers would get Task's modules (grpc and more) in their module graph. Applications should use go tool task instead.
  • task lint runs both gates. task site installs through the firewall.
  • Docs: new sfw and taskgate pages, and README rows.

Checked

  • task test, task lint and task site pass.
  • task mutate BASE=origin/main: 141 refused, 0 survived. It first found 11 weak spots, which are now tested.
  • In the other spin-stack repos, taskgate reports: spin 35 steps, spin-machine 37, ami 23, devcontainer-cli 22, spin-terraform-aws 15, brand 7, website 4, shipset 3, skills 2. ci and spinbox.dev-deploy already pass.
  • sfw check finds pnpm installs without the firewall in spin and website, and yarn in devcontainer-cli.

🤖 Generated with Claude Code

aledbf and others added 2 commits October 24, 2026 14:58
The README was every tool's reference in one page, and nothing in it showed what a tool is for.
The site (site/, Astro Starlight, styled as spin-stack/website) is a page per tool in plain
words, published to GitHub Pages from main; the README is what each tool catches and the link.

mutate's page is a change whose tests execute every statement and miss a dropped field write.
The code, the tests and both outputs are cmd/mutate/testdata/example, which the site reads and
TestTheExampleTheSiteShows runs, so the page cannot say what mutate no longer prints. The tests
that used cmd/mutate as a package with no tests use cmd/ctxlife.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rough a task

An install runs a package's scripts the moment it lands, and a compromised release is in
thousands of node_modules within hours. go tool sfw runs the package manager through Socket
Firewall Free, which refuses confirmed malware before it is downloaded: the binary is pinned by
sha256 per platform in cmd/sfw/versions.yaml, embedded, fetched once into the user's cache and
checked on every run, since Socket does not sign it.

go tool sfw check is the gate, from task lint: a Taskfile, script or Dockerfile that fetches
packages without the firewall fails, and so does a workflow that runs a package manager at all,
so that CI runs the task a developer runs. This repository's site installs through it, and its
Pages workflow runs task site, with no store cache the firewall would not see.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf and others added 2 commits October 24, 2026 15:14
CI's mutate broke cmd/mutate/testdata/example, the site's example of a change with a field
write no test holds, and failed on the survivor it is there to show. The go command builds
nothing under testdata or a directory named with a leading . or _, so a change there is a
fixture's, written as it is on purpose: Changed leaves it out, committed or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from docs-site to main October 24, 2026 18:16
aledbf and others added 2 commits October 24, 2026 15:17
# Conflicts:
#	.github/workflows/pages.yml
#	README.md
#	Taskfile.yml
#	site/src/content/docs/index.mdx
#	site/src/content/docs/start.md
#	site/src/lib/nav.mjs
#	versions/gate/repo_test.go
…s one task

The Taskfile is there so a build is written once, for a laptop and for CI alike. taskgate holds
every run step of a workflow or composite action to one `task <name>` (or `go tool task`), with an
allowlist that is a ratchet; this repository's two are the steps that read Task's pin before
there is a Task - a library takes no Task into its go.mod, since its importers would take its
modules. Coverage's summary and mutate's base, shell in ci.yml until now, are tasks.

sfw check refuses npm, npx, yarn and bun wherever a command is written, their lockfiles, and a
package.json that does not name pnpm as its packageManager: one package manager is one lockfile
and one set of install rules. A workflow is judged as any other file now; taskgate holds it to
running tasks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf aledbf changed the title sfw: every npm install through Socket Firewall, and every workflow through a task sfw and taskgate: pnpm through Socket Firewall, and every workflow step one task Oct 24, 2026
@blacksmith-sh

This comment has been minimized.

Two edits answered at once are said in either order, so the golden matched only the runs that
finished them as it was written: CI's said the other. The example's outputs keep the edits
sorted, a survivor first, as the page says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/website that referenced this pull request Oct 24, 2026
…ne task

go-tools at 8cf54b0 (spin-stack/go-tools#50): Task is a go.mod tool, so the
Gate needs only setup-go and runs `go tool task gate`, the version a developer
runs. task gate runs `go tool taskgate` beside `go tool sfw check`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit 033f60d into main Oct 24, 2026
3 checks passed
@aledbf
aledbf deleted the sfw branch October 24, 2026 18:30
aledbf added a commit to spin-stack/brand that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/spin-machine that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/devcontainer-cli that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/website that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/spin-terraform-aws that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the gates run at main's commit rather than the PR's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/spin-terraform-aws that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the gates run at main's commit rather than the PR's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/website that referenced this pull request Oct 24, 2026
…ne task

go-tools at 8cf54b0 (spin-stack/go-tools#50): Task is a go.mod tool, so the
Gate needs only setup-go and runs `go tool task gate`, the version a developer
runs. task gate runs `go tool taskgate` beside `go tool sfw check`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/website that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/brand that referenced this pull request Oct 24, 2026
…heck

go-tools at 8cf54b0 (spin-stack/go-tools#50). The Gate's six checks were task
check written out again; it runs `go tool task check`, which now also runs
taskgate and `sfw check`. Unpacking the screens' images is task
screens:download, which a developer can run too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/brand that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/devcontainer-cli that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/spin-machine that referenced this pull request Oct 24, 2026
A step that ran its own shell was a second copy of the build that only
ever ran on a push. Each of the 37 is now `go tool task <name>`: an
existing task where one already did the same thing (boot:roms,
boot:compat), a new one beside it otherwise, with what only the
workflow knows in the step's env: and its outputs, env and summary
written by the task (to stdout outside CI).

Task is a go.mod tool at 3.54.0, the version versions.yaml pins for
the image, so a workflow needs only setup-go, and the Taskfiles call
themselves through TASK_EXE. go-tools moves to spin-stack/go-tools#50
for its two new gates, which task lint runs: taskgate, with no
exemption, and sfw, which finds no JavaScript here and holds the first
package.json to pnpm through Socket Firewall.

attestgate is told which tasks publish (qemu:publish, report:publish)
and which attests (release:sign), since the YAML now names them only.
lab, report and release run Task with interleaved output: a prefixed
line hides the ::error:: commands their tasks print.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf added a commit to spin-stack/spin-machine that referenced this pull request Oct 24, 2026
spin-stack/go-tools#50 and #51 are on main: the pin moves from the PR's commit to main's, which
also finds the Task go.mod pins for refs and holds pnpm run to installing nothing on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant