Mutual TLS on multi-worker /aggregated_metrics still uses VERIFY_NONE
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Read do_request in lib/fluent/plugin/in_prometheus.rb and the async-http path in lib/fluent/plugin/in_prometheus/async_wrapper.rb. Trace how the TLS transport's CA settings are made available to the loopback worker fetches, then run or add coverage for multi-worker /aggregated_metrics on both paths. Done when both verify worker certificates against the transport CA and reject an invalid certificate.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When in_prometheus uses TLS and workers > 1, /aggregated_metrics fetches each worker on loopback with OpenSSL::SSL::VERIFY_NONE. External /metrics can require a client certificate ( and client_cert_auth). The worker-aggregation fetch does not verify the worker certificate, so that path is not mutual TLS.
The setting is in do_request in lib/fluent/plugin/in_prometheus.rb:
if secure
http.use_ssl = true
target is our child process. so it's secure.
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
The async-http path in lib/fluent/plugin/in_prometheus/async_wrapper.rb has the same gap.
To Reproduce
Start Fluentd with workers 2 and the configuration below.
Request https://127.0.0.1:24231/aggregated_metrics with a valid client certificate.
The parent worker scrapes the other worker with verify_mode = OpenSSL::SSL::VERIFY_NONE.
A worker certificate that would fail VERIFY_PEER is still accepted on that internal fetch.
Expected behavior
The loopback fetch should use VERIFY_PEER and the same CA as the TLS transport, on both the Net::HTTP path and the async-http path. A bad worker certificate should be rejected.
Your Environment
Rocky8
- Fluentd version: 1.16.9
- TD Agent/Fluent Package version: fluent-package 5.0.7 (fluent-package-5.0.7-1.el8.x86_64)
- fluent-plugin-prometheus version: 2.1.0
- prometheus-client version: 2.1.0
- Operating system: Rocky Linux 8.10 (Green Obsidian)
- Kernel version: 5.15.167.4-microsoft-standard-WSL2
Your Configuration
workers 2 @type prometheus bind 0.0.0.0 port 24231 metrics_path /metrics cert_path /path/to/server.crt private_key_path /path/to/server.key ca_path /path/to/ca.pem client_cert_auth trueYour Error Log
No error is logged. The loopback scrape succeeds because verification is disabled. That is the bug: a certificate that VERIFY_PEER would reject is accepted
Additional context
No response
- Ngôn ngữ chính
- Ruby
- Star
- 256
- Fork
- 83
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluent/fluent-plugin-prometheus
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
fluent/fluent-plugin-prometheus#234 · 1 bình luận ·
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
-
metrics url support basic authĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
FluentD MetricsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
Tất cả issue của fluent/fluent-plugin-prometheus
Issue tương tự
-
Ruby: The link in the Blocks lesson points to an external article that isn't at that address anymoreĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
TheOdinProject/curriculum#31529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
FinanceFlash/unvibecode#699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
chat
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
Maintainer thường phản hồi trong vòng 9 ngày