Add Go firewall logs parser mirroring JavaScript implementation#2350
Merged
Add Go firewall logs parser mirroring JavaScript implementation#2350
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…commands Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update logs and audit command to add Golang firewall parser
Add Go firewall logs parser mirroring JavaScript implementation
Oct 25, 2025
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a Go firewall logs parser that mirrors the existing JavaScript implementation in pkg/workflow/js/parse_firewall_logs.cjs. The parser extracts network access patterns from proxy logs and integrates them into both the logs and audit commands with structured console and JSON output.
Key Changes:
- Added comprehensive firewall log parsing with field-for-field validation matching JavaScript regex patterns
- Implemented request classification (allowed/denied) based on status codes and proxy decisions
- Integrated firewall analysis into artifact download pipeline with automatic aggregation across workflow runs
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/firewall_log.go |
Core parser implementation with validation, classification, and analysis logic |
pkg/cli/firewall_log_test.go |
Unit tests covering valid/invalid formats, malformed lines, and aggregation |
pkg/cli/firewall_log_integration_test.go |
Integration tests for real-world parsing and multi-run aggregation |
pkg/cli/logs_report.go |
Added FirewallLogSummary struct and buildFirewallLogSummary() function |
pkg/cli/logs.go |
Integrated firewall analysis into ProcessedRun, RunSummary, and DownloadResult |
pkg/cli/audit.go |
Added firewall log analysis to audit command workflow |
docs/src/content/docs/reference/frontmatter-full.md |
Removed outdated firewall feature flag documentation |
.github/workflows/research.lock.yml |
Updated JavaScript parser with enhanced validation |
FIREWALL_LOG_PARSER_IMPLEMENTATION.md |
Comprehensive implementation documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
github-actions bot
added a commit
that referenced
this pull request
Oct 25, 2025
Update CLI documentation to reflect recent feature additions: - Document firewall log parsing in --parse flag (PR #2349, #2350) - Logs and audit commands now generate firewall.md files - JSON output includes firewall analysis - Update --dependabot documentation (PR #2359) - Added pip and Go ecosystem support - Clarified command detection patterns - Add repository feature validation section (PR #2347) - Compile validates discussions/issues enabled - Prevents runtime failures for incompatible workflows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Implements a Go firewall logs parser that extracts network access patterns from proxy logs, mirroring the existing JavaScript parser in
pkg/workflow/js/parse_firewall_logs.cjs. Integrates into bothlogsandauditcommands with structured output.Implementation
Core Parser (
pkg/cli/firewall_log.go)timestamp client_ip:port domain dest_ip:port proto method status decision url user_agentData Structures
FirewallAnalysis- structured analysis result with totals, domain lists, per-domain statsFirewallLogSummary- aggregates across multiple workflow runsDomainRequestStats- tracks allowed/denied counts per domainIntegration Points
ProcessedRun,RunSummary,DownloadResultto includeFirewallAnalysisanalyzeFirewallLogs()to artifact download pipeline (parallel to existing access log analysis)buildFirewallLogSummary()for cross-run aggregationExample Output
Console:
JSON:
{ "firewall_log": { "total_requests": 8, "allowed_requests": 5, "denied_requests": 3, "allowed_domains": ["api.github.com:443", "pypi.org:443"], "denied_domains": ["blocked.example.com:443"], "requests_by_domain": { "api.github.com:443": {"allowed": 2, "denied": 0} } } }Testing
run_summary.jsonwith version trackingReference: https://github.com/githubnext/gh-aw/actions/runs/18795259023
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.