-
Notifications
You must be signed in to change notification settings - Fork 18
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
How to safely run on pull_request_target
?
#72
Comments
Here are links to a couple mentions of ways to more safely run this Action on the A workflow run on To further reduce the risk of exposing DNS provider privileged API keys, configure separate environments for validating and deploying changes. For example configure one environment with read-only DNS API keys, and a second with read-write DNS API keys. Then, for each workflow job, specify which environment it has access to. To further reduce the risk of unauthorized users pushing changes to the repository, specify which permissions GitHub.token gets for each job. What feedback do y'all have about ☝️ these approaches? What additional suggestions would you make? |
Gah! There's a blog post about this: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ |
Ok. I finally feel like I understand why the example configuration @xt0rted provided works. I think:
To minimize the risk of running a workflow on the
So, for example, when DNS changes will come through pull requests from forks, one could use these two workflows:
Of course, there are many other ways to go about it. My suggestion here ☝️ prioritizes a) not requiring a personal access token and b) grouping workflow jobs by trigger. |
The documentation added for #65 alludes to the problem running on
So I think, to solve this issue:
|
and link it in docs/add_pr_comment.md See also #72
and link it in docs/add_pr_comment.md See also #72
When contributors will use forks to propose DNS configuration changes, a GitHub Actions workflow triggered on the
pull_request
event cannot runoctodns-sync
because the workflow does not have access to secrets.Triggering the workflow on
pull_request_target
makes secrets available - and makes it possible to run untested code in your repository. This has come up, related to this Action, in #41, #67.How to safely run this Action on the
pull_request_target
event?The text was updated successfully, but these errors were encountered: