Skip to content

Fix IPv6 address parsing in awf logs - #11953

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-ipv6-upstream-parsing
Nov 22, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/fix-ipv6-upstream-parsing

Conversation

@lpcox

@lpcox lpcox commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Squid logs unbracketed IPv6 upstream addresses, but the text parser split at the first colon, corrupting JSON destination fields and displaying IPv6 fragments as ports in pretty output.

  • Parsing: Split client and upstream addresses at the last colon; retain IPv4 and numeric-or-dash upstream ports.
  • Regression coverage: Add IPv6 CONNECT/HTTP cases, IPv6 clients, and JSON/pretty output assertions.

For example:

2606:2800:21f:cb07:6820:80ad:4ad3:a4ba:80
→ destIp: 2606:2800:21f:cb07:6820:80ad:4ad3:a4ba
→ destPort: 80
→ pretty: GET example.com → 200 (ALLOWED)

@lpcox lpcox changed the title [WIP] Fix upstream address parsing for IPv6 Fix IPv6 address parsing in awf logs Nov 22, 2026
@lpcox
lpcox marked this pull request as ready for review November 22, 2026 17:24
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the IPv6 log-parsing and output-preservation changes.

No open issues 🎉

What changed in this PR

Fixes #11927 by correcting IPv6 address parsing in AWF’s Squid text logs, preserving destination fields in JSON and port display in pretty output.

Changes:

  • Split client and upstream address fields at the last colon, preserving IPv4 and numeric-or-dash upstream ports.
  • Add regression coverage for IPv6 clients and upstreams, plus JSON and pretty output.
File Description
src/​logs/​log-parser.ts Updates address captures to support unbracketed IPv6.
src/​logs/​log-parser-ipv6.test.ts Covers IPv6 address variants, IPv4, and missing upstream values.
src/​logs/​log-formatter.test.ts Verifies parsed IPv6 entries produce correct JSON and pretty output.

Review effort: Balanced (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox
lpcox merged commit 4015bc3 into main Nov 22, 2026
40 of 43 checks passed
@lpcox
lpcox deleted the copilot/fix-ipv6-upstream-parsing branch November 22, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

awf logs: access.log parser splits IPv6 upstream address at the first colon

3 participants