Skip to content

PDP-1182 SECCMP-1797: Switch to pull_request trigger and add top-level permissions#149

Open
GAdityaVarma wants to merge 1 commit intomainfrom
fix/SECCMP-1797-switch-to-pull-request
Open

PDP-1182 SECCMP-1797: Switch to pull_request trigger and add top-level permissions#149
GAdityaVarma wants to merge 1 commit intomainfrom
fix/SECCMP-1797-switch-to-pull-request

Conversation

@GAdityaVarma
Copy link
Copy Markdown

SECCMP-1797: Switch from pull_request_target to pull_request

This workflow only validates JIRA IDs in the PR title. It does not need write permissions or secrets access.

Switching to pull_request eliminates the PwnRequest attack surface entirely - no write token, no secrets exposure, regardless of what input is provided.

Also adds explicit permissions: contents: read at the workflow level.

Ref: Preventing pwn requests

This workflow only validates JIRA IDs in the PR title. It does not
need write permissions or secrets access. Switching to pull_request
eliminates the PwnRequest attack surface entirely for this repo.

Also adds explicit top-level permissions: contents: read.
Copilot AI review requested due to automatic review settings April 8, 2026 13:59
Copy link
Copy Markdown
Contributor

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

This PR hardens the JIRA ID validator GitHub Actions workflow by switching its trigger from pull_request_target to pull_request and explicitly restricting default token permissions to read-only, reducing exposure to “PwnRequest”-style attacks.

Changes:

  • Switch workflow trigger from pull_request_target to pull_request.
  • Add top-level workflow permissions (contents: read) to enforce least privilege.

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

jira-pr-check:
name: 🏷️ Validate JIRA ticket ID
# Use the reusable workflow from the central repository
uses: marklogic/pr-workflows/.github/workflows/jira-id-check.yml@main
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The reusable workflow is referenced via a mutable ref (@main). For supply-chain safety and reproducibility, pin this to an immutable ref (tag/release) or a commit SHA, especially since this workflow runs on untrusted PR inputs.

Suggested change
uses: marklogic/pr-workflows/.github/workflows/jira-id-check.yml@main
uses: marklogic/pr-workflows/.github/workflows/jira-id-check.yml@0123456789abcdef0123456789abcdef01234567

Copilot uses AI. Check for mistakes.
@@ -1,16 +1,15 @@
name: 🏷️ JIRA ID Validator

on:
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

Switching from pull_request_target to pull_request changes how forked PRs are handled: for first-time/externally contributed forks, GitHub may require a maintainer to approve the workflow run before it executes. Please confirm this tradeoff is acceptable for the JIRA title check (or document the expected maintainer action).

Suggested change
on:
on:
# Intentionally use `pull_request` for this title-only validation workflow.
# For first-time or external contributors opening PRs from forks, GitHub may
# require a maintainer to approve the workflow run before this check executes.
# Maintainers should approve the run when needed so the JIRA title check can complete.

Copilot uses AI. Check for mistakes.
@GAdityaVarma GAdityaVarma changed the title SECCMP-1797: Switch to pull_request trigger and add top-level permissions PDP-1182 SECCMP-1797: Switch to pull_request trigger and add top-level permissions Apr 8, 2026
@SameeraPriyathamTadikonda
Copy link
Copy Markdown
Contributor

@GAdityaVarma We can remove this workflow from the repository from both main and develop branches.

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.

3 participants