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

Not propose to add CodeQL when the default is already enabled #1869

Open
WikiRik opened this issue Jan 26, 2023 · 3 comments
Open

Not propose to add CodeQL when the default is already enabled #1869

WikiRik opened this issue Jan 26, 2023 · 3 comments

Comments

@WikiRik
Copy link

WikiRik commented Jan 26, 2023

Since a few weeks, GitHub allows a default setup for code scanning (CodeQL). If this default is enabled and you add a configuration through StepSecurity it will fail. See the logs from the sequelize repo here, especially the last two lines which contain the following error;

Error: Code Scanning could not process the submitted SARIF file:
CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled

StepSecurity should not recommend enabling CodeQL through the 'advanced' setup (through a yml file) when the 'default' is used.

@varunsh-coder
Copy link
Member

Thanks, @WikiRik! I will try to determine how to check whether the default setup is enabled. Would you happen to know if this info is part of earlier PRs (e.g., PR comments by CodeQL)? Or, how can one tell this based on GitHub API?

This might also need a change to Scorecard. I will check there as well.

@WikiRik
Copy link
Author

WikiRik commented Jan 26, 2023

That's the thing I am unsure about. Enabling the default setup does not change the codebase of the repo in any way, so there is no PR for that. I believe therefore it can only be enabled by people with write access (but I haven't checked which if any permissions are needed). You could see if CodeQL is run under the Actions tab, like https://github.com/sequelize/sequelize/actions/workflows/github-code-scanning/codeql

I haven't looked at the GitHub API yet, but that seems like the easiest way to detect it. It might also be something that is not yet available but will be added soon since the default setup is a relatively new feature.

@WikiRik
Copy link
Author

WikiRik commented Jan 26, 2023

Update; I found something in the GitHub API that might work; https://docs.github.com/en/rest/code-scanning?apiVersion=2022-11-28#list-code-scanning-analyses-for-a-repository shows various analyses that were done and based on the tool name you can find if CodeQL was enabled. That probably is not just the default setup but also the advanced setup. But that should not be an issue I think.

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

No branches or pull requests

2 participants