Skip to content

Verify permissions on workflows with risky event triggers (already compliant)#12847

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-workflow-permissions
Closed

Verify permissions on workflows with risky event triggers (already compliant)#12847
Copilot wants to merge 1 commit intomainfrom
copilot/fix-workflow-permissions

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Issue #12756 flagged 14 workflows triggered by risky events (issue_comment, pull_request_target) for using "default permissions". Investigation reveals all workflows already have explicit minimal permissions configured.

Current Implementation

Workflow level: permissions: {} (explicit zero permissions)
Job level: Each job declares minimal required permissions

Example from ai-moderator.lock.yml:

permissions: {}  # Workflow-level: explicit empty

jobs:
  agent:
    permissions:  # Job-level: minimal explicit
      contents: read
      issues: read
      pull-requests: read

Analysis

permissions: {} is explicit and more restrictive than setting specific workflow-level permissions. It ensures:

  • No job inherits permissions by default
  • Each job must explicitly request what it needs
  • Principle of least privilege enforced at both levels

All 14 workflows (ai-moderator, archie, brave, cloclo, grumpy-reviewer, mergefest, pdf-summary, plan, pr-nitpick-reviewer, q, scout, security-review, tidy, unbloat-docs) follow this pattern.

Recommendation

No code changes needed. If Poutine still flags these, it's a false positive - the scanner may not distinguish between "missing permissions" (uses defaults) and "explicit empty permissions" (most restrictive).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • boostsecurityio.github.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Code Quality] Fix default permissions on workflows with risky event triggers</issue_title>
<issue_description>### Description

14 workflows are triggered by risky events (issue_comment, pull_request_target) but use default permissions (read-write access to most resources). This violates the principle of least privilege and exposes the repository to potential privilege escalation attacks.

Identified by

Poutine supply chain security scanner in Static Analysis Report githubnext/gh-aw#12756

Affected Workflows

The following workflows need explicit minimal permissions added to their frontmatter:

  • .github/workflows/ai-moderator.md
  • .github/workflows/archie.md
  • .github/workflows/brave.md
  • .github/workflows/cloclo.md
  • .github/workflows/grumpy-reviewer.md
  • .github/workflows/mergefest.md
  • .github/workflows/pdf-summary.md
  • .github/workflows/plan.md
  • .github/workflows/pr-nitpick-reviewer.md
  • .github/workflows/q.md
  • .github/workflows/scout.md
  • .github/workflows/security-review.md
  • .github/workflows/tidy.md
  • .github/workflows/unbloat-docs.md

Required Changes

For each workflow above, add explicit minimal permissions to the frontmatter YAML:

Before:

---
name: Example Workflow
on:
  issue_comment:
    types: [created]
---

After:

---
name: Example Workflow
on:
  issue_comment:
    types: [created]
permissions:
  contents: read
  issues: write
  pull-requests: write
---

Common Permission Patterns

  • For workflows that read data and create reports: contents: read, issues: write, pull-requests: read
  • For workflows that respond to comments: contents: read, issues: write, pull-requests: write
  • For workflows that modify code: contents: write, issues: write, pull-requests: write

Success Criteria

  • All 14 workflows have explicit permissions: section in frontmatter
  • Permissions follow principle of least privilege
  • Poutine warning default_permissions_on_risky_events is resolved
  • All workflows compile without errors after changes

Priority

High - Security vulnerability that should be addressed promptly

References

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 13, 2026, 5:15 PM UTC

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix default permissions on workflows with risky event triggers Verify permissions on workflows with risky event triggers (already compliant) Jan 31, 2026
Copilot AI requested a review from pelikhan January 31, 2026 01:39
@pelikhan pelikhan closed this Jan 31, 2026
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.

[Code Quality] Fix default permissions on workflows with risky event triggers

2 participants