feat(general): Include UNKNOWN check results in Checkov reports#7452
feat(general): Include UNKNOWN check results in Checkov reports#7452AnthonyQ98 wants to merge 8 commits intobridgecrewio:mainfrom
Conversation
…eport feat(general): Include UNKNOWN check results in Checkov reports
|
Hey @AnthonyQ98, thanks for this great contribution! 🙏 This feature is really needed — having UNKNOWN as an explicit check result state is super valuable for cases where checkov can't definitively determine pass/fail (like when a required API is unavailable or a resource is in a transient state). It helps distinguish between "we checked and it failed" versus "we couldn't check at all." 👍 I noticed you've updated all the output formats (CLI, JSON, CSV, SARIF, JUnit) consistently — that's awesome attention to detail! 😊 One small question: Have you considered how this might affect existing CI pipelines that parse the JSON output? I see you've added the field in a backward-compatible way (new field rather than changing existing structure), which is great. Just wondering if there's any documentation or migration note we should add for teams consuming the JSON programmatically. Thanks again for the thorough implementation with tests and docs! 🚀 |
|
Hey @AnthonyQ98, thanks for this great contribution! 👍 This feature is really needed - we've been struggling with invisible UNKNOWN results in our CI pipelines. Being able to see which checks couldn't be evaluated will help us identify coverage gaps and improve our policies over time. The implementation looks comprehensive - I like how you've handled all the output formats (JSON, SARIF, JUnit) consistently. The backward compatibility handling in is a nice touch too 😊 One quick question: have you considered how this might affect existing integrations that parse the JSON output? I see you've added the key to the results object, which should be fine for most consumers, but just wanted to check if there are any known edge cases. Great work on the tests as well - the coverage looks solid! 🙏 Looking forward to seeing this merged! |
|
Hey @AnthonyQ98, thanks for this great contribution! 👍 This feature is really needed - we've been struggling with invisible UNKNOWN results in our CI pipelines. Being able to see which checks couldn't be evaluated will help us identify coverage gaps and improve our policies over time. The implementation looks comprehensive - I like how you've handled all the output formats (JSON, SARIF, JUnit) consistently. The backward compatibility handling in One quick question: have you considered how this might affect existing integrations that parse the JSON output? I see you've added the Great work on the tests as well - the coverage looks solid! 🙏 Looking forward to seeing this merged! |
Review SummaryHey @AnthonyQ98, thanks for this well-structured PR! 🙌 This is a really valuable addition to Checkov. What I Like
Minor Observations
Questions
Overall, this looks solid and ready to go. The UNKNOWN state was definitely a gap in visibility - being able to see which checks "couldn'''t decide" is really useful for understanding scan coverage. 👍 Thanks for the contribution! |
….com/AnthonyQ98/checkov into feature/add-unknown-checks-to-report
Hey. Thank you for the feedback! I have updated the documentation with the suggested changes as part of the following commit b523c43 |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
Policies can return
CheckResult.UNKNOWNwhen they cannot determine pass or fail (e.g. variable-dependent values, Terraform planafter_unknown, or cases like CKV_AWS_140 when a global cluster is created from a source). Previously those results were never added to the report, so UNKNOWNs were invisible in the summary, JSON, CLI, and other outputs.Why surface UNKNOWN checks: It’s important to see which checks were not evaluated (not passed, failed, or skipped). That lets you spot coverage gaps, follow up when a policy couldn’t reach a definite result, and decide whether to resolve variables, adjust the plan, or accept the uncertainty—instead of assuming “no result” meant the check didn’t run or wasn’t applicable.
This change adds an
unknown_checkslist to the report and treats it likepassed_checks/failed_checks/skipped_checkseverywhere:Report.unknown_checks,add_record()appends UNKNOWN, summary includesunknown, andget_dict/get_all_records/ merge / dedupe include it.EVAL_TF_PLAN_AFTER_UNKNOWN; README and Reviewing Scan Results updated.Backward compatibility:
from_reduced_jsonstill loads reports that don’t haveunknown_checksby normalizing the checks dict. UNKNOWN does not affect exit code.Fixes # (issue)
New/Edited policies (Delete if not relevant)
Not applicable — no new or edited policies.
Checklist