lamiastella

catalina.policy

Sep 6th, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.43 KB | None | 0 0
  1. // AUTO-GENERATED FILE from /etc/tomcat7/policy.d/
  2.  
  3. // Licensed to the Apache Software Foundation (ASF) under one or more
  4. // contributor license agreements. See the NOTICE file distributed with
  5. // this work for additional information regarding copyright ownership.
  6. // The ASF licenses this file to You under the Apache License, Version 2.0
  7. // (the "License"); you may not use this file except in compliance with
  8. // the License. You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17.  
  18. // ============================================================================
  19. // catalina.corepolicy - Security Policy Permissions for Tomcat 6
  20. //
  21. // This file contains a default set of security policies to be enforced (by the
  22. // JVM) when Catalina is executed with the "-security" option. In addition
  23. // to the permissions granted here, the following additional permissions are
  24. // granted to the codebase specific to each web application:
  25. //
  26. // * Read access to the document root directory
  27. //
  28. // $Id: catalina.policy 609294 2008-01-06 11:43:46Z markt $
  29. // ============================================================================
  30.  
  31.  
  32. // ========== SYSTEM CODE PERMISSIONS =========================================
  33.  
  34.  
  35. // These permissions apply to javac
  36. grant codeBase "file:${java.home}/lib/-" {
  37. permission java.security.AllPermission;
  38. };
  39.  
  40. // These permissions apply to all shared system extensions
  41. grant codeBase "file:${java.home}/jre/lib/ext/-" {
  42. permission java.security.AllPermission;
  43. };
  44.  
  45. // These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
  46. grant codeBase "file:${java.home}/../lib/-" {
  47. permission java.security.AllPermission;
  48. };
  49.  
  50. // These permissions apply to all shared system extensions when
  51. // ${java.home} points at $JAVA_HOME/jre
  52. grant codeBase "file:${java.home}/lib/ext/-" {
  53. permission java.security.AllPermission;
  54. };
  55. // These permissions apply to all JARs from Debian packages
  56. grant codeBase "file:/usr/share/java/-" {
  57. permission java.security.AllPermission;
  58. };
  59. grant codeBase "file:/usr/share/maven-repo/-" {
  60. permission java.security.AllPermission;
  61. };
  62. grant codeBase "file:/usr/share/ant/lib/-" {
  63. permission java.security.AllPermission;
  64. };
  65. // ========== CATALINA CODE PERMISSIONS =======================================
  66.  
  67.  
  68. // These permissions apply to the logging API
  69. grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
  70. permission java.util.PropertyPermission "java.util.logging.config.class", "read";
  71. permission java.util.PropertyPermission "java.util.logging.config.file", "read";
  72. permission java.lang.RuntimePermission "shutdownHooks";
  73. permission java.io.FilePermission "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
  74. permission java.util.PropertyPermission "catalina.base", "read";
  75. permission java.util.logging.LoggingPermission "control";
  76. permission java.io.FilePermission "${catalina.base}${file.separator}logs", "read, write";
  77. permission java.io.FilePermission "${catalina.base}${file.separator}logs${file.separator}*", "read, write";
  78. permission java.lang.RuntimePermission "getClassLoader";
  79. permission java.lang.RuntimePermission "setContextClassLoader";
  80. // To enable per context logging configuration, permit read access to the appropriate file.
  81. // Be sure that the logging configuration is secure before enabling such access
  82. // eg for the examples web application:
  83. // permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read";
  84. };
  85.  
  86. // These permissions apply to the server startup code
  87. grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
  88. permission java.security.AllPermission;
  89. };
  90.  
  91. // These permissions apply to the servlet API classes
  92. // and those that are shared across all class loaders
  93. // located in the "lib" directory
  94. grant codeBase "file:${catalina.home}/lib/-" {
  95. permission java.security.AllPermission;
  96. };
  97. // ========== WEB APPLICATION PERMISSIONS =====================================
  98.  
  99.  
  100. // These permissions are granted by default to all web applications
  101. // In addition, a web application will be given a read FilePermission
  102. // and JndiPermission for all files and directories in its document root.
  103. grant {
  104. // Required for JNDI lookup of named JDBC DataSource's and
  105. // javamail named MimePart DataSource used to send mail
  106. permission java.util.PropertyPermission "java.home", "read";
  107. permission java.util.PropertyPermission "java.naming.*", "read";
  108. permission java.util.PropertyPermission "javax.sql.*", "read";
  109.  
  110. // OS Specific properties to allow read access
  111. permission java.util.PropertyPermission "os.name", "read";
  112. permission java.util.PropertyPermission "os.version", "read";
  113. permission java.util.PropertyPermission "os.arch", "read";
  114. permission java.util.PropertyPermission "file.separator", "read";
  115. permission java.util.PropertyPermission "path.separator", "read";
  116. permission java.util.PropertyPermission "line.separator", "read";
  117.  
  118. // JVM properties to allow read access
  119. permission java.util.PropertyPermission "java.version", "read";
  120. permission java.util.PropertyPermission "java.vendor", "read";
  121. permission java.util.PropertyPermission "java.vendor.url", "read";
  122. permission java.util.PropertyPermission "java.class.version", "read";
  123. permission java.util.PropertyPermission "java.specification.version", "read";
  124. permission java.util.PropertyPermission "java.specification.vendor", "read";
  125. permission java.util.PropertyPermission "java.specification.name", "read";
  126.  
  127. permission java.util.PropertyPermission "java.vm.specification.version", "read";
  128. permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
  129. permission java.util.PropertyPermission "java.vm.specification.name", "read";
  130. permission java.util.PropertyPermission "java.vm.version", "read";
  131. permission java.util.PropertyPermission "java.vm.vendor", "read";
  132. permission java.util.PropertyPermission "java.vm.name", "read";
  133.  
  134. // Required for OpenJMX
  135. permission java.lang.RuntimePermission "getAttribute";
  136.  
  137. // Allow read of JAXP compliant XML parser debug
  138. permission java.util.PropertyPermission "jaxp.debug", "read";
  139.  
  140. // Precompiled JSPs need access to this package.
  141. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
  142. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
  143.  
  144. // Example JSPs need those to work properly
  145. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el";
  146. permission java.lang.RuntimePermission "accessDeclaredMembers";
  147.  
  148. // Precompiled JSPs need access to this system property.
  149. permission java.util.PropertyPermission "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
  150.  
  151. // java.io.tmpdir should be usable as a temporary file directory
  152. permission java.util.PropertyPermission "java.io.tmpdir", "read";
  153. permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete";
  154.  
  155. };
  156. grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
  157. permission java.io.FilePermission "/usr/share/tomcat7-examples/examples/WEB-INF/classes/logging.properties", "read";
  158. };
  159. // You can assign additional permissions to particular web applications by
  160. // adding additional "grant" entries here, based on the code base for that
  161. // application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
  162. //
  163. // Different permissions can be granted to JSP pages, classes loaded from
  164. // the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
  165. // directory, or even to individual jar files in the /WEB-INF/lib/ directory.
  166. //
  167. // For instance, assume that the standard "examples" application
  168. // included a JDBC driver that needed to establish a network connection to the
  169. // corresponding database and used the scrape taglib to get the weather from
  170. // the NOAA web server. You might create a "grant" entries like this:
  171. //
  172. // The permissions granted to the context root directory apply to JSP pages.
  173. // grant codeBase "file:${catalina.base}/webapps/examples/-" {
  174. // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
  175. // permission java.net.SocketPermission "*.noaa.gov:80", "connect";
  176. // };
  177. //
  178. // The permissions granted to the context WEB-INF/classes directory
  179. // grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
  180. // };
  181. //
  182. // The permission granted to your JDBC driver
  183. // grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
  184. // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
  185. // };
  186. // The permission granted to the scrape taglib
  187. // grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
  188. // permission java.net.SocketPermission "*.noaa.gov:80", "connect";
  189. // };
Advertisement
Add Comment
Please, Sign In to add comment