Bug 1639710

Summary: PKI subsystem process is not shutdown when there is no space on the disk to write logs
Product: Red Hat Enterprise Linux 7 Reporter: Asha Akkiangady <aakkiang>
Component: pki-coreAssignee: Endi Sukma Dewata <edewata>
Status: CLOSED ERRATA QA Contact: Asha Akkiangady <aakkiang>
Severity: high Docs Contact: Marc Muehlfeld <mmuehlfe>
Priority: high    
Version: 7.6CC: aakkiang, cfu, cpelland, dpunia, edewata, mharmsen, msauton
Target Milestone: rcKeywords: TestCaseProvided, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pki-core-10.5.16-2.el7 Doc Type: Bug Fix
Doc Text:
.Certificate System automatically shuts down if signed audit logs cannot be stored due to a full file system Previously, if audit signing was enabled and the file system on which Certificate System stored the signed audit logs was full, Certificate System continued operating but did not log further operations. To prevent missing signed audit logs, Certificate System now shuts down automatically in the mentioned scenario.
Story Points: ---
Clone Of:
: 1643880 (view as bug list) Environment:
Last Closed: 2019-08-06 13:07:19 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:    
Bug Blocks: 1643880    
Attachments:
Description Flags
CA Agent UI partially responding when audit signing log is full
none
Debug log messages attached
none
Browser Screenshot none

Description Asha Akkiangady 2018-10-16 12:37:18 UTC
Description of problem:
PKI subsystem (example: CA) process is not shutdown when there is no space on the disk to write logs (example: signed audit log).

Version-Release number of selected component (if applicable):
pki-server-10.5.9-6.el7.noarch

How reproducible:


Steps to Reproduce:
Testing CA instance when signedaudit log is full:
1. pkispawn a CA instance
2. Create a small partition on the disk. 
create a 2M ram-disk for audit logs at /audit-logs:   
Login as a super user   
# mkdir /audit-logs   
# mount -t tmpfs -o size=2M,mode=0755 tmpfs /audit-logs   
# chown pkiuser:pkiuser /audit-logs   
Add appropriate selinux context to the partition:   
# /usr/sbin/semanage fcontext -a -t pki_tps_log_t /audit-logs   
# /sbin/restorecon -vR /audit-logs        

3. Configure CA signed audit true and signed audit log to write to this new partition.
Note: Save value of  parameter log.instance.SignedAudit.fileName. log.instance.SignedAudit.logSigning=true log.instance.SignedAudit.fileName=/audit-logs/ca_audit 

4. Restart the subsystem.      
# systemctl restart pki-tomcatd@<ca-inst>.service
5.Fill the partiton: 
Login to the shell as a super user, fill the new partition by creating a big file using dd command. Modify the "bs" value so that your partion is filled.   example: # dd if=/dev/zero of=/audit-logs/bigfile bs=1M count=117        

6. From CA agent page or using CLI commands make some more requests to CA so that the partition is completely full. Notice that it stops writing to file /audit-logs/ca_audit.

Actual results:
There is no message in CA's debug or Catalina logs indicating disk is full.
CA process is not completely shut down. Some of the requests on the agent UI continue to respond.

# pki ca-cert-find
PKIException: Unable to search certificates: attribute serialno is not registered

Expected results:
An exception indicating disk is full should be logged in Catalina log file.
Servlets should be disabled.
CA process should completely shut down.


Additional info:
Documentation for this feature: https://access.redhat.com/documentation/en-us/red_hat_certificate_system/9/html/administration_guide/java-logs 
See section 15.2.5.7. Handling Audit Logging Failures

Comment 2 Asha Akkiangady 2018-10-16 13:26:08 UTC
One correction needed in step #2.
# /usr/sbin/semanage fcontext -a -t pki_ca_log_t /audit-logs

Comment 3 Asha Akkiangady 2018-10-16 13:40:04 UTC
Created attachment 1494363 [details]
CA Agent UI partially responding when audit signing log is full

Comment 4 Asha Akkiangady 2018-10-16 19:29:15 UTC
Created attachment 1494557 [details]
Debug log messages attached

Comment 6 Christina Fu 2018-10-24 21:26:01 UTC
Endi, is this bug related to the following?
https://bugzilla.redhat.com/show_bug.cgi?id=1248216

Comment 7 Endi Sukma Dewata 2018-10-24 21:32:04 UTC
Not really. Bug #1248216 is about pkidaemon not showing an accurate subsystem status (it can be obtained using pki-server subsystem-find command). The current bug is about one scenario that might cause a subsystem to shutdown.

Comment 8 Endi Sukma Dewata 2018-10-24 21:32:57 UTC
Asha, please provide a qa_ack. Thanks!

Comment 12 Endi Sukma Dewata 2018-12-17 14:33:01 UTC
The verification steps were provided in the original bug description.

Comment 15 Deepak Punia 2019-06-14 09:02:26 UTC
Created attachment 1580599 [details]
Browser Screenshot

Comment 21 errata-xmlrpc 2019-08-06 13:07:19 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-2019:2228