Repository navigation
ci: credential-free release build, SHA-pinned actions, docs site headers - #86
Merged
Merged
Conversation
…ted environment The single release job held id-token: write while running yarn install, so every dependency's lifecycle scripts executed next to the npm OIDC token, and it carried contents: write that nothing uses any more (tags and GitHub Releases come from scripts/releases.sh). Split into two jobs. build installs, builds and uploads dist/ with a read-only token and no id-token; a dry run also prints every tarball's contents. publish runs only for a real release, in the protected npm environment, installs with --mode=skip-build so no dependency script runs, and publishes the uploaded dist/. Checkouts no longer persist credentials.
Every action was referenced by a movable tag, so a compromised or re-pointed tag would run new code in CI and in the release job. Pin each to the commit its current tag resolves to, with the tag in a comment for readability, and stop persisting the checkout token in the CI and CodeQL jobs, which never push.
The site relied on Cloudflare's HSTS and nosniff only. Add a CSP limited to directives that cannot break Next's inline hydration scripts or the analytics beacon (frame-ancestors, base-uri, object-src, form-action), X-Frame-Options for older browsers, Referrer-Policy and a Permissions-Policy that denies device APIs the docs never use.
speech-rule-engine (mathjax, pulled in by nextra) pins @xmldom/xmldom 0.9.10 exactly, which carries several high-severity advisories fixed in 0.9.12. Force the patched version through resolutions; the docs build is unchanged. Not changed: katex <0.18.2 (low) — nextra, mermaid and micromark-extension-math all require ^0.16 and the site only renders math it authors itself; mathjax-full 3.2.2 (moderate) has no fixed release.
AGENTS.md called its list the only sanctioned runtime edges but left out the ones oauth2, oidc and the auth umbrella declare, so the rule contradicted the package.json files it describes.
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.
Summary
Release workflow. The release job held
id-token: writewhile it ranyarn install, so every dependency's lifecycle scripts executed next to the npm OIDC token. It also carriedcontents: write, which nothing uses: tags and GitHub Releases come fromscripts/releases.sh. The workflow is now two jobs:dist/as an artifact.id-token.npmenvironment. Configure that environment with required reviewers so each publish needs approval.--mode=skip-build, so no dependency script runs, then publishes the uploadeddist/with provenance as before.Action pinning. Every action in CI, CodeQL and Release is pinned to a commit SHA, with the tag in a comment. Dependabot's
github-actionsupdater keeps the pins current. Checkouts no longer persist the token.Docs site headers. HSTS and
nosniffalready come from Cloudflare. This adds:frame-ancestors,base-uri,object-srcandform-action;X-Frame-Options,Referrer-PolicyandPermissions-Policy.Docs dependencies.
@xmldom/xmldomis pinned to 0.9.12 throughresolutions.speech-rule-enginepinned 0.9.10 exactly, which has several high-severity advisories.AGENTS.md. The "only sanctioned cross-package edges" list now includes the edges that oauth2, oidc and the auth umbrella actually declare.
Considered and not changed
/ogquery text: already capped (title 80 characters, description 150).^0.16, and the site only renders math we write ourselves.Test plan
yarn workspaces foreach --all --no-private --verbose pack --dry-runlistsdist/, LICENSE, README and CHANGELOG for every package.yarn buildpasses;next startserves the four headers on/,/jwtand/og; the beacon script is still on the page.yarn npm audit --all --recursive: only katex (low) and mathjax-full (moderate) remain.gh workflow run release.yml --ref ci/repo-supply-chain-hardening -f dry_run=true).