-
Notifications
You must be signed in to change notification settings - Fork 510
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
Align Dangerous Workflow check with CodeQL rules, or defer to it entirely #4490
Comments
Can you link or paste the usage that wasn't caught? |
This PR fixes several instances which weren't caught. |
Ah, I had initially misunderstood this as us not detecting a vulnerable input to
Instead you're talking about data flow analysis, which Scorecard doesn't do. So CodeQL is going to give better answers here. Currently we look for direct usages of user-controlled patterns. scorecard/checks/raw/dangerous_workflow.go Lines 31 to 50 in c738282
Looking at some of your fixes, it seems your fixes are (in general) switching from For example: foo=$(date)
echo ${{ env.foo }} |
Perhaps more of a discussion / consideration for the maintainers than a pure feature request, but:
Is your feature request related to a problem? Please describe.
We recently stumbled on a script injection that was not caught by the current Dangerous Workflow check rules. The current check can detect unsafe usage of workflow environment variables, but not cases where those same values are retrieved via the
gh
CLI tool, which is preinstalled in GitHub Actions runners.We learned in our investigation that GitHub very recently enabled CodeQL scanning for GitHub Actions, including some rules that do cover the
gh
CLI case.Describe the solution you'd like
For repositories without CodeQL workflow scanning enabled, it would be great to have detection coverage for the
gh
CLI cases from Scorecard. This would be the feature request.On the flip side, the SAST check already recommends enabling CodeQL, so if the CodeQL GitHub Action checks fully include / are a superset of the Dangerous Workflow checks (I haven't looked into feature parity here), then the Dangerous Workflow check might be redundant for repositories that have CodeQL scanning enabled. I don't personally see any downside (aside from the extra compute) in running both, as long as the results don't conflict. This is maybe a discussion point.
Describe alternatives you've considered
Users can run both tools.
Additional context
N/A
The text was updated successfully, but these errors were encountered: