Bug 1437456 - auditFilePath is logging to master container instead of host.
Summary: auditFilePath is logging to master container instead of host.
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.4.0
Hardware: Unspecified
OS: Linux
Target Milestone: ---
: 3.4.z
Assignee: Giuseppe Scrivano
QA Contact: Gaoyun Pei
Depends On:
Blocks: 1440779
TreeView+ depends on / blocked
Reported: 2017-03-30 11:10 UTC by Joel Rosental R.
Modified: 2017-12-15 07:55 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1440779 (view as bug list)
Last Closed: 2017-06-15 18:37:12 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1425 0 normal SHIPPED_LIVE OpenShift Container Platform 3.5, 3.4, 3.3, and 3.2 bug fix update 2017-06-15 22:35:53 UTC

Description Joel Rosental R. 2017-03-30 11:10:16 UTC
Description of problem:
When audit logging is enabled in a containerized installation without specifying an auditFilePath option then audit entries can bee seen as expected within syslog, however when auditFilePath option is specified then the file gets created and populated inside the master container itself instead of the host, which seems to be a bit cumbersome.

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

How reproducible:

Steps to Reproduce:
1. Setup auditFilePath option in an OCP 3.4 containerized installation
2. Restart atomic-openshift-master.service and see the file specified as value in auditFilePath does not get created automatically in the host but in the master container.

Actual results:
File gets created inside the master container.

Expected results:
File created in the host instead of inside the master container.

Additional info:

Comment 1 Marko Myllynen 2017-04-06 11:36:33 UTC
Remotely related: https://bugzilla.redhat.com/show_bug.cgi?id=1439619 .

Comment 6 Giuseppe Scrivano 2017-04-06 16:28:56 UTC
Proposed fix:


And for the system container version:


Comment 7 Giuseppe Scrivano 2017-04-10 08:14:39 UTC
backported to 1.4:


Comment 9 Gaoyun Pei 2017-06-05 06:30:46 UTC
Verify this bug with openshift-ansible-3.4.93-1.git.0.a6c353e.el7.noarch.rpm

Enable audit config for a containerized installation in ansible inventory file:
openshift_master_audit_config={"enabled": true, "auditFilePath": "/var/log/audit-ocp.log", "maximumFileRetentionDays": 10,"maximumRetainedFiles": 10,"maximumFileSizeMegabytes": 100}

After installation, check master config file
  auditFilePath: /var/log/audit-ocp.log
  enabled: true
  maximumFileRetentionDays: 10
  maximumFileSizeMegabytes: 100
  maximumRetainedFiles: 10

On master host, check the log file
-bash-4.2# tail /var/log/audit-ocp.log
2017-06-05T06:22:12.504559595Z AUDIT: id="0b6fca69-d7e3-4e6b-b5fa-2fbef4ff8f7e" ip="" method="GET" user="system:node:ip-172-18-2-189.ec2.internal" as="<self>" asgroups="<lookup>" namespace="<none>" uri="/api/v1/watch/services?resourceVersion=4835&timeoutSeconds=587"
2017-06-05T06:22:12.504981404Z AUDIT: id="0b6fca69-d7e3-4e6b-b5fa-2fbef4ff8f7e" response="200"

Inside the master contaier, check the log file
[root@ip-172-18-4-224 origin]# tail /var/log/audit-ocp.log
2017-06-05T06:22:50.780492517Z AUDIT: id="dbedd68c-48e8-49d6-beb2-4015dda16dfb" ip="" method="GET" user="system:serviceaccount:openshift-infra:job-controller" as="<self>" asgroups="<lookup>" namespace="<none>" uri="/apis/batch/v2alpha1/jobs"
2017-06-05T06:22:50.780854646Z AUDIT: id="dbedd68c-48e8-49d6-beb2-4015dda16dfb" response="200"
2017-06-05T06:22:52.27943335Z AUDIT: id="78cc8182-d921-407a-a08c-aea48f48e10d" ip="" method="GET" user="system:openshift-master" as="<self>" asgroups="<lookup>" namespace="<none>" uri="/api/v1/nodes?resourceVersion=0"

Comment 11 errata-xmlrpc 2017-06-15 18:37:12 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.


Note You need to log in before you can comment on or make changes to this bug.