Skip to content

[AAASM-3878] 🔧 (ci): Harden aggregate.yml perms + verify downloads#48

Draft
Chisanan232 wants to merge 2 commits into
mainfrom
v0.0.1/AAASM-3878/aggregate_ci_hardening
Draft

[AAASM-3878] 🔧 (ci): Harden aggregate.yml perms + verify downloads#48
Chisanan232 wants to merge 2 commits into
mainfrom
v0.0.1/AAASM-3878/aggregate_ci_hardening

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

Description

Hardens .github/workflows/aggregate.yml (docs-hub aggregation) against two MEDIUM-severity supply-chain/permission issues flagged in AAASM-3878:

  1. Least-privilege token — the build job had no permissions: block, so it inherited the over-broad org-default GITHUB_TOKEN. Added a top-level permissions: contents: read (all the build job needs — it clones public repos and builds). The deploy job retains its own pages: write / id-token: write scope at the job level, overriding the default for that job alone.
  2. Verified binary downloads — the pinned mdBook 0.5.2 and mdbook-mermaid 0.17.0 release tarballs were curl'd and sudo mv'd into /usr/local/bin with no integrity check. Now each tarball is verified with sha256sum -c against a pinned checksum before extraction, with set -euo pipefail, so a tampered/MITM'd asset fails the step closed. Upstream ships no .sha256 sidecar assets, so the checksums were computed from the exact pinned tarballs and pinned with an explanatory comment.

Type of Change

  • 🔧 Configuration / CI change

Related Issues

  • Related Jira ticket: AAASM-3878

Closes AAASM-3878

Documentation Checklist

  • cd docs && mdbook build passes locally with no warnings
  • All internal cross-links verified
  • Page registered in docs/src/SUMMARY.md
  • Self-hosted instructions not included (SaaS-only scope)
  • "Last reviewed" footer updated with today's date
  • Commits follow GitEmoji convention and are small / atomic

CI-only change (no doc content touched). Validated with actionlint (clean) and a fail-closed check confirming sha256sum -c exits non-zero on a mismatched checksum.

🤖 Generated with Claude Code

https://claude.ai/code/session_019mSz31RysZF6DYToUoBWLf

Chisanan232 and others added 2 commits June 27, 2026 23:07
The build job inherited the org-default token (over-broad). Scope the
whole workflow to contents: read; the deploy job keeps its own
pages/id-token scope at the job level.

Refs AAASM-3878

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019mSz31RysZF6DYToUoBWLf
The pinned mdBook 0.5.2 and mdbook-mermaid 0.17.0 release tarballs were
curl'd and run unverified. Pin their SHA-256 and sha256sum -c before
extracting so a tampered/MITM'd asset fails the step closed.

Refs AAASM-3878

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019mSz31RysZF6DYToUoBWLf
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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