Skip to content

core: Add a "b" flag to ErrorLogFormat's %a/%A for RFC 5952 bracketed IPv6 addresses (#1016) - #1027

Open
arturobernalg wants to merge 1 commit into
apache:2.4.xfrom
arturobernalg:backport/bz65696-ipv6-bracket-errorlogformat-24x
Open

arturobernalg wants to merge 1 commit into
apache:2.4.xfrom
arturobernalg:backport/bz65696-ipv6-bracket-errorlogformat-24x

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

(cherry picked from commit 14d0c60)

Backport of #1016.

BZ: https://bz.apache.org/bugzilla/show_bug.cgi?id=65696


[x] This PR does not report or address a security vulnerability (see SECURITY.md and https://www.apache.org/security/#reporting-a-vulnerability).
[x] Code follows the httpd style guide.
[x] New log messages (level debug or higher) use an empty APLOGNO() tag (not applicable -- no new log messages).
[x] If the change is user-visible, a changes-entries/*.txt file is included (carried over unchanged from the trunk commit).
[x] Test cases based on pyhttpd are included where appropriate (test/modules/core/test_016_errorlogformat_ipv6_bracket.py, carried over unchanged. Rebuilt this exact 2.4.x worktree and ran it against a real IPv6 (::1) listener: both the default-format-unchanged case and the new %{b}a/%{b}A bracket case pass).

…apache#1016)

IPv6 addresses.

%a and %A log an IPv6 address and port as "address:port", e.g.
"::1:34567" -- ambiguous, since both the address and the address/port
separator use ':'. This makes it hard for downstream log parsers
(syslog anonymizers, SIEMs, etc.) to tell where the address ends and
the port begins.

Add an opt-in "b" flag, "%{b}a" and "%{b}A", that writes the same
address and port in the RFC 5952, section 6 bracket notation,
"[address]:port", matching the convention already used by other HTTP
implementations for the same ambiguity (e.g. Netty's
NetUtil.toSocketAddressString(), OkHttp's HttpUrl.Builder.toString()).
IPv4 addresses are unaffected either way. The existing "%a"/"%A"/"%{c}a"
output is unchanged, so no existing log consumer is affected unless it
opts in.

PR 65696

(cherry picked from commit 14d0c60)
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.

1 participant