Skip to content

fix: [FL-29536] add explicit permissions to jira-sync workflow#99

Merged
josue merged 1 commit into
mainfrom
fix/FL-29536/add-workflow-permissions
Apr 29, 2026
Merged

fix: [FL-29536] add explicit permissions to jira-sync workflow#99
josue merged 1 commit into
mainfrom
fix/FL-29536/add-workflow-permissions

Conversation

@josue
Copy link
Copy Markdown
Collaborator

@josue josue commented Apr 29, 2026

Description

Adds an explicit permissions block to the jira-sync.yml workflow, restricting the GITHUB_TOKEN to contents: read. This resolves CodeQL alert #4 (CWE-275: missing workflow permissions).

Motivation and Context

Without explicit permissions, the workflow inherits repository/org defaults which may be broader than necessary. The reusable workflow only reads PR event payload data and makes JIRA API calls using repository secrets — it needs no write access to the repo.

Jira ticket: FL-29536

How Has This Been Tested?

  • Verified the reusable workflow at flume/github-actions/.github/workflows/jira-sync.yml — it only reads context.payload.pull_request (from the event, not the API) and makes external JIRA REST calls using secrets
  • No GitHub API write operations are performed with the GITHUB_TOKEN

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • All new and existing tests passed.

🤖 Generated with Claude Code

Resolves CodeQL alert #4 (CWE-275) by restricting the GITHUB_TOKEN to
read-only access. The reusable workflow only reads PR event data and
calls the JIRA API via secrets — no repo write access is needed.

Jira ticket: FL-29536

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 29, 2026 15:36
@josue josue requested a review from caseyh as a code owner April 29, 2026 15:36
@flume-bot
Copy link
Copy Markdown

flume-bot commented Apr 29, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an explicit permissions block to the jira-sync.yml GitHub Actions workflow to restrict the default GITHUB_TOKEN scope, addressing the linked CodeQL alert about missing workflow permissions.

Changes:

  • Add top-level permissions: configuration.
  • Restrict GITHUB_TOKEN permissions to contents: read for the JIRA sync workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator Author

@josue josue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial Review — PR #99: Add explicit workflow permissions

Reviewer: Claude Opus (Gemini 2.5 Pro unavailable — 429 rate limit)

Primary fix is correct. The permissions: contents: read block is the minimal required scope — the reusable workflow only reads PR event payload data via context.payload (no GitHub API calls) and makes external JIRA REST calls using repository secrets. No injection risks found.

New Findings: 2 (pre-existing, in diff context)

Severity Finding File
MEDIUM Mutable @main ref for reusable workflow — supply chain risk jira-sync.yml:17
LOW secrets: inherit passes all repo secrets, not just the 2 needed jira-sync.yml:18

Note: Both findings are pre-existing (not introduced by this PR) but are visible in the diff context and worth addressing in a follow-up for SOC 2 / HITRUST supply chain integrity.

Source: Claude Opus adversarial review

Comment thread .github/workflows/jira-sync.yml
@josue josue merged commit c81da8a into main Apr 29, 2026
12 checks passed
@josue josue deleted the fix/FL-29536/add-workflow-permissions branch April 29, 2026 16:45
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.

4 participants