feat(display): improve NAT rule directionality presentation in markdown reports - #182
Conversation
…wn reports Add clear visual separation between outbound and inbound NAT rules with direction indicators and proper table structures: - Add BuildOutboundNATTable and BuildInboundNATTable methods to MarkdownBuilder - Update BuildSecuritySection to use new NAT table builders - Add direction indicators (⬆️ Outbound / ⬇️ Inbound) in table rows - Add inbound rules count to NAT summary - Add security warning for inbound NAT rules (port forwarding exposure) - Update templates to iterate over inbound NAT rules with proper tables - Add clear H4 subsection headers: "Outbound NAT (Source Translation)" and "Inbound NAT (Port Forwarding)" Closes #60 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Caution Review failedFailed to post review comments 📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThis PR enhances NAT rule presentation in markdown reports by implementing dedicated outbound and inbound NAT table builders with direction indicators, security warnings, and template integration for clear traffic flow visualization. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This pull request improves the presentation of NAT rules in markdown reports by introducing clear visual directionality indicators and separating inbound/outbound NAT rules into dedicated sections.
Changes:
- Added
BuildOutboundNATTableandBuildInboundNATTablemethods toMarkdownBuilderfor programmatic generation of NAT rule tables with direction indicators (⬆️ Outbound / ⬇️ Inbound) - Updated
BuildSecuritySectionto use the new table builders and include inbound rules count in the NAT summary - Added security warnings for port forwarding configurations that increase attack surface
- Updated all templates to properly iterate over inbound NAT rules and display them with consistent formatting
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/converter/markdown.go | Added BuildOutboundNATTable and BuildInboundNATTable methods with proper escaping, status formatting, and direction indicators; updated BuildSecuritySection to use new builders and include inbound rules count |
| internal/converter/markdown_builder_test.go | Added comprehensive unit tests for new NAT table builders covering rules with data, empty rules, special characters, and security warnings |
| internal/templates/reports/standard.md.tmpl | Updated NAT sections with direction indicators, proper iteration over inbound rules, and security warnings |
| internal/templates/opnsense_report_comprehensive.md.tmpl | Updated NAT sections with direction indicators, proper iteration over inbound rules, and security warnings |
| internal/templates/opnsense_report.md.tmpl | Updated NAT sections with direction indicators, proper iteration over inbound rules, inbound count in summary, and security warnings |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
BuildOutboundNATTableandBuildInboundNATTablemethods to MarkdownBuilder for clear visual separation of NAT rule typesBuildSecuritySectionto use new NAT table builders with direction indicators (⬆️ Outbound / ⬇️ Inbound)Test plan
just ci-check- all tests passBuildOutboundNATTable(with rules, empty rules, special characters)BuildInboundNATTable(with rules, empty rules, special characters)BuildSecuritySectionwith both NAT types and security warningsCloses #60
🤖 Generated with Claude Code