]> git.kaiwu.me - haproxy.git/commit
REGTESTS: http-messaging: test http-hardening profiles and their CLI
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2026 17:11:10 +0000 (18:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2026 21:45:33 +0000 (22:45 +0100)
commit7deb59ca370a9ff23f8882351f85834916f1b596
treea22a18c691a4a553e997ae83d4117beeacc743ac
parent5a7f7cbc98eaccb50b60b0c367ea766f1f5b1e0e
REGTESTS: http-messaging: test http-hardening profiles and their CLI

This is an LLM-generated reg-test covering hardening config and CLI.

This covers the declaration and selection of http-hardening profiles, using
a few checks that are easy to observe on HTTP/1 requests:
  - the implicit "trusted" profile is the one used over the loopback when
    no profile or "auto" is set on the bind line, and both implicit
    profiles may be redefined;
  - "from" inherits the settings of another profile, and keywords are
    applied in order ("all on" followed by an exception);
  - "all-reject" and "all-delete" only cover their own family;
  - a server inherits its profile from default-server, and "auto" resets
    it to "trusted";
  - "show http-hardening" lists the profiles (implicit ones being marked
    as such) and dumps one profile's options, and "set http-hardening"
    changes an option by name or number, with immediate effect on both
    bind and server lines, and its error messages;
  - the configuration errors: undeclared or forward-referenced profile on
    bind and server lines, reserved name "auto", duplicate profile, unknown
    or self parent, unknown keyword with a suggestion, invalid value.

Since the "untrusted" profile now enables a few rejections by default, a
redefined "untrusted" profile starts with reject-lowercase-method, so the
test must expect a lower case method to be rejected there. This is now
checked explicitly, as well as the default contents of the implicit
"untrusted" and "trusted" profiles as reported by "show http-hardening",
and their inheritance by "from".
reg-tests/http-messaging/http_hardening_profiles.vtc [new file with mode: 0644]