Chapter 14: Tomcat Security This security architecture is

Chapter 14: Tomcat Security This security architecture is turned off by default, but it can be turned on at any time. In this section, we review the Security Manager architecture in general terms. This is followed by a discussion of how this architecture specifically applies to Tomcat. Overview of the Security Manager As with the file system, the Security Manager architecture is based on the concept of permissions. Once the Security Manager is turned on (using a command-line switch that will be discussed shortly), applications must have explicit permission to perform certain security-sensitive tasks (such as creating a custom class loader or opening a network socket). To make effective use of the Security Manager architecture, it is therefore necessary to know how to grant permissions to applications and to understand the set of possible permissions. Granting Permissions to Applications Policy files are the mechanism used by the Security Manager to grant permissions to applications. Policy files are simple text files composed of individual actions that applications are allowed to perform. Note that the term applications in this context refers to applications running in the Java VM, of which the Tomcat server is a member. This is not referring to the Web applications that run within a Tomcat server instance. A policy file is composed of grantentries, which look like the following: // first grant entry grant { permission java.lang.RuntimePermission stopThread ; } // second grant entry grant codeBase file:${java.home}/lib/ext/* { permission java.security.AllPermission; }; The first grantentry in this example demonstrates the simplicity of the syntax. It grants all applications the capability to access the deprecated Thread.stop()method. The second grantentry illustrates that code in specific locations can also be granted permissions. This is, of course, useful for extending permissions to certain trusted code while denying permissions to all other code. In this case, all code in the $JAVA_HOME/lib/ext directory is granted all permissions, which effectively disables the Security Manager architecture for that code. Grant Entry Syntax Each grantentry must be composed of the following syntax: grant codeBase URL { // this is a comment permission permission_class_name target_name , action ; … };

If you looking for unlimited one inclusive web hosting plan please check cheap web hosting website.

Comments are closed.