-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Ensure that the project’s automated workflows tokens are set to read-only by default #37643
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
Conversation
3f80058 to
b9d9509
Compare
|
@keycloak/cloud-native whenever you have the time could you please review the quarkus next workflow? |
|
@abstractj - this should be fine for the Aurora DB flow. Please proceed. FYI: This steps will run only on the release branches and in main due to the secrets that they use. |
b9d9509 to
c272011
Compare
.github/workflows/label.yml
Outdated
| contents: read | ||
| issues: write | ||
|
|
||
| pull-requests: write # Required to add labels to pull-requests |
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.
It's not adding labels to pull-requests, but rather issues. So guess should be issues: write.
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.
@stianst maybe I completely misunderstood it but the following line: https://github.com/keycloak/keycloak/blob/main/.github/workflows/label.yml#L2-L4 and https://github.com/keycloak-poc/keycloak/blob/main/.github/workflows/label.yml#L19, pretty much states that workflow runs when a pull request (PR) is closed (either merged or explicitly closed without merging). That's the reason why pull-requests: write was added instead of issues.
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.
It doesn't need permissions to run on the event, it needs permissions for what actions it takes, which is update issues and create labels
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.
+1 this seems like it could use more granular permissions
stianst
left a comment
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.
Should we not instead change the default workflow permissions for the repository to Read repository contents and packages permissions and only set additional permissions that is required?
Seems permissions: contents: read addition to all workflows is not needed really.
|
I would get rid of the We also need to update active release branches for this to work. |
@stianst I totally get what you mention, but this is based on the recommendations from https://github.com/ossf/scorecard/blob/e3441f48c371470aa9d46aaaed343a74be31f54b/docs/checks.md#token-permissions. I do not disagree on what you say. In summary: The argument is: "The check cannot detect if the "read-only" GitHub permission setting is enabled, as there is no API available." The consequence of not doing it, is the fact that both scorecard and clomonitor.io will report inaccurate report on Token permissions. As soon as we agree on the changes here, I can submit a pull-request to other branches. |
de70de9 to
b6ded04
Compare
|
@stianst I had the chance to speak with people on scorecard, and the another solution is to put at the top |
6a00433 to
190026f
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.AppInitiatedActionWebAuthnTest#proceedSetupWebAuthnLogoutOtherSessionsCheckedKeycloak CI - WebAuthn IT (chrome) |
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.
Unreported flaky test detected, please review
|
Okay, let's go with the default permissions on the top of workflows, we can always in addition enable this enforcement on the repo/org level as a separate thing. |
jonkoops
left a comment
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.
Overall LGMT, I agree with @stianst that some permissions should be different https://github.com/keycloak/keycloak/pull/37643/files#r1971552448
|
@jonkoops @stianst first, thank you so much for your time reviewing it. It took me 30 min to mimic the environment, based on what you mentioned.
I think this is the last piece of the puzzle. |
rmartinc
left a comment
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.
Thanks @abstractj! LGTM!
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.AppInitiatedActionWebAuthnTest#proceedSetupWebAuthnLogoutOtherSessionsCheckedKeycloak CI - WebAuthn IT (chrome) org.keycloak.testsuite.webauthn.passwordless.AppInitiatedActionPwdLessTest#proceedSetupWebAuthnLogoutOtherSessionsCheckedKeycloak CI - WebAuthn IT (chrome) org.keycloak.testsuite.webauthn.passwordless.AppInitiatedActionPwdLessTest#proceedSetupWebAuthnLogoutOtherSessionsNotCheckedKeycloak CI - WebAuthn IT (chrome) |
a7602cb to
1c7d9be
Compare
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.passwordless.AppInitiatedActionPwdLessTest#cancelSetupWebAuthnKeycloak CI - WebAuthn IT (chrome) |
07d1e1a to
519f288
Compare
…only by default Signed-off-by: Bruno Oliveira da Silva <[email protected]> Closes keycloak#33544
…only by default (keycloak#37643) Signed-off-by: Bruno Oliveira da Silva <[email protected]> Closes keycloak#33544
…only by default (keycloak#37643) Signed-off-by: Bruno Oliveira da Silva <[email protected]> Closes keycloak#33544
…only by default (keycloak#37643) Signed-off-by: Bruno Oliveira da Silva <[email protected]> Closes keycloak#33544
…only by default (keycloak#37643) Signed-off-by: Bruno Oliveira da Silva <[email protected]> Closes keycloak#33544
…only by default (keycloak#37643) Signed-off-by: Bruno Oliveira da Silva <[email protected]> Closes keycloak#33544
Signed-off-by: Bruno Oliveira da Silva [email protected]
Closes #33544
Note: PR must be merged only after the approval of the assignee, considering the impact of those changes.
Workflows tested in a controlled environment and reporting green
Scorecard update based on proposed changes