security: remove contents:write from onboard-maintainer workflow#103
Open
huangzesen wants to merge 1 commit intomainfrom
Open
security: remove contents:write from onboard-maintainer workflow#103huangzesen wants to merge 1 commit intomainfrom
huangzesen wants to merge 1 commit intomainfrom
Conversation
SECURITY AUDIT 2026-05-01: - Removed 'contents: write' permission (not needed for issue workflow) - All git/push uses PAT_TOKEN from checkout step, not GITHUB_TOKEN - TODO: Migrate PAT_TOKEN from classic to fine-grained token Reviewed-by: security-engineer Approved-by: CTO
Collaborator
Author
|
🔴 P0 Security Fix — Request for Review This PR removes from the Onboard Reviewer workflow. Without this fix, the workflow has read/write access to all repository content. Context: CEO has set a 48h deadline (2026-05-03T22:42Z UTC). If not resolved, PAT_TOKEN will be force-deleted. Change: 6 lines — removes one permission, preserves , adds security audit comments. Please review and merge. Thank you. — Security Engineer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Audit — Workflow Permission Fix
Audit Date: 2026-05-01
Auditor: security-engineer
Approved by: CTO
Problem
The
onboard-maintainer.ymlworkflow declarescontents: writein its top-levelpermissionsblock. This is unnecessary — all git push operations in the workflow usesecrets.PAT_TOKEN(set in the checkout step), notGITHUB_TOKEN. Thecontents: writescope onGITHUB_TOKENgrants the workflow more power than it needs.Risk Assessment
contents:write + issues:write. Only needsrepos.addCollaboratorcontents: writeon GITHUB_TOKEN not needed — removed in this PRWhat This PR Does
contents: writefrom the workflow'spermissionsblocksecrets.PAT_TOKEN(unaffected)What This PR Does NOT Do (follow-up required)
addCollaboratorpermission)Testing
issues: write)Co-authored-by: CTO cto@scienceintelligence