Repository navigation
security: weekly audit, release checked as the updater will, tighter tokens - #119
Merged
Merged
Conversation
…tokens
- The security audit (govulncheck, npm audit) moves to security.yml and
also runs every week without a commit. Dependabot does not raise the Go
toolchain, so a standard-library advisory published in a quiet week
waited for the next push to be seen.
- The release job runs the updater's own acceptance on the signed
manifest before publishing: `updatersign verify` calls
updater.AcceptManifest, which the updater now uses itself (signature
against the embedded key, version line, one entry per asset), then
hashes every file. A key rotated without verify.go, or a missing
update asset, stops the job instead of shipping a release installed
copies refuse. Checked on the published v1.11.1 assets and on tampered
copies of them.
- The tag reaches the release builds through GITHUB_REF_NAME instead of a
${{ github.ref_name }} expression pasted into the script.
- Pages: pages:write and id-token:write belong to the deploy job only, the
checkouts keep no credentials, and both jobs have a time limit.
- NSIS is pinned to 3.13.0, the version the last releases used.
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security follow-ups from a review of the workflows. Independent of #118: the two touch different lines of
release.ymlandci.yml.Weekly security audit
The security job (govulncheck,
npm audit) moves fromci.ymlto its ownsecurity.yml, which runs on pull requests and pushes as before, and every Monday without a commit. Dependabot raises Go modules and npm packages but not the Go toolchain ingo.mod; a standard-library advisory published during a quiet week waited for the next push to be noticed. A failed scheduled run sends GitHub's notification to whoever last changed the schedule. The steps are moved unchanged, with a time limit added.The release is judged as the updater will, before it is published
Today the signature is first checked against the key the app embeds by the release skill, after publication. A signing key rotated without
internal/updater/verify.gowould publish a release that every installed copy refuses.internal/updater:AcceptManifest(manifest, sig, tag, assets)is the updater's acceptance without the network: signature against the embedded key, version line bound to the tag, exactly one entry per asset. The updater's ownverifiedChecksumnow calls the same code (acceptManifest), so the release check cannot drift from what clients do.UpdateAssetslists the five assets the updater downloads; a test on each system checks it holds that system's names fromapply_*.go.tools/updatersign verify <dir> <tag>runs it on the release directory, requires every file there to be listed once and every update asset to be present, and hashes every file.release.ymlruns it right after signing, before the attestation and the upload.Checked on the published v1.11.1 assets (accepted: signature, version line, 8 assets), and on copies of them that are refused:
v1.11.0).dmgremoved.sigremovedSmaller
GITHUB_REF_NAME, not as an${{ github.ref_name }}expression pasted into the script: an expression is substituted into the shell's source, so a tag named to look like code would run as code. Only maintainers push tags; this keeps it data either way. The same file already used the variable elsewhere.pages: writeandid-token: writewere granted to the whole workflow, including the job that runstools/check-links.mjs; they now belong to the deploy job only. Both checkouts keep no credentials (the only ones in the repo that did), and both jobs have a time limit.Checked
go vet ./..., staticcheck,go test -race ./internal/updater(vet for linux and darwin too)updatersign verifyon v1.11.1 and the six tampered copies aboveSecurity auditnow comes from the Security workflowThe release path first runs at the next tag; actionlint covers it statically until then.