Search in sources :

Example 1 with SSLPermission

use of javax.net.ssl.SSLPermission in project ignite by apache.

the class SecuritySubjectPermissionsTest method beforeTestsStarted.

/**
 * {@inheritDoc}
 */
@Override
protected void beforeTestsStarted() throws Exception {
    if (System.getSecurityManager() == null) {
        Policy.setPolicy(new Policy() {

            @Override
            public PermissionCollection getPermissions(CodeSource cs) {
                Permissions res = new Permissions();
                res.add(new RuntimePermission("*"));
                res.add(new MBeanServerPermission("*"));
                res.add(new MBeanPermission("*", "*"));
                res.add(new MBeanTrustPermission("*"));
                res.add(new ReflectPermission("*"));
                res.add(new SSLPermission("*"));
                res.add(new ManagementPermission("monitor"));
                res.add(new ManagementPermission("control"));
                res.add(new SerializablePermission("*"));
                res.add(new SecurityPermission("*"));
                res.add(new SocketPermission("*", "connect,accept,listen,resolve"));
                res.add(new FilePermission("<<ALL FILES>>", "read,write,delete,execute,readlink"));
                res.add(new PropertyPermission("*", "read,write"));
                res.add(new TestPermission("common"));
                return res;
            }
        });
        System.setSecurityManager(new SecurityManager());
        setupSM = true;
    }
}
Also used : Policy(java.security.Policy) PermissionCollection(java.security.PermissionCollection) PropertyPermission(java.util.PropertyPermission) MBeanPermission(javax.management.MBeanPermission) SocketPermission(java.net.SocketPermission) ManagementPermission(java.lang.management.ManagementPermission) SSLPermission(javax.net.ssl.SSLPermission) CodeSource(java.security.CodeSource) FilePermission(java.io.FilePermission) MBeanServerPermission(javax.management.MBeanServerPermission) MBeanTrustPermission(javax.management.MBeanTrustPermission) Permissions(java.security.Permissions) ReflectPermission(java.lang.reflect.ReflectPermission) SerializablePermission(java.io.SerializablePermission) SecurityPermission(java.security.SecurityPermission)

Aggregations

FilePermission (java.io.FilePermission)1 SerializablePermission (java.io.SerializablePermission)1 ManagementPermission (java.lang.management.ManagementPermission)1 ReflectPermission (java.lang.reflect.ReflectPermission)1 SocketPermission (java.net.SocketPermission)1 CodeSource (java.security.CodeSource)1 PermissionCollection (java.security.PermissionCollection)1 Permissions (java.security.Permissions)1 Policy (java.security.Policy)1 SecurityPermission (java.security.SecurityPermission)1 PropertyPermission (java.util.PropertyPermission)1 MBeanPermission (javax.management.MBeanPermission)1 MBeanServerPermission (javax.management.MBeanServerPermission)1 MBeanTrustPermission (javax.management.MBeanTrustPermission)1 SSLPermission (javax.net.ssl.SSLPermission)1