catalina.policy 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. // ============================================================================
  2. // catalina.corepolicy - Security Policy Permissions for Tomcat 5
  3. //
  4. // This file contains a default set of security policies to be enforced (by the
  5. // JVM) when Catalina is executed with the "-security" option. In addition
  6. // to the permissions granted here, the following additional permissions are
  7. // granted to the codebase specific to each web application:
  8. //
  9. // * Read access to the document root directory
  10. //
  11. // $Id: catalina.policy 483089 2006-12-06 14:25:11Z remm $
  12. // ============================================================================
  13. // ========== SYSTEM CODE PERMISSIONS =========================================
  14. // These permissions apply to javac
  15. grant codeBase "file:${java.home}/lib/-" {
  16. permission java.security.AllPermission;
  17. };
  18. // These permissions apply to all shared system extensions
  19. grant codeBase "file:${java.home}/jre/lib/ext/-" {
  20. permission java.security.AllPermission;
  21. };
  22. // These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
  23. grant codeBase "file:${java.home}/../lib/-" {
  24. permission java.security.AllPermission;
  25. };
  26. // These permissions apply to all shared system extensions when
  27. // ${java.home} points at $JAVA_HOME/jre
  28. grant codeBase "file:${java.home}/lib/ext/-" {
  29. permission java.security.AllPermission;
  30. };
  31. // ========== CATALINA CODE PERMISSIONS =======================================
  32. // These permissions apply to the daemon code
  33. grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
  34. permission java.security.AllPermission;
  35. };
  36. // These permissions apply to the logging API
  37. grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
  38. permission java.security.AllPermission;
  39. };
  40. // These permissions apply to the server startup code
  41. grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
  42. permission java.security.AllPermission;
  43. };
  44. // These permissions apply to the servlet API classes
  45. // and those that are shared across all class loaders
  46. // located in the "lib" directory
  47. grant codeBase "file:${catalina.home}/lib/-" {
  48. permission java.security.AllPermission;
  49. };
  50. // ========== WEB APPLICATION PERMISSIONS =====================================
  51. // These permissions are granted by default to all web applications
  52. // In addition, a web application will be given a read FilePermission
  53. // and JndiPermission for all files and directories in its document root.
  54. grant {
  55. // Required for JNDI lookup of named JDBC DataSource's and
  56. // javamail named MimePart DataSource used to send mail
  57. permission java.util.PropertyPermission "java.home", "read";
  58. permission java.util.PropertyPermission "java.naming.*", "read";
  59. permission java.util.PropertyPermission "javax.sql.*", "read";
  60. // OS Specific properties to allow read access
  61. permission java.util.PropertyPermission "os.name", "read";
  62. permission java.util.PropertyPermission "os.version", "read";
  63. permission java.util.PropertyPermission "os.arch", "read";
  64. permission java.util.PropertyPermission "file.separator", "read";
  65. permission java.util.PropertyPermission "path.separator", "read";
  66. permission java.util.PropertyPermission "line.separator", "read";
  67. // JVM properties to allow read access
  68. permission java.util.PropertyPermission "java.version", "read";
  69. permission java.util.PropertyPermission "java.vendor", "read";
  70. permission java.util.PropertyPermission "java.vendor.url", "read";
  71. permission java.util.PropertyPermission "java.class.version", "read";
  72. permission java.util.PropertyPermission "java.specification.version", "read";
  73. permission java.util.PropertyPermission "java.specification.vendor", "read";
  74. permission java.util.PropertyPermission "java.specification.name", "read";
  75. permission java.util.PropertyPermission "java.vm.specification.version", "read";
  76. permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
  77. permission java.util.PropertyPermission "java.vm.specification.name", "read";
  78. permission java.util.PropertyPermission "java.vm.version", "read";
  79. permission java.util.PropertyPermission "java.vm.vendor", "read";
  80. permission java.util.PropertyPermission "java.vm.name", "read";
  81. // Required for OpenJMX
  82. permission java.lang.RuntimePermission "getAttribute";
  83. // Allow read of JAXP compliant XML parser debug
  84. permission java.util.PropertyPermission "jaxp.debug", "read";
  85. // Precompiled JSPs need access to this package.
  86. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
  87. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
  88. };
  89. // You can assign additional permissions to particular web applications by
  90. // adding additional "grant" entries here, based on the code base for that
  91. // application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
  92. //
  93. // Different permissions can be granted to JSP pages, classes loaded from
  94. // the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
  95. // directory, or even to individual jar files in the /WEB-INF/lib/ directory.
  96. //
  97. // For instance, assume that the standard "examples" application
  98. // included a JDBC driver that needed to establish a network connection to the
  99. // corresponding database and used the scrape taglib to get the weather from
  100. // the NOAA web server. You might create a "grant" entries like this:
  101. //
  102. // The permissions granted to the context root directory apply to JSP pages.
  103. // grant codeBase "file:${catalina.home}/webapps/examples/-" {
  104. // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
  105. // permission java.net.SocketPermission "*.noaa.gov:80", "connect";
  106. // };
  107. //
  108. // The permissions granted to the context WEB-INF/classes directory
  109. // grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
  110. // };
  111. //
  112. // The permission granted to your JDBC driver
  113. // grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
  114. // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
  115. // };
  116. // The permission granted to the scrape taglib
  117. // grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
  118. // permission java.net.SocketPermission "*.noaa.gov:80", "connect";
  119. // };