Class SecurityListener
java.lang.Object
org.apache.catalina.security.SecurityListener
- All Implemented Interfaces:
LifecycleListener
This listener must only be nested within
Server
elements.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
protected void
doChecks()
Execute the security checks.int
Gets the number of days that may pass between the build-date of this Tomcat instance before warnings are printed.Returns the current list of operating system users not permitted to run Tomcat.Get the minimum umask that must be configured before Tomcat will start.void
lifecycleEvent
(LifecycleEvent event) Acknowledge the occurrence of the specified event.void
setBuildDateWarningAgeDays
(String ageDays) Sets the number of days that may pass between the build-date of this Tomcat instance before warnings are printed.void
setCheckedOsUsers
(String userNameList) Set the list of operating system users not permitted to run Tomcat.void
setMinimumUmask
(String umask) Set the minimum umask that must be configured before Tomcat will start.
-
Constructor Details
-
SecurityListener
public SecurityListener()
-
-
Method Details
-
lifecycleEvent
Description copied from interface:LifecycleListener
Acknowledge the occurrence of the specified event.- Specified by:
lifecycleEvent
in interfaceLifecycleListener
- Parameters:
event
- LifecycleEvent that has occurred
-
setCheckedOsUsers
Set the list of operating system users not permitted to run Tomcat. By default, only root is prevented from running Tomcat. Calling this method with null or the empty string will clear the list of users and effectively disables this check. User names will always be checked in a case insensitive manner using the system default Locale.- Parameters:
userNameList
- A comma separated list of operating system users not permitted to run Tomcat
-
getCheckedOsUsers
Returns the current list of operating system users not permitted to run Tomcat.- Returns:
- A comma separated list of operating system user names.
-
setMinimumUmask
Set the minimum umask that must be configured before Tomcat will start.- Parameters:
umask
- The 4-digit umask as returned by the OS command umask
-
getMinimumUmask
Get the minimum umask that must be configured before Tomcat will start.- Returns:
- The 4-digit umask as used by the OS command umask
-
setBuildDateWarningAgeDays
Sets the number of days that may pass between the build-date of this Tomcat instance before warnings are printed.- Parameters:
ageDays
- The number of days a Tomcat build is allowed to age before logging warnings.
-
getBuildDateWarningAgeDays
public int getBuildDateWarningAgeDays()Gets the number of days that may pass between the build-date of this Tomcat instance before warnings are printed.- Returns:
- The number of days a Tomcat build is allowed to age before logging warnings.
-
doChecks
protected void doChecks()Execute the security checks. Each check should be in a separate method. -
checkOsUser
protected void checkOsUser() -
checkUmask
protected void checkUmask() -
checkServerBuildAge
protected void checkServerBuildAge()
-