Skip to content

ci(security): least-privilege token permissions (Scorecard)#412

Merged
pallakatos merged 6 commits into
mainfrom
chore/scorecard-token-permissions
Jun 23, 2026
Merged

ci(security): least-privilege token permissions (Scorecard)#412
pallakatos merged 6 commits into
mainfrom
chore/scorecard-token-permissions

Conversation

@pallakatos

Copy link
Copy Markdown
Collaborator

Sets top-level permissions: contents: read + per-job writes across the workflows Scorecard flagged for over-broad top-level write (codeql, blocklist-refresh, image-cache-publish, release, release-internal, release-public-interim). Verified by cutting v0.1.0-interim.11 from this branch — a full release run exercises every per-job permission (image push, cosign/attest, release creation). Part of #410.

…issions)

Set top-level `permissions: contents: read` and grant writes per-job only
where needed, across the workflows Scorecard flagged for top-level/over-broad
write:

- codeql.yml: security-events:write → analyze job only.
- blocklist-refresh.yml: contents/pull-requests:write → refresh job only.
- image-cache-publish.yml: drop unused actions:write; packages:write →
  publish-images job only.
- release.yml: contents:write → create-release job only.
- release-internal.yml + release-public-interim.yml: per-job matrix —
  packages:write on image push/merge jobs, id-token+attestations:write on
  attest/cosign jobs, contents:write on the release job; everything else
  contents:read.

ci.yml's job-level actions:write is kept (required + documented: docker
buildx GHA cache backend).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Pal Lakatos-Toth and others added 5 commits June 23, 2026 13:02
Formalizes the triaged, accepted advisories (4 unmaintained/no-patch Rust
crates + js-yaml DoS with no upstream fix) in osv-scanner.toml with per-item
rationale, mirroring deny.toml. Adds docs/security/supply-chain-posture.md
documenting how each OpenSSF Scorecard finding is addressed or deliberately
accepted (vendored wheels = intentional hermetic builds; base-image tags =
intentional for OS-patch freshness). Part of #410.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Three related changes toward a clean public release:

1. Stop the amd64-only `:latest` clobber. image-cache-publish.yml (CI build
   cache, host-arch/amd64-only) was pushing `:latest` on every main push,
   overwriting the multi-arch `:latest` the release workflow publishes — so
   `kars dev --release` (default :latest) got amd64-only controller/router
   and broke on arm64/kind. The cache workflow now pushes only sha-/branch
   tags; `:latest` is owned solely by the release workflow.

2. Rebrand the release workflow from "interim" to a general public release:
   trigger on clean `vX.Y.Z` tags too (not just `-interim`), conditional
   release name, drop the ESRP/"reserved for npmjs/MCR" language from the
   notes + manifest. The release body now leads with signing/SBOM/provenance
   and a one-line "crates.io/npmjs/MCR in progress" note.

3. README: replace the "Microsoft-signed packages coming soon / build from
   source" caveat with an accurate "every published artefact is cosign-signed
   + SBOM + SLSA-attested" statement (the no-compile path works today).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dry-run by default; APPLY=1 deletes CI build-cache tags (sha-<commit>, main),
per-arch build intermediates (*-amd64/*-arm64), and optionally old interim
release tags — keeping `latest`, clean vX.Y.Z release tags, and cosign
signatures. Needs a token with delete:packages (GitHub has no API for this
under the default workflow token). Part of the package audit (#410).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
`kars dev --target local-k8s` has no --once option (runLocalK8s brings the
cluster up and returns on its own), so the flag made the kind harness fail
immediately with "unknown option '--once'". Remove it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- install.sh is now a 40-line PUBLIC, no-auth installer: resolves the latest
  signed GitHub Release and `npm i -g`s it. So the install is one short line:
    curl -fsSL https://raw.githubusercontent.com/Azure/kars/main/install.sh | bash
  KARS_VERSION pins a release. (Replaces the old internal/auth-gated installer.)
- Release workflow: publish @kars/cli to npmjs with `npm publish --provenance`
  on clean (non-interim) release tags, gated on an NPM_TOKEN secret (no-ops
  until configured). Once live, install shortens to `npm i -g @kars/cli`.
- README "Try it in five minutes" rewritten: two-command quickstart + one
  collapsible "Other ways to install"; dropped the verbose build-from-source
  and now-obsolete internal-channel blocks.
- cleanup-ghcr-tags.sh: robust rewrite (gh --paginate --jq, preflight scope
  check) — fixes the jq/pagination crash.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pallakatos
pallakatos merged commit 26395ae into main Jun 23, 2026
32 checks passed
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