net/haproxy: per-certificate (SNI) client certificate verification (mTLS) in Public Service

Đang mở
#5,934 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
networking

Hướng nghiên cứu

Start by reading the HAProxy plugin's Public Service SSL Offloading configuration and how it generates certificate lists; the issue names no source files or tests. Compare the generated entries with the HAProxy 2.8 crt-list options described in the issue. Done means per-certificate settings can be configured and rendered so verification applies only to the selected SNI.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature help wanted

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.
I run a single HAProxy Public Service on WAN:443 that terminates TLS for many domains. One of them (e.g. monitoring.example.com) must require mutual TLS (client certificates issued by a private CA). The others must stay unchanged.

Currently, client certificate verification can only be set per Public Service, which applies it to every domain on that bind:

  • required breaks all other domains.
  • optional sends a CertificateRequest for every domain. Users holding a matching client certificate get a certificate prompt on unrelated sites.

HAProxy itself supports this natively. A crt-list entry can carry its own SSL bind options, so verification can be enforced for one SNI only:

/path/monitoring.pem [verify required ca-file /path/client-ca.pem crl-file /path/client-ca.crl] monitoring.example.com
/path/other.pem other.example.com

The plugin GUI offers no way to set these per-certificate options. Manual edits to the generated files are overwritten on Apply, restart, or reboot.

Describe the solution you'd like
In Public Service → SSL Offloading, allow per-certificate (per-SNI) overrides that the plugin renders as crt-list entry options:

  • Client certificate verification: inherit (default) / none / optional / required
  • Certificate Authorities used for client verification (selection from System → Trust → Authorities) → ca-file
  • CRLs (selection from System → Trust → Revocation) → crl-file
  • Optionally, a free-text "SSL options pass-through" field per certificate for other supported crt-list options (alpn, ssl-min-ver, ciphers, ...)

Example result for the config above: the client certificate is requested and required only when the SNI is monitoring.example.com. All other domains on the same Public Service behave as before.

Describe alternatives you've considered

  1. Separate Public Service for the mTLS domain. Works, but needs an extra public IP or a non-standard port.
  2. verify optional on the shared Public Service plus backend ACLs. Uses backend option pass-through, e.g. http-request deny unless { ssl_c_used } { ssl_c_verify 0 }. Works, but users with client certificates get certificate prompts on all other domains.
  3. Chained frontends. A TCP-mode Public Service routes by req.ssl_sni to two internal SSL Public Services on 127.0.0.1 with PROXY protocol, one of them with verify required. Works entirely from the GUI, but is complex and adds an extra hop for all traffic.
  4. Editing the generated crt-list in /tmp/haproxy/ssl/ by hand. Works as a proof of concept, but is overwritten on every Apply, service restart, reboot, or plugin update.

Additional context

  • HAProxy documentation, crt-list (per-entry SSL bind options such as verify, ca-file, crl-file): https://docs.haproxy.org/3.2/configuration.html#5.1-crt-list
  • Use case: protecting an internal web UI (monitoring) with client certificates from a private two-tier PKI. Other domains share the same public IP and port 443.
  • In the backend, the request can additionally be checked with ssl_c_i_dn to accept only a specific issuing CA. This already works through backend option pass-through.
Ngôn ngữ chính
PHP
Star
1.2k
Fork
932
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của opnsense/plugins

Tất cả issue của opnsense/plugins

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.