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 1446874

Summary: Missing ClientIP and ServerIP in audit log when pki CLI terminates SSL connection
Product: Red Hat Enterprise Linux 7 Reporter: Matthew Harmsen <mharmsen>
Component: pki-coreAssignee: Endi Sukma Dewata <edewata>
Status: CLOSED ERRATA QA Contact: Asha Akkiangady <aakkiang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: bbhavsar
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pki-core-10.4.1-3.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 22:50:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Harmsen 2017-04-30 06:04:50 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/dogtagpki/issue/2642

When pki CLI terminates SSL connection from PKI server, the server generates an audit log with empty ClientIP and ServerIP fields:

    0.http-bio-8443-exec-3 - [13/Apr/2017:18:28:30 CEST] [14] [6] [AuditEvent=ACCESS
    _SESSION_TERMINATED][ClientIP=][ServerIP=][SubjectID=][Outcome=Success][Info=CLO
    SE_NOTIFY] access session terminated

The reason is the server obtained the client and server IP addresses from the following methods which do return null if the socket has already been closed:

* http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#getInetAddress()
* http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#getLocalAddress()

Possible solutions:

* Option #1: PKI server needs to keep track the socket and record the IP addresses while it's still connected.
* Option #2: JSS needs to be modified to record the last connected IP addresses and provide it to PKI server.

Comment 2 Matthew Harmsen 2017-04-30 06:07:09 UTC
Proposed fix based on option #1: https://review.gerrithub.io/#/c/357375/

Fixed in master: 749c137b59a9725a4cacdcd191b7e931303981df

Comment 3 Matthew Harmsen 2017-04-30 06:08:32 UTC
edewata fixed according to the following check-ins:

(In reply to Matthew Harmsen from comment #2)
> Proposed fix based on option #1: https://review.gerrithub.io/#/c/357375/
> 
> Fixed in master: 749c137b59a9725a4cacdcd191b7e931303981df

Comment 5 bhavik 2017-05-23 08:47:29 UTC
Verified on build:

root@pki1 ~ # rpm -qi pki-base
Name        : pki-base
Version     : 10.4.1
Release     : 4.el7
Architecture: noarch
Install Date: Mon 15 May 2017 05:29:53 PM IST
Group       : System Environment/Base
Size        : 2086209
License     : GPLv2
Signature   : RSA/SHA256, Wed 10 May 2017 09:03:58 AM IST, Key ID 199e2f91fd431d51
Source RPM  : pki-core-10.4.1-4.el7.src.rpm
Build Date  : Wed 10 May 2017 06:53:16 AM IST
Build Host  : ppc-021.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://pki.fedoraproject.org/
Summary     : Certificate System - PKI Framework


root@pki1 ~ # tail -f /var/log/pki/topology-02-CA/ca/signedAudit/ca_audit

IPv4

0.http-bio-20443-exec-1 - [23/May/2017:14:08:37 IST] [14] [6] [AuditEvent=ACCESS_SESSION_TERMINATED][ClientIP=10.65.223.208][ServerIP=10.65.223.208][SubjectID=CN=PKI Administrator,E=caadmin,OU=topology-02-CA,O=topology-02_Foobarmaster.org][Outcome=Success][Info=CLOSE_NOTIFY] access session terminated

request from different client

0.http-bio-20443-exec-13 - [23/May/2017:14:13:44 IST] [14] [6] [AuditEvent=ACCESS_SESSION_TERMINATED][ClientIP=10.65.223.42][ServerIP=10.65.223.208][SubjectID=CN=PKI Administrator,E=caadmin,OU=topology-02-CA,O=topology-02_Foobarmaster.org][Outcome=Success][Info=CLOSE_NOTIFY] access session terminated

IPv6

0.http-bio-20443-exec-13 - [23/May/2017:13:57:30 IST] [14] [6] [AuditEvent=ACCESS_SESSION_TERMINATED][ClientIP=fe80:0:0:0:5054:ff:fe71:8abc][ServerIP=fe80:0:0:0:5054:ff:fe71:8abc][SubjectID=][Outcome=Success][Info=CLOSE_NOTIFY] access session terminated

Comment 6 errata-xmlrpc 2017-08-01 22:50:57 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/RHBA-2017:2110