Skip to content

security: harden CI workflows and document trust boundaries - #44

Merged
rahulcrl merged 1 commit into
mainfrom
harden_ci_and_security_docs
Jul 17, 2026
Merged

rahulcrl merged 1 commit into
mainfrom
harden_ci_and_security_docs

Conversation

@rahulcrl

@rahulcrl rahulcrl commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pre-public-release security hardening across the workflows, tool annotations, and README.

  • SHA-pin all actions in ci.yaml and release.yaml, with trailing version comments. release.yaml is the priority target since it holds contents: write and id-token: write. Dependabot (already watching github-actions) keeps the pins fresh.
  • Gate the AI review workflow to same-repo branches. pull_request_target runs with base-repo secrets, so on a public repo any fork PR could fire it; fork PRs can still be reviewed via workflow_dispatch. The roachdev reusable workflow is pinned to a commit SHA. Verified it never checks out untrusted PR head code (diff is fetched as data only). secrets: inherit must stay until roachdev declares the token it uses in workflow_call. Note: review.yml is managed by roachdev codereview, so a regen could overwrite the gate.
  • Annotate the read tools ReadOnlyHint: true (the MCP default is false) so clients can reserve human-in-the-loop confirmation for the mutating tools. insert_rows and the create tools stay unannotated on purpose: the spec defaults destructive to true, and INSERT ... ON CONFLICT can mutate. Bumps Go to 1.26 to spell the destructive hints as new(true).
  • README Security section: the connecting SQL role, not the server, is the security boundary; points at the CockroachDB role/grant docs for scoping and documents the prompt-injection exposure.

Testing

go build, go vet, and go test ./... all clean; TestRegisterToolsGating extended with subtests asserting read tools hint read-only, write tools never do, and the row mutation tools hint destructive.

@rahulcrl
rahulcrl force-pushed the harden_ci_and_security_docs branch from cfb9e52 to aa7b249 Compare July 16, 2026 11:59
@rahulcrl
rahulcrl marked this pull request as ready for review July 16, 2026 12:00
SHA-pin all GitHub Actions in the CI and release workflows so a moved or
compromised tag cannot inject code into CI or published artifacts. Gate the
AI PR review job to same-repo branches since pull_request_target runs with
base-repo secrets on fork PRs, and pin its reusable workflow to a commit.

Annotate the read tools with the MCP read-only hint so clients can gate
human-in-the-loop confirmation on the mutating tools only. Document in the
README that the connecting SQL role is the security boundary, with a
least-privilege role recipe, and describe the prompt-injection exposure
inherent to tool-using agents.

Bump the Go directive to 1.26 to spell the destructive hints as
new(true) instead of a pointer-to-local.
@rahulcrl
rahulcrl force-pushed the harden_ci_and_security_docs branch from aa7b249 to 84f481b Compare July 17, 2026 06:09
@rahulcrl

Copy link
Copy Markdown
Contributor Author

TFTR @emnet-crl!

@rahulcrl
rahulcrl merged commit 2b88829 into main Jul 17, 2026
5 checks passed
@rahulcrl
rahulcrl deleted the harden_ci_and_security_docs branch July 17, 2026 06:41
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.

2 participants

⌂ 换网址