You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to disable particular rule by its ID from GitHub workflow? #7937
I see a lof of false positives (actually all results in case of aforementioned rule) and I want to disable this particular rule and continue to review security report.
With the above suggestion, you can choose to remove any single query from analysis.
Alternatively, if you just want to focus on security queries, you may just want to run security-extended queries. Just change: queries: security-and-quality to queries: security-extended.
I understand, thanks for your explanation, but I don't want to bother with manually crafted query suites (and their combinations) and maintain them updating to be in-sync with source. Please consider adding an option in workflows to exclude particular rules.
@aeisenberg Hi, what is the current status of this issue? I see #1127 that reverts something, but I did not understand what exactly. So how can I disable particular rule for now?
Activity
aeisenberg commentedon Feb 10, 2022
There is no simple way to do this. You could create a custom query suite. In your workflow's codeql init step, you would specify a config file to use:
And then in the config file, you specify custom queries:
And finally, you need to create the query suite itself:
Using this, you will have control over exactly which queries you want to run.
sungam3r commentedon Feb 10, 2022
Understandable but I know the opposite - what queries I don't want to run, i.e. opt-out behavior instead of opt-in.
sungam3r commentedon Feb 10, 2022
I see a lof of false positives (actually all results in case of aforementioned rule) and I want to disable this particular rule and continue to review security report.
aeisenberg commentedon Feb 11, 2022
With the above suggestion, you can choose to remove any single query from analysis.
Alternatively, if you just want to focus on security queries, you may just want to run
security-extendedqueries. Just change:queries: security-and-qualitytoqueries: security-extended.sungam3r commentedon Feb 11, 2022
I understand, thanks for your explanation, but I don't want to bother with manually crafted query suites (and their combinations) and maintain them updating to be in-sync with source. Please consider adding an option in workflows to exclude particular rules.
aeisenberg commentedon Feb 11, 2022
Thank you for your suggestion. We will keep this under consideration.
aeisenberg commentedon Jun 15, 2022
Will be fixed here: github/codeql-action#1098
aeisenberg commentedon Jun 16, 2022
Available in next release of the codeql-action. Documentation still to come.
sungam3r commentedon Jun 18, 2022
Thanks.
scherersebastian commentedon Sep 12, 2022
So you have to create a separate file just to disable / exclude a query - @aeisenberg ?
aeisenberg commentedon Sep 12, 2022
That's correct. We might consider alternate syntaxes later, but this is the current behaviour.
[Lint] Add bat version and lint CI permission (#132)
sungam3r commentedon Apr 14, 2023
@aeisenberg Hi, what is the current status of this issue? I see #1127 that reverts something, but I did not understand what exactly. So how can I disable particular rule for now?
aeisenberg commentedon Apr 14, 2023
This has been implemented using a feature called query filters. See the docs. https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning#excluding-specific-queries-from-analysis
sungam3r commentedon Apr 18, 2023
Probably I do it wrong in graphql-dotnet/parser#301.
https://github.com/graphql-dotnet/parser/actions/runs/4728548769/jobs/8390195457?pr=301 :
https://github.com/graphql-dotnet/parser/actions/runs/4728592373/jobs/8390280163?pr=301
aeisenberg commentedon Apr 18, 2023
See my commenton your PR.
sungam3r commentedon Apr 19, 2023
Thanks.