Skip to content
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

Add the workflow_no_pull_request_target rule with tests #195

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Oct 22, 2024

Adds a ruletype that checks that a workflow does not use the
pull_request_target trigger.

Depends on mindersec/minder#4793

For more information, see [GitHub's
documentation](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target).
guidance: |
Ensure that GitHub Actions workflows do not use the pull_request_target event.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eleftherias Would you mind checking if the descriptio, guidance and error reporting match what we expect rules to provide these days towards the UIs?

I admit I wasn't following your work on this lately. Don't feel like you need to review the code as well (unless you want to!)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That all looks good @jhrozek

@jhrozek jhrozek force-pushed the no_pull_request_target branch from 29941fc to ad0ad94 Compare October 23, 2024 11:25
@jhrozek
Copy link
Contributor Author

jhrozek commented Oct 23, 2024

@JAORMX Updated based on the changes in Minder. So far I tested with a local replace in Go mod and then end-to-end by installing to a local minder instance.

Adds a ruletype that checks that a workflow does not use the `pull_request_target` trigger.
@jhrozek jhrozek force-pushed the no_pull_request_target branch from 1bebdf9 to a9614bc Compare October 24, 2024 10:41
@jhrozek
Copy link
Contributor Author

jhrozek commented Oct 24, 2024

Resubmitted without the tests until we have the harness that runs them merged.
(btw I made sure this rule works in Stacklok cloud prod and therefore that the JQ/rego dependencies have been deployed)

@jhrozek jhrozek merged commit 06d3c80 into main Oct 24, 2024
2 checks passed
@jhrozek jhrozek deleted the no_pull_request_target branch October 24, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants