Repository navigation
Conversation
🤖 GitHub commentsJust comment with:
|
There was a problem hiding this comment.
🟢 Approval recommended
The issue-labeling workflow changes have no active review issues.
No open issues 🎉
What changed in this PR
Hardens the issue-labeling workflow as part of the pull_request_target audit while preserving its existing triggers and labeling behavior.
Changes:
- Pins
AlexanderWert/issue-labelerto a full commit SHA with av2.3comment. - Moves token permissions to the
triagejob and disables workflow-level permissions. - Documents why
pull_request_targetis retained and how the workflow avoids running PR code.
| File | Description |
|---|---|
.github/workflows/labeler.yml |
Pins the action, scopes permissions to the job, and documents the trigger’s security rationale. |
Review effort: Balanced
This branch has not been deployed
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.
harden labeler workflow
What
.github/workflows/labeler.yml, trigger unchanged.permissions: {}at workflow level).pull_request_targetis kept and that no PR code is checked out.AlexanderWert/issue-labelerv2.3 pinned to32be4a3c(latest release).Why
pull_request_targetis needed to label fork PRs (thepull_requesttoken is read-only for forks). The workflow checks out nothing and runs no PR code.AlexanderWert/issue-labelerloads its config through the contents API atgithub.context.sha, which forpull_request_targetis the base branch commit, so a PR cannot change the labeling rules. Hardening is limited to supply chain (mutable tags), token scope and script injection. Part of thepull_request_targetaudit: https://github.com/elastic/observability-robots/issues/5292Behaviour change
None.
Verification
Done:
dangerous-triggerson the keptpull_request_targettrigger (expected, covered by the org Actions policy allowlist); notemplate-injection,unpinned-usesorexcessive-permissionsfindings.gh api repos/<o>/<r>/git/ref/tags/<tag>(annotated tags dereferenced); each is the latest published non-draft release.AlexanderWert/issue-labelerhas no release newer than v2.3 (2020, node12 action).src/main.ts): config is fetched withrepos.getContentsatref: github.context.sha.Not done:
🤖 Generated with Claude Code