2015-02-25 11:23:44 -05:00
|
|
|
/*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership.
|
|
|
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
* (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2019-12-24 09:30:31 -05:00
|
|
|
// Policy file for solr. Please keep minimal and avoid wildcards.
|
2015-02-25 11:23:44 -05:00
|
|
|
|
2019-12-24 09:30:31 -05:00
|
|
|
// permissions needed for tests to pass, based on properties set by the build system
|
|
|
|
// NOTE: if the property is not set, the permission entry is ignored.
|
2015-02-25 11:23:44 -05:00
|
|
|
grant {
|
2019-12-04 23:16:19 -05:00
|
|
|
// contain read access to only what we need:
|
|
|
|
// 3rd party jar resources (where symlinks are not supported), test-files/ resources
|
|
|
|
permission java.io.FilePermission "${common.dir}${/}-", "read";
|
2019-12-07 00:47:52 -05:00
|
|
|
permission java.io.FilePermission "${common.dir}${/}..${/}solr${/}-", "read";
|
2019-12-04 23:16:19 -05:00
|
|
|
// 3rd party jar resources (where symlinks are supported)
|
|
|
|
permission java.io.FilePermission "${user.home}${/}.ivy2${/}cache${/}-", "read";
|
|
|
|
// system jar resources
|
|
|
|
permission java.io.FilePermission "${java.home}${/}-", "read";
|
2019-12-02 05:36:29 -05:00
|
|
|
permission java.io.FilePermission "${junit4.childvm.cwd}", "read";
|
|
|
|
permission java.io.FilePermission "${junit4.childvm.cwd}${/}temp", "read,write,delete";
|
|
|
|
permission java.io.FilePermission "${junit4.childvm.cwd}${/}temp${/}-", "read,write,delete";
|
2015-04-09 07:47:57 -04:00
|
|
|
permission java.io.FilePermission "${junit4.childvm.cwd}${/}jacoco.db", "write";
|
2019-12-02 05:36:29 -05:00
|
|
|
permission java.io.FilePermission "${junit4.tempDir}${/}*", "read,write,delete";
|
|
|
|
permission java.io.FilePermission "${clover.db.dir}${/}-", "read,write,delete";
|
2016-08-21 14:48:42 -04:00
|
|
|
permission java.io.FilePermission "${tests.linedocsfile}", "read";
|
2019-12-04 23:16:19 -05:00
|
|
|
// DirectoryFactoryTest messes with these (wtf?)
|
|
|
|
permission java.io.FilePermission "/tmp/inst1/conf/solrcore.properties", "read";
|
|
|
|
permission java.io.FilePermission "/path/to/myinst/conf/solrcore.properties", "read";
|
|
|
|
// TestConfigSets messes with these (wtf?)
|
|
|
|
permission java.io.FilePermission "/path/to/solr/home/lib", "read";
|
|
|
|
|
2018-03-15 10:01:15 -04:00
|
|
|
permission java.nio.file.LinkPermission "hard";
|
2015-02-25 11:23:44 -05:00
|
|
|
|
2019-12-11 12:51:45 -05:00
|
|
|
// all possibilities of accepting/binding/connections on localhost with ports >=1024:
|
|
|
|
permission java.net.SocketPermission "localhost:1024-", "accept,listen,connect,resolve";
|
|
|
|
permission java.net.SocketPermission "127.0.0.1:1024-", "accept,listen,connect,resolve";
|
|
|
|
permission java.net.SocketPermission "[::1]:1024-", "accept,listen,connect,resolve";
|
|
|
|
// "dead hosts", we try to keep it fast
|
|
|
|
permission java.net.SocketPermission "[::1]:4", "connect,resolve";
|
|
|
|
permission java.net.SocketPermission "[::1]:6", "connect,resolve";
|
|
|
|
permission java.net.SocketPermission "[::1]:8", "connect,resolve";
|
2015-02-25 11:23:44 -05:00
|
|
|
|
|
|
|
// Basic permissions needed for Lucene to work:
|
|
|
|
permission java.util.PropertyPermission "*", "read,write";
|
2019-12-02 20:34:01 -05:00
|
|
|
|
|
|
|
// needed by gson serialization of junit4 runner: TODO clean that up
|
|
|
|
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
|
|
|
|
permission java.lang.RuntimePermission "accessDeclaredMembers";
|
|
|
|
// needed by junit4 runner to capture sysout/syserr:
|
|
|
|
permission java.lang.RuntimePermission "setIO";
|
|
|
|
// needed by randomized runner to catch failures from other threads:
|
|
|
|
permission java.lang.RuntimePermission "setDefaultUncaughtExceptionHandler";
|
|
|
|
// needed by randomized runner getTopThreadGroup:
|
|
|
|
permission java.lang.RuntimePermission "modifyThreadGroup";
|
|
|
|
// needed by tests e.g. shutting down executors:
|
|
|
|
permission java.lang.RuntimePermission "modifyThread";
|
|
|
|
// needed for tons of test hacks etc
|
|
|
|
permission java.lang.RuntimePermission "getStackTrace";
|
|
|
|
// needed for mock filesystems in tests
|
|
|
|
permission java.lang.RuntimePermission "fileSystemProvider";
|
|
|
|
// needed for test of IOUtils.spins (maybe it can be avoided)
|
|
|
|
permission java.lang.RuntimePermission "getFileStoreAttributes";
|
|
|
|
// analyzers/uima: needed by lucene expressions' JavascriptCompiler
|
|
|
|
permission java.lang.RuntimePermission "createClassLoader";
|
|
|
|
// needed to test unmap hack on platforms that support it
|
|
|
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
|
|
|
|
// needed by jacoco to dump coverage
|
|
|
|
permission java.lang.RuntimePermission "shutdownHooks";
|
|
|
|
// needed by org.apache.logging.log4j
|
|
|
|
permission java.lang.RuntimePermission "getenv.*";
|
|
|
|
permission java.lang.RuntimePermission "getClassLoader";
|
|
|
|
permission java.lang.RuntimePermission "setContextClassLoader";
|
|
|
|
permission java.lang.RuntimePermission "getStackWalkerWithClassReference";
|
|
|
|
// needed by bytebuddy
|
|
|
|
permission java.lang.RuntimePermission "defineClass";
|
|
|
|
// needed by mockito
|
|
|
|
permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
|
|
|
|
permission java.lang.RuntimePermission "reflectionFactoryAccess";
|
|
|
|
// needed by SolrResourceLoader
|
|
|
|
permission java.lang.RuntimePermission "closeClassLoader";
|
|
|
|
// needed by HttpSolrClient
|
|
|
|
permission java.lang.RuntimePermission "getFileSystemAttributes";
|
|
|
|
// needed by hadoop auth (TODO: there is a cleaner way to handle this)
|
|
|
|
permission java.lang.RuntimePermission "loadLibrary.jaas";
|
2019-12-03 23:12:27 -05:00
|
|
|
permission java.lang.RuntimePermission "loadLibrary.jaas_unix";
|
|
|
|
permission java.lang.RuntimePermission "loadLibrary.jaas_nt";
|
2019-12-07 20:03:25 -05:00
|
|
|
// needed by hadoop common RawLocalFileSystem for java nio getOwner
|
|
|
|
permission java.lang.RuntimePermission "accessUserInformation";
|
2019-12-02 20:34:01 -05:00
|
|
|
// needed by hadoop hdfs
|
|
|
|
permission java.lang.RuntimePermission "readFileDescriptor";
|
|
|
|
permission java.lang.RuntimePermission "writeFileDescriptor";
|
|
|
|
// needed by hadoop http
|
|
|
|
permission java.lang.RuntimePermission "getProtectionDomain";
|
2015-02-25 11:23:44 -05:00
|
|
|
|
|
|
|
// These two *have* to be spelled out a separate
|
|
|
|
permission java.lang.management.ManagementPermission "control";
|
|
|
|
permission java.lang.management.ManagementPermission "monitor";
|
|
|
|
|
2019-12-02 20:34:01 -05:00
|
|
|
// needed by hadoop htrace
|
|
|
|
permission java.net.NetPermission "getNetworkInformation";
|
|
|
|
|
|
|
|
// needed by DIH
|
|
|
|
permission java.sql.SQLPermission "deregisterDriver";
|
|
|
|
|
2015-02-25 11:23:44 -05:00
|
|
|
permission java.util.logging.LoggingPermission "control";
|
2019-12-02 20:34:01 -05:00
|
|
|
|
|
|
|
// needed by solr mbeans feature/tests
|
|
|
|
// TODO: can we remove wildcard for class names/members?
|
|
|
|
permission javax.management.MBeanPermission "*", "getAttribute";
|
|
|
|
permission javax.management.MBeanPermission "*", "getMBeanInfo";
|
|
|
|
permission javax.management.MBeanPermission "*", "queryMBeans";
|
|
|
|
permission javax.management.MBeanPermission "*", "queryNames";
|
|
|
|
permission javax.management.MBeanPermission "*", "registerMBean";
|
|
|
|
permission javax.management.MBeanPermission "*", "unregisterMBean";
|
|
|
|
permission javax.management.MBeanServerPermission "createMBeanServer";
|
|
|
|
permission javax.management.MBeanServerPermission "findMBeanServer";
|
|
|
|
permission javax.management.MBeanServerPermission "releaseMBeanServer";
|
|
|
|
permission javax.management.MBeanTrustPermission "register";
|
|
|
|
|
|
|
|
// needed by hadoop auth
|
|
|
|
permission javax.security.auth.AuthPermission "getSubject";
|
|
|
|
permission javax.security.auth.AuthPermission "modifyPrincipals";
|
|
|
|
permission javax.security.auth.AuthPermission "doAs";
|
|
|
|
permission javax.security.auth.AuthPermission "getLoginConfiguration";
|
|
|
|
permission javax.security.auth.AuthPermission "setLoginConfiguration";
|
|
|
|
permission javax.security.auth.AuthPermission "modifyPrivateCredentials";
|
2019-12-06 09:49:07 -05:00
|
|
|
permission javax.security.auth.AuthPermission "modifyPublicCredentials";
|
2015-02-25 11:23:44 -05:00
|
|
|
permission javax.security.auth.PrivateCredentialPermission "org.apache.hadoop.security.Credentials * \"*\"", "read";
|
2019-12-02 20:34:01 -05:00
|
|
|
|
|
|
|
// needed by hadoop security
|
|
|
|
permission java.security.SecurityPermission "putProviderProperty.SaslPlainServer";
|
|
|
|
permission java.security.SecurityPermission "insertProvider";
|
|
|
|
|
2015-02-25 11:23:44 -05:00
|
|
|
permission javax.xml.bind.JAXBPermission "setDatatypeConverter";
|
|
|
|
|
|
|
|
// SSL related properties for Solr tests
|
2019-12-02 20:34:01 -05:00
|
|
|
permission javax.net.ssl.SSLPermission "setDefaultSSLContext";
|
2015-02-25 11:23:44 -05:00
|
|
|
|
|
|
|
// SASL/Kerberos related properties for Solr tests
|
|
|
|
permission javax.security.auth.PrivateCredentialPermission "javax.security.auth.kerberos.KerberosTicket * \"*\"", "read";
|
|
|
|
|
|
|
|
// may only be necessary with Java 7?
|
|
|
|
permission javax.security.auth.PrivateCredentialPermission "javax.security.auth.kerberos.KeyTab * \"*\"", "read";
|
|
|
|
permission javax.security.auth.PrivateCredentialPermission "sun.security.jgss.krb5.Krb5Util$KeysFromKeyTab * \"*\"", "read";
|
|
|
|
|
2018-12-10 10:38:01 -05:00
|
|
|
permission javax.security.auth.kerberos.ServicePermission "*", "initiate";
|
|
|
|
permission javax.security.auth.kerberos.ServicePermission "*", "accept";
|
|
|
|
permission javax.security.auth.kerberos.DelegationPermission "\"*\" \"krbtgt/EXAMPLE.COM@EXAMPLE.COM\"";
|
2018-11-29 12:58:18 -05:00
|
|
|
|
|
|
|
// java 8 accessibility requires this perm - should not after 8 I believe (rrd4j is the root reason we hit an accessibility code path)
|
2018-12-10 10:38:01 -05:00
|
|
|
permission java.awt.AWTPermission "*";
|
2015-05-22 02:26:10 -04:00
|
|
|
|
2019-12-05 01:06:38 -05:00
|
|
|
// used by solr to create sandboxes (e.g. script execution)
|
|
|
|
permission java.security.SecurityPermission "createAccessControlContext";
|
2015-02-25 11:23:44 -05:00
|
|
|
};
|
2019-12-24 09:30:31 -05:00
|
|
|
|
|
|
|
// additional permissions based on system properties set by /bin/solr
|
|
|
|
// NOTE: if the property is not set, the permission entry is ignored.
|
|
|
|
grant {
|
|
|
|
permission java.io.FilePermission "${hadoop.security.credential.provider.path}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${hadoop.security.credential.provider.path}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.jetty.keystore}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.jetty.keystore}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.jetty.truststore}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.jetty.truststore}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.install.dir}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.install.dir}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${jetty.home}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${jetty.home}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.solr.home}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.solr.home}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.data.home}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.data.home}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.default.confdir}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.default.confdir}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${solr.log.dir}", "read,write,delete,readlink";
|
|
|
|
permission java.io.FilePermission "${solr.log.dir}${/}-", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
permission java.io.FilePermission "${log4j.configurationFile}", "read,write,delete,readlink";
|
|
|
|
|
|
|
|
// expanded to a wildcard if set, allows all networking everywhere
|
|
|
|
permission java.net.SocketPermission "${solr.internal.network.permission}", "accept,listen,connect,resolve";
|
|
|
|
};
|