We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I would like to collect the audit log in JSON format.
I override the logback.xml file for access component :
SECURITY_AUDIT
SecurityAuditJsonLayout
SECURITY_AUDIT_CONSOLE_JSON
<appender name="SECURITY_AUDIT_FILE_JSON" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${log.dir}/access-security-audit-json.log</File> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.jfrog.access.server.logging.layout.security.audit.SecurityAuditJsonLayout"> </layout> </encoder> <rollingPolicy class="org.jfrog.common.logging.logback.rolling.FixedWindowWithDateRollingPolicy"> <FileNamePattern>${log.dir.archived}/access-security-audit-json.%i.log.gz</FileNamePattern> <compressLatest>false</compressLatest> </rollingPolicy> <triggeringPolicy class="org.jfrog.common.logging.logback.triggering.SizeAndIntervalTriggeringPolicy"> <MaxFileSize>25MB</MaxFileSize> </triggeringPolicy> </appender>
<logger name="org.jfrog.access.server.audit.security.AuditLogger" additivity="false"> <level value="info"/> <appender-ref ref="SECURITY_AUDIT"/> <appender-ref ref="SECURITY_AUDIT_CONSOLE_JSON"/> <appender-ref ref="SECURITY_AUDIT_FILE_JSON"/> </logger>
Update the chart values :
artifactory: configMaps: | access-logback.xml: | <!-- PUT THE LOGBACK CONFIG--> copyOnEveryStartup: - source: /artifactory-configmaps/access-logback.xml target: etc/access/logback.xml customVolumeMounts: | - name: artifactory-configmaps mountPath: "/artifactory-configmaps" loggers: - access-security-audit-json.log
The log output :
2024-11-05T10:39:20.906Z|06de291b1c5617a9|UNKNOWN|UNKNOWN|jfob@01jate6qne9tmj17b9hs3902rx|jfob@01jate6qne9tmj17b9hs3902rx|C|TKN|{"added":{"owner":"jfob@01jate6qne9tmj17b9hs3902rx","created":"1730803160904","expirationTime":"1730803280904","subject":"jfob@01jate6qne9tmj17b9hs3902rx","scope":"internal:usage:w","id":"9b546fe2-c699-467f-9610-c11c7c4ad7e9","type":"generic"}}
{"log_name":"access-security-audit.log","audit":{"datetime":"2024-11-05T10:30:35.208Z","traceid":"6dc659d0783fe422:56ffe1823a7f9f95:1b993c82822a49ad:0","performinguserip":"UNKNOWN","performinguser":"UNKNOWN","loggedinprincipal":"jfob@01jate6qne9tmj17b9hs3902rx","entityname":"jfob@01jate6qne9tmj17b9hs3902rx","securityeventtype":"C","securityevent":"TKN","datachanged":"{\"added\":{\"owner\":\"jfob@01jate6qne9tmj17b9hs3902rx\",\"created\":\"1730802635207\",\"expirationTime\":\"1730802755207\",\"subject\":\"jfob@01jate6qne9tmj17b9hs3902rx\",\"scope\":\"internal:usage:w\",\"id\":\"ddd9dcbc-82df-4bf0-a461-39e7f7764c41\",\"type\":\"generic\"}}"}}
The problem is with the field datachanged that is already in JSON format before serialization.
datachanged
Do you have any solution ?
Thank you.
Guillaume
The text was updated successfully, but these errors were encountered:
Finally I create the JSON format with the default encoder :
encoder
<appender name="SECURITY_AUDIT_FILE_JSON" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${log.dir}/access-security-audit-json.log</File> <encoder> <pattern>{"datetime":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS,UTC}Z","traceid":"%formattedCustomUberTraceId","userip":"%X{audit.performingUserIp}","user":"%X{audit.performingUser}","loggedprincipal":"%X{audit.loggedinPrincipal}","entityname":"%X{audit.entityName}","eventtype":"%X{audit.securityEventType}","event":"%X{audit.securityEvent}","datachanged":%X{audit.dataChanged}}%n</pattern> </encoder> <rollingPolicy class="org.jfrog.common.logging.logback.rolling.FixedWindowWithDateRollingPolicy"> <FileNamePattern>${log.dir.archived}/access-security-audit-json.%i.log.gz</FileNamePattern> <compressLatest>false</compressLatest> </rollingPolicy> <triggeringPolicy class="org.jfrog.common.logging.logback.triggering.SizeAndIntervalTriggeringPolicy"> <MaxFileSize>25MB</MaxFileSize> </triggeringPolicy> </appender>
But I think we could have a better solution with SecurityAuditJsonLayout.
Sorry, something went wrong.
No branches or pull requests
Hello,
I would like to collect the audit log in JSON format.
I override the logback.xml file for access component :
SECURITY_AUDIT
appender and set theSecurityAuditJsonLayout
layout used bySECURITY_AUDIT_CONSOLE_JSON
appender :Update the chart values :
The log output :
The problem is with the field
datachanged
that is already in JSON format before serialization.Do you have any solution ?
Thank you.
Guillaume
The text was updated successfully, but these errors were encountered: