Bug 1632155

Summary: Cannot see basic audit log but just advanced log
Product: OpenShift Container Platform Reporter: Maciej Szulik <maszulik>
Component: MasterAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: ge liu <geliu>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.11.0CC: aos-bugs, bandrade, geliu, jokerman, maszulik, mfojtik, mmccomas, rpuccini, wsun, xtian, xxia
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Default log format for audit was set to json. Consequence: Audit log was always printed using json format. Fix: Allow setting log format as specified in master-config.yaml Result: Audit log contains values per configured log format.
Story Points: ---
Clone Of: 1631087 Environment:
Last Closed: 2019-01-10 09:04:01 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: 1631087    
Bug Blocks: 1632154    

Comment 1 Maciej Szulik 2018-09-24 08:59:36 UTC
Fix in https://github.com/openshift/origin/pull/21080

Comment 2 ge liu 2018-10-15 04:56:41 UTC
Fail to verify it with:openshift v3.11.22

Comment 3 Maciej Szulik 2018-10-15 10:22:01 UTC
Geliu I assume your failure is the one from https://bugzilla.redhat.com/show_bug.cgi?id=1631087#c4 so here the same applies, you need to set logFormat explicitly to get different log format.

Comment 4 ge liu 2018-10-15 11:22:27 UTC
Verified with ocp:

openshift v3.11.22

master-config.yaml:
auditConfig:
  auditFilePath: "/etc/origin/master/1audit-ocp.log"
  logFormat: legacy
  enabled: true
  maximumFileRetentionDays: 10
  maximumFileSizeMegabytes: 10
  maximumRetainedFiles: 10


2018-10-15T11:16:23.021652741Z AUDIT: id="f3200303-682c-4432-8bfc-30454f2c2d4f" stage="RequestReceived" ip="172.18.4.154" method="get" user="system:node:ip-172-18-4-154.ec2.internal" groups="\"system:nodes\",\"system:authenticated\"" as="<self>" asgroups="<lookup>" namespace="openshift-template-service-broker" uri="/api/v1/namespaces/openshift-template-service-broker/secrets/apiserver-token-85jvh?resourceVersion=0" response="<deferred>"

Comment 5 openshift-github-bot 2018-10-15 21:59:14 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/68ebf68ac76e43a5a05490d252810b7682329906
Bug 1632155 - Accept logFormat when passed to audit config

Comment 6 ge liu 2018-10-16 08:15:48 UTC
File a new doc bug to trace the doc issue: 
https://bugzilla.redhat.com/show_bug.cgi?id=1639607

Comment 8 errata-xmlrpc 2019-01-10 09:04:01 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:0024