Fix: HTML report drops all AI findings#139
Merged
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Summary
The HTML report never rendered the AI/LLM findings. It only rendered
Trivy's package vulnerabilities from
json_data, so an AI-only run(Dockerfile analysis with no image, e.g.
docksec Dockerfile --provider anthropic) produced an HTML report showing nothing but the securityscore — even though the terminal reported dozens of findings across
vulnerabilities, best practices, security risks, exposed credentials,
and remediation steps.
Because the terminal output is intentionally truncated to a few items
per section (
... and 7 more), and the PDF/JSON reports were the onlyplace the full list lived, the HTML report — the format most users open
— left those findings effectively unreachable.
This is the sibling of the 2026.7.3 fix ("AI analysis without an image
wrote no report"): that made AI-only runs write a report at all; this
makes the HTML report actually contain the AI findings.
Changes
report_generator.py: new_build_ai_analysis_html()renders allfive AI finding categories in full (untruncated), each with a count,
HTML-escaped, reusing the existing
.section/.config-liststylesso it matches the current theme. Wired into
_prepare_html_template_vars; renders empty for scanner-only runs.templates/report_template.html: added the{{AI_ANALYSIS_SECTION}}placeholder after Configuration Analysis.
tests/test_report_generator.py: added tests covering full rendering(all findings present, with counts), HTML escaping, and omission of
the section when there are no AI findings.
docs/CHANGELOG.md: Fixed entry under Unreleased.Testing
the complete finding list (all items, not the truncated preview),
including findings previously cut mid-sentence in the terminal.
Scope
HTML path only. Terminal truncation is unchanged by design (compact
view); PDF and JSON already rendered these findings.