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): 3.4.7 3.4.10 How reproducible: Always 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:
Remotely related: https://bugzilla.redhat.com/show_bug.cgi?id=1439619 .
Proposed fix: https://github.com/openshift/openshift-ansible/pull/3872 And for the system container version: https://github.com/openshift/origin/pull/13657
backported to 1.4: https://github.com/openshift/openshift-ansible/pull/3886
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 auditConfig: 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="172.18.2.189" 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="172.18.4.224" 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="172.18.4.224" method="GET" user="system:openshift-master" as="<self>" asgroups="<lookup>" namespace="<none>" uri="/api/v1/nodes?resourceVersion=0"
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:1425