docs(adr): propose ADR 0044 gate workflows:write on repo secret allowlist#1739
docs(adr): propose ADR 0044 gate workflows:write on repo secret allowlist#1739ifireball wants to merge 1 commit into
Conversation
Site previewPreview: https://65ad1ce2-site.fullsend-ai.workers.dev Commit: |
Records minimal-privilege design for fullsend-ai#470/fullsend-ai#788: triage intent labels, target-repo secret assessment in code only, PR labels for fix elevation. Update architecture.md. Implementation blocked until ADR 41 lands. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
fad4933 to
834cb24
Compare
ReviewFindingsMedium
Low
|
ralphbean
left a comment
There was a problem hiding this comment.
I think this needs one change before we can merge. See inline.
| 4. **Default `GITHUB_TOKEN` permissions for workflows** — `GET /repos/{owner}/{repo}/actions/permissions/workflow`. Assessment fails unless defaults are read-only for contents and packages (and do not grant write-all). This blocks elevation when a rogue workflow could exfiltrate via the token even with no named secrets. | ||
|
|
||
| **Allowlist:** Every secret name from (1)–(3) must be in builtins ∪ configurable allowlist. (4) is a separate boolean gate, not a name list. | ||
|
|
There was a problem hiding this comment.
[critical] I think we should be explicit here that check (4) is defense-in-depth, not a reliable gate. GitHub Actions lets individual workflow YAML files set their own permissions: block, escalating beyond the repo default. A rogue workflow pushed via workflows: write can include permissions: contents: write regardless of the repo-level default — the default only controls what workflows get when they omit the permissions: key entirely.
So this check catches repos where the defaults are already wide open (a signal that the org isn't thinking about least privilege), but it can't actually prevent a rogue workflow from obtaining a write-scoped GITHUB_TOKEN. The assessment as written treats it as a hard gate alongside (1)–(3), which I think overstates what it provides.
There was a problem hiding this comment.
hmm, you are right, I was focused on secret exfiltration, but writing into main is also possible via a rogue workflow.
So perhaps I should refocus on trying to ensure the pushed bot commit does not create or modify any workflows that would trigger as a result of the merge itself, or perhaps add that in addition to the mechanism I have already described.
WDYT?
| ### Labels (two roles) | ||
|
|
||
| | Label | On | Meaning | Who may set (provenance) | | ||
| |-------|-----|---------|---------------------------| |
There was a problem hiding this comment.
[moderate, non-blocking] The authorization floor for the PR label override is OWNER | MEMBER | COLLABORATOR — same as /fs-fix. In large orgs, COLLABORATOR can be pretty broad (external contributors with push access). Since this override bypasses assessment entirely, do we want a tighter floor here (OWNER | MEMBER only)? Or does matching the /fs-fix authorization rule feel right for consistency?
|
This only prevent our agents from submitting a PR that wants to extract secrets, but what people is doing without agents? They shoyld have some prevention mechanism so GH does not run workflows without permission, right? Can't we just use that and do not implement this? |
This is not about running workflows, its about writing workflow files. Unauthorized humans typically create branches in their forks and PRs out of those - so as long as the PR isn't merged, a contributor cannot get his workflow to run in the context of the target repo. Bots, however, create PRs by pushing branches directly into the target repo, such a branch can contain a new workflow that would trigger on push. To mitigate that, GitHub blocks commits pushed with workflow file modifications unless the pusher has a token with a "workflow: write" permission. This whole PR and set of issues is about finding a way to grant "workflow: write" to the code agent so that it can edit workflows without causing it to become an attack platform into the repo. |
|
Ok, so the current protection is forcing contributors to open a fork. |
Yes, if you don't trust them. don't let them push (write) into the repo... |
Summary
Proposes ADR 0044 (Proposed): a minimal-privilege path to grant the coder/fix GitHub App
workflows: writeonly when target-repo workflow exposure is acceptable — without implementing the full repo-readiness checklist from #788.Background / why this ADR exists
.github/workflows/changes today; GitHub requiresworkflowspermission (see failed push in that issue).workflows: writewithout repo hardening enables prompt-injection via newon: pushworkflows on agent branches; issue argues for a gate before elevation. PR #787 was closed pending this work.reusable-code.yml/reusable-fix.ymlneeds stable dispatch.Design discussion refined the #788 “full assessment” into a narrower, deterministic gate:
contents: writealone does not allow authoring workflow files;workflows: writeis the distinct escalation.source_repo: repository secrets, org secrets visible to the repo, environment secrets (with fail-closed deployment-branch rules), plus defaultGITHUB_TOKENworkflow permissions.fullsend-needs-workflow-writeon the issue; builtins (FULLSEND_GCP_*,FULLSEND_DISPATCH_TOKEN) are hard-allowlisted; admins may extend via explicitworkflow_secret_allowlistinconfig.yaml(noFULLSEND_*prefix wildcard).fullsend-workflow-writefrom coder (post-assess) or an authorized human (OWNER | MEMBER | COLLABORATOR).Test plan
pre-commitADR linters pass on the new fileMade with Cursor