Skip to content

ci: isolate release credentials and pin the dependency graph#26

Merged
Theauxm merged 3 commits into
mainfrom
harden/github-actions-security
Jul 2, 2026
Merged

ci: isolate release credentials and pin the dependency graph#26
Theauxm merged 3 commits into
mainfrom
harden/github-actions-security

Conversation

@Theauxm

@Theauxm Theauxm commented Jul 2, 2026

Copy link
Copy Markdown
Member

Split the release workflow into build-test, release, and publish jobs along trust boundaries so untrusted build code never runs with a publish credential. Default workflow permissions to none, pin every action to a commit SHA, and add harden-runner egress auditing. Publishing moves to NuGet trusted publishing (OIDC, short-lived key) with SLSA build provenance instead of a stored API key.

Adopt Central Package Management: package versions move to Directory.Packages.props and each project commits a packages.lock.json, restored in CI with --locked-mode. A guard step fails the build on any lockfile carrying the local-dev 1.99.99 version. Turn on DotNet.ReproducibleBuilds.

Split the release workflow into build-test, release, and publish jobs along trust
boundaries so untrusted build code never runs with a publish credential. Default
workflow permissions to none, pin every action to a commit SHA, and add
harden-runner egress auditing. Publishing moves to NuGet trusted publishing (OIDC,
short-lived key) with SLSA build provenance instead of a stored API key.

Adopt Central Package Management: package versions move to Directory.Packages.props
and each project commits a packages.lock.json, restored in CI with --locked-mode.
A guard step fails the build on any lockfile carrying the local-dev 1.99.99
version. Turn on DotNet.ReproducibleBuilds.
@Theauxm
Theauxm force-pushed the harden/github-actions-security branch from 74dc47b to 26bac70 Compare July 2, 2026 16:31
Theauxm added 2 commits July 2, 2026 11:19
Central Package Management collapsed Microsoft.CodeAnalysis.CSharp to 4.14 but left
Workspaces at 4.12, so the analyzer built against 4.14 failed CS1705 against its
test project's 4.12 assemblies. Align Workspaces to 4.14. Also enable NuGetAudit
all-mode and treat NU1901-NU1904 as errors.
The RepoConvention guard self-test still built its "conforming" synthetic repo with an
inline Trax.Effect Version="1.*", which the CPM-updated guard now correctly flags, so
the self-test failed in CI. Rewrite the fixture to the CPM convention (versionless
Trax ref + a central PackageVersion pin) and rename the stale test method. Add
coverlet.collector to the analyzer test project so it stops emitting the missing-
datacollector warning and reports coverage.
@Theauxm
Theauxm merged commit 9a383f3 into main Jul 2, 2026
1 check passed
@Theauxm
Theauxm deleted the harden/github-actions-security branch July 2, 2026 17:38
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

This PR is included in version 1.6.1

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