Feature/fix checkov tool list output json decode - #8
Merged
slManuel merged 3 commits intoAug 12, 2026
Conversation
added 2 commits
July 24, 2026 11:47
…ameworks Checkov returns a JSON list (one entry per framework) instead of a single dict when more than one framework is scanned in the same run (e.g. framework=[terraform, terraform_plan], triggered by --platform terraform/all with RULES_TERRAFORM). _async_scan always did result.append(json.loads(output)), assuming a dict. When output was actually a list, it produced a nested list inside result_scans, which later made CheckovDeserealizator fail with: list indices must be integers or slices, not str at checkov_deserealizator.py line 19 (result[results]). Fix is backward compatible: extend result with parsed_output when it is a list, keep append for the single-dict case, so other subsidiaries relying on the single-framework behavior see no change. Added regression test test_async_scan_with_multiple_frameworks_list_output.
Explanatory detail already lives in the fix commit message per repo conventions; keep the diff itself minimal.
…ializer get_list_finding used "'error' in str(result)" to detect failed scans. This substring check false-positives whenever a legitimate failed check's name/guideline/resource text contains the word error (common in security rule descriptions), discarding all already-collected findings and raising Exception(None) since result.get(error) returns None on a normal results dict. Replaced with isinstance(result, dict) and error in result, which only matches the real error dicts built in CheckovTool._async_scan (e.g. subprocess/JSON decode failures). Added regression tests: one for the false-positive case (finding text containing error), one confirming the real error path still raises.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.
Fix
How does someone fix the issue in code and/or in runtime?
Checklist: