#3034 Permission problem during log rotation
Closed: fixed 5 years ago Opened 5 years ago by edewata.

The following error appears in systemd journal briefly after midnight:

Exception in thread "Timer-0" java.security.AccessControlException: access denied ("java.io.FilePermission" "/var/lib/pki/pki-tomcat/logs/ca" "read")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at java.security.AccessController.checkPermission(AccessController.java:884)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
        at java.io.File.exists(File.java:814)
        at java.io.File.mkdirs(File.java:1340)
        at org.apache.juli.FileHandler.openWriter(FileHandler.java:484)
        at org.apache.juli.FileHandler.publish(FileHandler.java:277)
        at java.util.logging.Logger.log(Logger.java:738)
        at org.slf4j.impl.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:582)
        at org.slf4j.impl.JDK14LoggerAdapter.debug(JDK14LoggerAdapter.java:178)
        at com.netscape.cmscore.util.Debug.trace(Debug.java:64)
        at com.netscape.cmscore.util.Debug.trace(Debug.java:108)
        at com.netscape.cmscore.apps.CMSEngine.debug(CMSEngine.java:1506)
        at com.netscape.certsrv.apps.CMS.debug(CMS.java:344)
        at com.netscape.cmscore.session.SessionTimer.run(SessionTimer.java:43)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

The pki.policy already has the following permissions, but apparently it's not sufficient:

grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
        permission java.io.FilePermission "${catalina.base}/logs/pki/-", "read,write";
        permission java.io.FilePermission "${catalina.base}/logs/ca/-", "read,write";
        permission java.io.FilePermission "${catalina.base}/logs/kra/-", "read,write";
        permission java.io.FilePermission "${catalina.base}/logs/ocsp/-", "read,write";
        permission java.io.FilePermission "${catalina.base}/logs/tks/-", "read,write";
        permission java.io.FilePermission "${catalina.base}/logs/tps/-", "read,write";
}

Metadata Update from @mharmsen:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

5 years ago

@edewata can you provide steps to reproduce?

I have not tried this myself, but it probably can be reproduced with these steps:

  • install CA
  • observe the current systemd journal
  • check current time
$ timedatectl
  • disable NTP
$ timedatectl set-ntp false
  • change the system date to the next day
$ timedatectl set-time 2018-8-3
  • execute an operation against the server, e.g.:
$ pki ca-cert-find
  • observe the current systemd journal again
  • reset the NTP
$ timedatectl set-ntp true --adjust-system-clock

Actual result (assuming the above steps work): An AccessControlException appears in systemd journal when the date changes and the server is no longer generating logs.

Expected result: There should be no exception when the date changes and the server should continue to generate logs.

Metadata Update from @dmoluguw:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/3152

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata