Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-2756

Elytron Audit Logging's rotating-file-audit-log throws IllegalArgumentException if suffix property is not specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 3.0.0.Beta27
    • None
    • Security
    • None

      rotating-file-audit throws IllegalArgumentException if user tries to add a new rotating-audit-file and does not specify suffix property.

      Steps to reproduce: /subsystem=elytron/rotating-file-audit-log=rotating-audit:add(path=rotating-audit.log)

      Following output is given in jboss-cli

      {
          "outcome" => "failed",
          "failure-description" => {"WFLYCTL0080: Failed services" => {"org.wildfly.security.security-event-listener.rotating-audit" => "Failed to start service
          Caused by: java.lang.IllegalArgumentException: Illegal pattern character 'n'"}},
          "rolled-back" => true
      }
      

      and following one in server log:

      12:45:41,381 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service org.wildfly.security.security-event-listener.rotating-audit: org.jboss.msc.service.StartException in service org.wildfly.security.security-event-listener.rotating-audit: Failed to start service
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1978)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.IllegalArgumentException: Illegal pattern character 'n'
      	at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:826)
      	at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:634)
      	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:605)
      	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:580)
      	at org.wildfly.security.audit.RotatingFileAuditEndpoint$Builder.setSuffix(RotatingFileAuditEndpoint.java:289)
      	at org.wildfly.extension.elytron.AuditResourceDefinitions$2.lambda$getValueSupplier$2(AuditResourceDefinitions.java:235)
      	at org.wildfly.extension.elytron.TrivialService.start(TrivialService.java:53)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
      	... 3 more
      
      12:45:41,382 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 5) WFLYCTL0013: Operation ("add") failed - address: ([
          ("subsystem" => "elytron"),
          ("rotating-file-audit-log" => "rotating-audit")
      ]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.security.security-event-listener.rotating-audit" => "Failed to start service
          Caused by: java.lang.IllegalArgumentException: Illegal pattern character 'n'"}}
      

      Note: there is an easy workaround - if user specifies suffix property then adding a new rotating-audit-file works fine, e.g. /subsystem=elytron/rotating-file-audit-log=rotating-audit:add(path=rotating-audit.log,suffix=y-M-d) passes successfully.

              yborgess1@redhat.com Yeray Borges Santana
              jtymel Jan Tymel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: