-
Notifications
You must be signed in to change notification settings - Fork 9
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
WIP/BLD: daff perms #55
Conversation
--- a/Spreadsheet/KFE/QRIX-alarms.csv
|
1a16a50
to
29efb5a
Compare
sigh, secrets are not passed when pull requests are made from forked repositories. I wanted to use github-scripts for the sake of using an action that's supported by github explicitly, but it should be functionally identical to the tholliander workflow |
There's a description on https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/ that uses a pull-request triggered workflow with another job triggered on the workflow_run of the pull-request workflow, and only the second one uses a secret. It would be something like daff.yml
And subsequently makecomment.yaml (almost completely copy pasted from the link)
|
Interesting, I guess I should have tried that first. 😆 |
This is again something that will require a merge to test |
In some more concise terms, we're splitting this up into two workflows in order to give each part of the process the most restrictive set of permissions:
By splitting this up we then require passing the diff information through artifacts, but it allows us to more strictly limit permissions.
Mostly putting this into words for my own education, but maybe also for the education of others. |
.github/workflows/makecomment.yml
Outdated
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: issue_number, | ||
body: 'Everything is OK. Thank you for the PR!' |
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.
I'm confused, where is the part where we write out the diff to a comment?
I'm on board with learning and applying best-practices for security.
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.
I need to stop working on this in the morning. 💀 (he says as he logs off for the day to fix this tomorrow morning)
Thanks for the careful eye, I've clearly not been careful enough qa'ing this on my own. Reading over this again I think might want some escape hatch for when there is no diff generated, in the case where commits are added that don't affect the csvs. Maybe that doesn't matter 🤷 I think I addressed all the comments 🤞 |
Does this pcds-nalms/.github/workflows/daff.yml Line 6 in 1ccadc3
not cover that? Am I wrong in assuming that only csvs would be under that path? |
Ah no you're right, that should hopefully be sufficient |
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.
This looks good to me. Maybe it's time to merge and check the result in a follow-up.
Merging, thanks for all the QA and sorry for the sloppiness throughout (I'll do better). Turns out the required checks needed exactly the name of the job as defined in the yaml, not the name as displayed in the check itself. ("generate-xml", not "Process on PR / generate-xml"). This conflicts with my past experience with pcds-ci-helpers, but I won't lose any sleep |
pull_request
to lock down write permission tokensMaybe:
scope out a token with comment permissions and use that for the script specifically