Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1507145

Summary: RFE: omelasticsearch support client cert authentication
Product: Red Hat Enterprise Linux 7 Reporter: Rich Megginson <rmeggins>
Component: rsyslogAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Anping Li <anli>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: anli, dapospis, dkopecek, extras-qa, jcantril, jlieskov, jvymazal, lkundrak, lvlcek, mah.darade, me, mifiedle, mthacker, nhosoi, nkinder, pportant, rmeggins, rsroka, schituku, tkatarki
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rsyslog-8.24.0-21.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: 1507144 Environment:
Last Closed: 2018-10-30 10:17:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1507144    
Bug Blocks:    
Attachments:
Description Flags
add support for elasticsearch client cert auth
rmeggins: review?
docs patch for rsyslog-doc rmeggins: review?

Description Rich Megginson 2017-10-27 19:57:47 UTC
+++ This bug was initially created as a clone of Bug #1507144 +++

Description of problem:
The omelasticsearch module needs to be able to authenticate to Elasticsearch using client cert auth.

Version-Release number of selected component (if applicable):
8.30

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

omelasticsearch.c uses libcurl. It should be straightforward to add configuration parameters and support for the client cert and key.

There should be two new parameters:

- client_cert - This is the full path and file name of a PEM formatted client certificate.  This corresponds to the curl CURLOPT_SSLCERT option.
- client_key - This is the full path and file name of a PEM formatted private key.  The code should assume that by default it is unencrypted.  This corresponds to the curl CURLOPT_SSLKEY option.

Comment 2 Rich Megginson 2018-03-19 16:50:38 UTC
Fix has been merged upstream

Comment 3 Daniel Kopeček 2018-04-04 13:11:57 UTC
(In reply to Rich Megginson from comment #2)
> Fix has been merged upstream

Switching back to NEW as this bug has not been processed yet and doesn't have a downstream patch attached.

Comment 5 Rich Megginson 2018-04-04 16:54:40 UTC
Created attachment 1417351 [details]
add support for elasticsearch client cert auth

I also submitted a merge request against the internal gitlab rhel-7.6 branch: https://gitlab.cee.redhat.com/rsyslog/rsyslog/merge_requests/3
which is the preferred workflow.  The patch is constructed as a git format-patch of that commit

Comment 6 Rich Megginson 2018-04-04 16:55:38 UTC
> which is the preferred workflow

That is - I would prefer that reviews take place in gitlab in the merge request.

Comment 7 Rich Megginson 2018-04-04 23:08:42 UTC
Created attachment 1417481 [details]
docs patch for rsyslog-doc

backported docs patch to 8.24.0 (rhel-7.6)

Comment 16 Anping Li 2018-07-25 09:54:05 UTC
Test with rsyslog-elasticsearch-8.24.0-27.el7.x86_64 and atomic-openshift-3.10.18. The logs are sent to elasticsearch when use correct authorization. 

With invalid token, the records will be rejected.
'
1738.866569115:main Q:Reg/w0  : omelasticsearch: checkConn(https://logging-es:9200/) failed on attempt 0: Problem with the local SSL certificate
1738.866587673:main Q:Reg/w0  : omelasticsearch: checkConn() failed after 1 attempts.
1738.866593963:main Q:Reg/w0  : Action 5 transitioned to state: rtry
1738.866596871:main Q:Reg/w0  : actionCommit, action 5, in retry loop, iRet -2007
1738.866599406:main Q:Reg/w0  : actionDoRetry: action 5 enter loop, iRetries=0, ResumeInRow 1
1738.866601441:main Q:Reg/w0  : omelasticsearch: tryResume called
1738.867641370:main Q:Reg/w0  : omelasticsearch: checkConn(https://logging-es:9200/) failed on attempt 0: Problem with the local SSL certificate
1738.867656404:main Q:Reg/w0  : omelasticsearch: checkConn() failed after 1 attempts.
1738.867659691:main Q:Reg/w0  : actionDoRetry: action 5 action->tryResume returned -2007

Comment 17 Anping Li 2018-08-21 10:39:23 UTC
Test with rsyslog-elasticsearch-8.24.0-33.el7.x86_64, atomic-openshift-3.11.0-0.19.0. The Log can be sent to Openshift Elasticsearch using client cert authentication.

Comment 20 errata-xmlrpc 2018-10-30 10:17:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3135