Java.policy file

Source: Internet
Author: User

Java security policy File the English meaning of policy policy

This file is primarily about setting permissions for Java programs (mainly Apple applets: such as printing, etc.)

The security policy for the Java application environment, which details the license for different resources owned by different code, is expressed by a policy object. In order for an applet (or an application running under SecurityManager) to perform protected behavior, such as reading and writing files, applets (or Java applications) must be licensed for that operation, and security policy files are used to implement these licenses.


Standard extensions get all permissions by default

Grant CodeBase "file:${{java.ext.dirs}}/*" {
Permission java.security.AllPermission;
};

Default permissions granted to all domains

Grant {
Allows any thread to stop itself using the Java.lang.Thread.stop ()
Method that takes no argument.
Note that this permission are granted by default only to remain
Backwards compatible.
It is strongly recommended so either remove this permission
From the policy file or further restrict it to code sources
That's specify, because Thread.stop () is potentially unsafe.
See "Http://java.sun.com/notes" for more information.
Permission Java.lang.RuntimePermission "Stopthread";

Allows anyone to listen on un-privileged ports
Permission Java.net.SocketPermission "localhost:1024-", "Listen";

"Standard" properies the can is read by anyone

Permission Java.util.PropertyPermission "Java.version", "read";
Permission Java.util.PropertyPermission "Java.vendor", "read";
Permission Java.util.PropertyPermission "Java.vendor.url", "read";
Permission Java.util.PropertyPermission "Java.class.version", "read";
Permission Java.util.PropertyPermission "Os.name", "read";
Permission Java.util.PropertyPermission "Os.version", "read";
Permission Java.util.PropertyPermission "Os.arch", "read";
Permission Java.util.PropertyPermission "File.separator", "read";
Permission Java.util.PropertyPermission "Path.separator", "read";
Permission Java.util.PropertyPermission "Line.separator", "read";

Permission Java.util.PropertyPermission "Java.specification.version", "read";
Permission Java.util.PropertyPermission "Java.specification.vendor", "read";
Permission Java.util.PropertyPermission "Java.specification.name", "read";

Permission Java.util.PropertyPermission "Java.vm.specification.version", "read";
Permission Java.util.PropertyPermission "Java.vm.specification.vendor", "read";
Permission Java.util.PropertyPermission "Java.vm.specification.name", "read";
Permission Java.util.PropertyPermission "Java.vm.version", "read";
Permission Java.util.PropertyPermission "Java.vm.vendor", "read";
Permission Java.util.PropertyPermission "Java.vm.name", "read";
Permission java.security.AllPermission;

};

The file defines the default permissions for the Java program, and the first grant defines all classes and jars under the System Properties ${{java.ext.dirs}} path (/* indicates all classes and jars, if only/represents all classes but does not include jars) Have all operation Rights (java.security.AllPermission), java.ext.dirs corresponding path is%java_home%/jre/lib/ext directory, The second grant later defines the permissions that all Java programs have, including stopping the thread, starting the socket server, and reading some system properties

Java.policy file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.