Skip to content

fix: security hardening - #486

Merged
armando-rodriguez-cko merged 1 commit into
masterfrom
fix/INT-1788-security-hardening
Dec 2, 2026
Merged

armando-rodriguez-cko merged 1 commit into
masterfrom
fix/INT-1788-security-hardening

Conversation

@armando-rodriguez-cko

@armando-rodriguez-cko armando-rodriguez-cko commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Security hardening of the CI workflows: release workflow split into test, build, publish and GitHub release jobs, actions pinned by commit SHA on current versions, least-privilege permissions, integration test secrets only where the tests run.

Changes

  • .github/workflows/build-release.yml: four jobs. test runs the unit and integration tests. build (after test) builds and packs the package and uploads the tarball with its sha256. publish downloads that tarball, checks it and publishes it with provenance. github-release creates the GitHub release with the gh CLI, replacing the archived actions/create-release. One release runs at a time.
  • .github/workflows/build-master.yml, build-pull-request.yml: actions/checkout v7.0.1 and actions/setup-node v7.1.0, pinned by commit SHA, persist-credentials: false, package-manager-cache: false; install, test and build as separate steps, with the integration test secrets on the test step only.
  • .github/workflows/codeql-analysis.yml: removed. GitHub disabled it for inactivity; CodeQL runs through the repository's default setup.
  • .github/dependabot.yml (new): weekly updates for the GitHub Actions in the workflows.

Design notes:

  • Every action moves to its current major, pinned by the commit its tag points to, with the version in a comment: checkout v7.0.1, setup-node v7.1.0, upload-artifact v7.0.2, download-artifact v8.0.2. All run on Node 24; checkout and setup-node v3/v4 run on Node runtimes GitHub has deprecated. download-artifact v8 fails on a digest mismatch by default, and downloading by name keeps the same path. Dependabot keeps the pins current.
  • package-manager-cache: false keeps setup-node v5 and later from turning caching on by itself if the package ever declares a package manager; no workflow used a cache before.
  • The release installs with npm ci --ignore-scripts, as the master and pull request builds already do; the package has no install or publish lifecycle scripts (only posttest and postbuild, which still run), so the build is unchanged.
  • The tests run in their own job, which is the only one with the integration test secrets; the build job runs after it.
  • The tarball is built with npm pack in the build job (npm 10, bundled with Node 22) instead of inside npm publish. Built from the repository files it has the same 265 files as the published 5.10.0, byte-identical apart from the workflow files.
  • The version is read right after the checkout and must be x.y.z, the only form this workflow can publish with the latest tag; it names the tarball and the tag and is passed between jobs as a job output instead of $GITHUB_ENV.
  • The publish job checks the tarball before publishing: file, digest, archive entries and manifest, then name, version, registry and tag as npm reads them in a dry run. Each check fails with its own message.
  • The npm CLI the publish job needs (trusted publishing requires npm 11.5.1 or later) is the same pinned version as before, now downloaded and checked against the registry's sha512 integrity of that version before it is installed, so the job always runs the same npm.
  • The tarball artifact is kept for 7 days, so a failed publish or release job can be re-run on its own within that time.
  • The GitHub release keeps the same tag and title (the version), target commit and notes (the head commit message), passed through an environment variable.

API Reference

None.

Breaking changes

None. CI only; the published package and the SDK API are unchanged.

Tests

  • Existing tests pass

  • Serialization tests cover every new or changed property (no request or response type changed)

  • README updated if documented usage changed (documented usage unchanged)

  • actionlint clean on every workflow.

  • The build and publish steps were run in an ubuntu:26.04 container with Node 22: install, build, pack, the publish checks and npm publish --dry-run of the tarball.

Related

None.

@armando-rodriguez-cko
armando-rodriguez-cko requested a review from a team December 1, 2026 13:37
@agent-wall-e

agent-wall-e Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:.github/workflows/build-master.yml
  • security_sensitive_path:.github/workflows/build-pull-request.yml
  • security_sensitive_path:.github/workflows/build-release.yml
  • security_sensitive_path:.github/workflows/codeql-analysis.yml

Operational gates

  • ✅ jira_ticket (INT-1788)
  • ✅ independent_review

Files analysed: 4


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Dec 1, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
security_sensitive_path — .github/workflows/build-master.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — .github/workflows/build-pull-request.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — .github/workflows/build-release.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — .github/workflows/codeql-analysis.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e

agent-wall-e Bot commented Dec 1, 2026

Copy link
Copy Markdown

🟢 Advisory review: Looks good to me

This PR still needs a human approval — wall-e cannot auto-approve it. For what it's worth, I read the diff and found nothing I'd block on.

This PR hardens four CI workflows by pinning actions to commit SHAs, splitting the release job into build/publish/github-release stages, adding least-privilege permissions, and verifying the npm tarball before publishing. The diff matches the stated intent and the security controls are implemented correctly.

What I checked

  • All action SHAs are pinned with version comments (checkout v7.0.1 @ 3d3c42e, setup-node v7.1.0 @ 949feb2, upload-artifact v7.0.2 @ cf430e0, download-artifact v8.0.2 @ 9000827, codeql-action v4.39.5 @ 915412f) which is consistent and correct.
  • The npm 11.21.0 tarball is downloaded and its sha512 verified against a hardcoded integrity value before installation, eliminating the previous unpinned npm install -g npm@11.21.0 footgun.
  • The tarball verification in the publish job checks name, file count, sha256 (cross-job output), tar entry paths, and runs npm publish --dry-run before the real publish — this is a thorough pre-flight.
  • The id-token: write permission is scoped only to the publish job, and contents: write is scoped only to the github-release job (not visible in the truncated diff but described); the top-level default is contents: read.
  • The version regex ^[0-9]+\.[0-9]+\.[0-9]+$ is validated before any install/build steps, preventing a release run from proceeding on a non-release version.
  • persist-credentials: false is applied consistently across all four modified workflows.
  • The diff is truncated so the github-release job and the full verify script tail are not visible; a reviewer should confirm those sections match the description (gh CLI usage, tag/title/notes from env variable).
  • retention-days is set to 7 for the tarball artifact, which is intentional and reasonable for re-run scenarios as stated.

⚠️ The diff was too large to read in full, so this review covers only part of the change.


This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02

Security hardening of the CI workflows. The release is split so that the job
that publishes to npm only checks and publishes the tarball built and tested
by the earlier jobs. Actions are pinned by commit SHA on current versions and
kept up to date by Dependabot, and the integration test secrets reach only the
test steps.
@armando-rodriguez-cko
armando-rodriguez-cko force-pushed the fix/INT-1788-security-hardening branch from 94db233 to 343bd1b Compare December 1, 2026 16:49
@armando-rodriguez-cko armando-rodriguez-cko changed the title fix(ci): security hardening fix: security hardening Dec 1, 2026
@agent-wall-e

agent-wall-e Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:.github/workflows/build-master.yml
  • security_sensitive_path:.github/workflows/build-pull-request.yml
  • security_sensitive_path:.github/workflows/build-release.yml
  • security_sensitive_path:.github/workflows/codeql-analysis.yml

Operational gates

  • ✅ jira_ticket (INT-1788)
  • ✅ independent_review

Files analysed: 5


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Dec 1, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
security_sensitive_path — .github/workflows/build-master.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — .github/workflows/build-pull-request.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — .github/workflows/build-release.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — .github/workflows/codeql-analysis.yml classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@armando-rodriguez-cko
armando-rodriguez-cko merged commit 39ba4dd into master Dec 2, 2026
7 checks passed
@armando-rodriguez-cko
armando-rodriguez-cko deleted the fix/INT-1788-security-hardening branch December 2, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants