-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
Description
Objective
Replace overly broad permissions: read-all with specific minimal permissions in ci-doctor.md.
Context
The ci-doctor workflow grants broader permissions than necessary, violating the principle of least privilege. This increases the attack surface if the workflow is compromised.
Identified at 2 locations (lines 57, 570) in the static analysis report (discussion #3945).
Approach
- Identify exact permissions needed by reviewing the workflow's GitHub API calls
- Replace
permissions: read-allat workflow level with specific permissions - Review and minimize job-level permissions for the
agentjob - Test to ensure workflow functionality is preserved
Files to Modify
.github/workflows/ci-doctor.md:- Line 57: Workflow-level permissions
- Line 570: Job-level permissions for
agentjob
Recommended Permissions
permissions:
actions: read # To query workflow runs
contents: read # To read repository files
issues: write # To create issues for failures
pull-requests: read # If needed for PR analysisAcceptance Criteria
-
permissions: read-allremoved from line 57 - Specific minimal permissions added at workflow level
- Job-level excessive permissions reviewed and minimized (line 570)
- Workflow compiles successfully with
gh aw compile ci-doctor - All existing CI Doctor functionality works correctly
- No permission errors when workflow runs
- Permissions follow principle of least privilege
Security Impact
Reduces attack surface by limiting permissions to only what's necessary. Prevents potential abuse if workflow is compromised.
Estimated Effort
1 hour
AI generated by Plan Command for discussion #3945
Copilot