-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fluent-plugin: Add client certificate verification #1189
Conversation
@@ -67,6 +74,13 @@ def configure(conf) | |||
|
|||
@label_keys = @label_keys.split(/\s*,\s*/) if @label_keys | |||
@remove_keys = @remove_keys.split(',').map(&:strip) if @remove_keys | |||
|
|||
@cert = OpenSSL::X509::Certificate.new(File.read(@cert)) if @cert | |||
@key = OpenSSL::PKey::RSA.new(File.read(key)) if @key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance to use OpenSSL::PKey.read
?
ref: https://ruby-doc.org/stdlib-2.4.0/libdoc/openssl/rdoc/OpenSSL/PKey.html#method-c-read
This method should be more flexible to handle private key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be possible, I'll update this in the next commit
|
||
if [email protected]? && [email protected]? | ||
opts = opts.merge( | ||
verify_mode: OpenSSL::SSL::VERIFY_PEER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we handle VERIFY_NONE
case for self-signed sertificates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using self-signed certificates, wouldn't it be better to pass ca_cert
to verify the server's self-signed cert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, you are right.
Please leave it as-is until VERIFY_NONE
use case is found.
9aac566
to
7ee3dbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Did you tried this PR out? I immediately got
without cert config. edit: I added a fix here #1242 |
What this PR does / why we need it:
Allow the fluentd to push logs to Loki servers located behind a reverse proxy with client certificate verification.
Checklist