Site Search :
Standard Enterprise XML Methodology Pattern Setting Tunning Other
Article Contributors
GuestBook
Javapattern Maven
XSourceGen Dev
JetSpeed Test
JLook Image
jLook Family Site


Java Security Model Evaluation
 
JDK1.0 °ú JDK1.1 °ú JDK1.2ÀÇ Security Model ºñ±³¿Í java.policy file¿¡ ´ëÇÑ ¼³¸í ( 2003/03/10 ) 151
Written by specular - ÀüÈ«¼º
1 of 1
 

Java Security Model Evaluation


¢º JDK1.0 Security Model - Sandbox Model
  • JVM¿¡ ClassLoader °´Ã¼´Â »ç¿ëµÇ¾îÁö´Â class fileÀ» Memory·Î LoadingÇÏ´Â ÀÛ¾÷À» ÇÑ´Ù.
  • AppletÀ» ½ÇÇà ½ÃÅ°´Â JVMÀº classpath(Browser³»¿¡ ³»ÀåµÈ class Library)¿¡¼­ LoadingÇÑ class¿Í ¿ÜºÎ·Î ºÎÅÍ downloadingÇÑ classÀÇ Naming Space¸¦ ´Ù¸£°Ô °ü¸®¸¦ ÇÑ´Ù.
  • ¿ÜºÎ·Î ºÎÅÍ downloadingµÈ class, Áï Untrusted Code´Â SecurityManager°´Ã¼¿¡ ÀÇÇØ È°µ¿ÀÌ Á¦ÇÑÀÌ µÇ¾î Áø´Ù.
  • JDK1.0 Security ModelÀº Sandbox ModelÀ̶ó°í Çϴµ¥, Untrusted Code¿¡ ´ëÇؼ­´Â Naming Space¸¦ ´Ù¸£°Ô °ü¸® ÇÔÀ¸·Î½á, SecurityManager°´Ã¼¿¡ ÀÇÇØ È°µ¿ÀÌ Á¦ÇѵǴ Sandbox¶ó´Â Boundary ¿µ¿ª³»¿¡¼­¸¸ È°µ¿ÇÏ´Â ±¸Á¶¸¦ ¸»ÇÑ´Ù.

¢º JDK1.1 Security Model - Sandbox Model + Signed Applet
  • JDK1.1 Security ModelÀº 1.0ÀÇ Sandbox Model¿¡ Signed °³³äÀÌ Ãß°¡°¡ µÇ¾ú´Ù.
  • Untrusted Code°¡ Sign¸¸ µÇ¸é, Sandbox boundary¸¦ ¹þ¾î³ª localÀÇ classpath¿¡¼­ loadingµÈ classó·³ È°µ¿ÇÒ ¼ö ÀÖ´Ù. SecurityManager °´Ã¼ÀÇ Á¦ÇÑÀº ¾Ê¹Þ´Â´Ù´Â °ÍÀÌÁö¿ä.
  • Áö±Ý ÇöÀçÀÇ Browser´Â JDK1.1ÀÇ Security ModelÀ» »ç¿ëÇÏ°í ÀÖ´Ù.

    ¢º JDK1.2 Security Model - Sandbox Model + Protection Domain
    • JDK1.2 Security ModelÀº JDK1.1 Security Model(Sandbox + Signed)¿¡ Protection Domain°³³äÀ» Ãß°¡½ÃŲ ±¸Á¶ÀÌ´Ù.
    • 1.1 version¿¡¼­ Signed code´Â 1.2 version¿¡¼­ DomainÀ¸·Î °ü¸®°¡ µÇ°í, °¢ Domainº°·Î Sandbox boundary¸¦ ´Ù¸£°Ô ¼³Á¤ÇÒ ¼ö°¡ ÀÖ¾î, Sandbox boundary°¡ Domainº°·Î °¡º¯ÀûÀ̶ó´Â Ư¼ºÀ» °®°Ô µÈ´Ù.
    • DomainÀº Signer¿Í Codebase¿¡ ÀÇÇØ °áÁ¤ÀÌ µÇ°í, clientÀÇ policy file¿¡ °¢ DomainÀÌ È°µ¿ °¡´ÉÇÑ Sandbox boundary¸¦ ¼³Á¤ÇÏ°Ô²û µÇ¾îÀÖ´Ù.
    • JDK1.2 version¿¡¼­´Â jdk1.2\jre\lib\security\ directory¿¡ java.security fileÀº master security properties fileÀ» Á¦°øÇϴµ¥, ÀÌ°ÍÀº Security¿¡ °ü·ÃµÈ Configuration fileÀÌ´Ù. ÀÌ file³»¿¡ DomainÀÇ È°µ¿ ¿µ¿ªÀ» ¼³Á¤ÇÏ´Â policy fileÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Â ºÎºÐÀÌ ÀÖ´Ù.
      
      	# The default is to have a single system-wide policy file,
      	# and a policy file in the user's home directory.
      	policy.url.1=file:${java.home}/lib/security/java.policy
      	policy.url.2=file:${user.home}/.java.policy
      	# User Policy File
      	policy.url.3=file:/D:/javaLab/signedApplet1.2/MyPrint.jp
      	
      	java.home : jre directory
      	java.policy file : System policy file
      	.java.policy file : user default policy file(c:\windows\ »ý¼º)
      	MyPrint.js file : user define policy file
    • java.policy fileÀº JDK1.2 version, JRE1.2 versionÀ» InstallationÇϸé ~jre/lib/security/ ÀÚµ¿ »ý¼ºµÇ°í, .java.policy fileÀº c:\windows directory¿¡ ÇÊ¿äÇÏ´Ù¸é »ý¼º ÇÒ ¼ö°¡ ÀÖ´Ù.
    • policy fileÀº editor tool·Î ÀÛ¼º°¡´ÉÇÏÁö¸¸, JDK¿¡¼­ Á¦°øÇÏ´Â policytool·Î editÇÏ´Â °ÍÀÌ Æí¸®ÇÏ´Ù. ÀÏ´Ü System policy fileÀÎ java.policy fileÀÇ ³»¿ëÀº ¾Æ·¡¿Í °°´Ù.
      
      // Standard extensions get all permissions by default
      
      grant codeBase "file:${java.home}/lib/ext/-" {
      	permission java.security.AllPermission;
      };
      
      // default permissions granted to all domains
      // ¸ðµç domain¿¡ ´ëÇØ System properties¸¦ read ÇÒ ¼ö ÀÖ´Â permissionÀ» ¼³Á¤ÇÏ°í ÀÖ´Ù.
      grant {
      	// Allows any thread to stop itself using the java.lang.Thread.stop()
      	// method that takes no argument.
      	// Note that this permission is granted by default only to remain
      	// backwards compatible.
      	// It is strongly recommended that you either remove this permission
      	// from this policy file or further restrict it to code sources
      	// that you 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 that can be 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";
      };
      	
    • À§ÀÇ ³»¿ëÀº º¸¸é, jre\lib\ext\ directory¿¡¼­ loadingµÈ class´Â AllPermissionÀ» °®´Â´Ù. Áï SecurityManagerÀÇ Á¦ÇÑÀÌ ¾ø´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù. ±×¸®°í, µÎ¹ø° Ç׸ñÀº ¸ðµç Domain¿¡ ´ëÇØ System.getProperty("java.version") method¸¦ ÅëÇØ System Property¸¦ readÇÒ ¼ö ÀÖ´Â PermissionÀ» ¼³Á¤ÇÑ »çÇ×ÀÌ´Ù.
    • policytoolÀ» ÀÌ¿ëÇØ À§¿Í °°Àº ³»¿ëÀ¸·Î Domainº° Sandbox boundary¸¦ ¼³Á¤ÇÑ fileÀ» »ý¼ºÇÒ ¼ö°¡ ÀÖ°í, ±× fileÀ» JVMÀÌ loadingµÉ¶§ policy file·Î ÀνÄÇÏ°Ô Çϱâ À§ÇØ java.security file¿¡ ¼³Á¤ÇÒ ¼ö°¡ ÀÖ´Ù.

     

    2001.08.03 written by Jeon HongSeong

     
    1
    References
     
    Copyright ¨Ï 2003 www.javapattern.info & www.jlook.com, an jLOOK co.,LTD