-
Notifications
You must be signed in to change notification settings - Fork 509
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
Web hook secret used #1655
Comments
cc @justaugustus this is another one probably better for allstar |
this is something that is open for contribution? if so can I take it? |
i went ahead and start some implementation/testing |
thanks. We're not entirely sure this is do-able using the default workflow's GITHUB_TOKEN? Could you verify that? I suppose there are 2 ways we could use your code anyway:
@azeemsgoogle @naveensrinivasan @jeffmendoza feel free to chime in |
I tested with a PAT but i will confirm wich permission is needed. |
made a test: generate a new token with the |
@cpanato -- Curious... |
Another thing to test: does it work with the default |
#1675 looks great! Please let us know whether the webhook can be queried via What do folks think about having certain checks not available with certain tokens types? |
yes, and does not work, and I think this is a correct approach, otherwise, I can inspect webhook endpoints and use that for malicious things. for example, in a repo that I don't have access
|
What sort of malicious things? :-) |
@laurentsimon i can fetch the endpoint and then use that to do some DDoS attack or other things |
Hmm, I think this is a pretty strong reason to consider adding this check as part of AllStar instead of Scorecard. Scorecard hopes to make the security posture of a repo easily visible and understandable so that OSS consumers can know the risks they are undertaking. deps.dev is a great example of how someone might consume Scorecard data. If its a check that cannot/should not be exposed, it should not belong in Scorecard (my opinion). AllStar on the other hand is meant to be like your personal security bot that either automatically remediates the security issue for you or can privately raise security concerns with the maintainers so that they can tackle it. A similar usecase to this that AllStar tackles is 2FA - maintainers need to be notified that 2FA is not enabled for all maintainers, but at the same time this information should not be made public. I know you have put in a lot of time and effort behind #1675 @cpanato, so I apologize that we did not discuss this thoroughly beforehand. @jeffmendoza @laurentsimon @justaugustus @naveensrinivasan thoughts? |
@azeemshaikh38 no worries! |
I think we need to decide whether we'd be OK having checks that are only available via PAT. @azeemshaikh38 makes a good point that we may not want to make the data public to reduce possibility of abuse (which @cpanato has already mentioned). This means we'd have to be careful in the scorecard action, to not expose the results of these checks publicly, in particular when sending the results of these checks to our servers for badge generation. cc @rohankh532 I can see a use case for PAT-only checks for advanced users who may want to scan their own repo/orgs via the command line (or during a pen test exercise). This could be a good way for users to test the tool and see the value of it, and a way to show value and convince their orgs to adopt scorecard/allstar. Also, advanced users often find bugs, which is beneficial for us. Note that the Branch Protection check already has some dependency on the type of token: we cannot retrieve all settings unless the token has admin privileges. |
Please chime in if you have an opinion on this, so that we unblock @cpanato cc @oliverchang |
friendly ping if you have an opinion. |
Agree with this, I think it makes sense. |
we've discussed this in the by-weekly call. There was consensus there is a use case for this, and
@cpanato please feel free to finish the PR and get it merged. Just gate access to the check via an environment variable like Thanks all for the comments, suggestions and feedback. |
I have a suggestion instead of |
+1 to this, as I mentioned in today's meeting. |
+1 to have the env start with |
👍 |
@laurentsimon i will finish this over the weekend, thanks for all the reviews and feedback |
SG, just ping me on the PR when you need a review |
@laurentsimon just to give some status, i'm a bit busy with company work, but I'm planning to finish asap, my deadline is early next week |
I ran the "webhook" check the other day and among other things it complained about inactive webhooks. I'm not sure they should be included there. Other than that the documentation seems weird to me:
While I agree ideally it should be implemented I'm pretty sure most webhooks are provided by third-party services that are aware of those issues but in some cases aren't willing to fix it. I think unless scorecard (or whoever uses |
I'd add that this particular check can easily be misled by putting secret keys that aren't actually used anywhere. |
Interesting. Can you give an example of a repo we can try out to reproduce your results? (Feel free to create an issue)
Will file an issue for this, thanks
Let's address this by fixing the documentation. |
@laurentsimon having played with this check a bit more I don't think it makes sense to keep it because regardless of what scorecard says all webhooks have to be audited manually to make sure that secrets are actually used on the receiving end. I think it's helpful in terms of raising awareness so to speak though |
See if we can add a check to verify that web hooks defined in the repo have a secret configured for authentication https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks#secret
Unfortunately, I don't think the APIs let us query them without a PAT https://docs.github.com/en/rest/reference/webhooks#repository-webhooks :/
Note, however, that the PAT only needs to be read-only.
cc @azeemsgoogle @jeffmendoza
The text was updated successfully, but these errors were encountered: