<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Security policy permissions for Grails in Tomcat</title>
	<atom:link href="http://haxx.sinequanon.net/2009/06/security-policy/feed/" rel="self" type="application/rss+xml" />
	<link>http://haxx.sinequanon.net/2009/06/security-policy/</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 18:42:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: jja</title>
		<link>http://haxx.sinequanon.net/2009/06/security-policy/comment-page-1/#comment-929</link>
		<dc:creator>jja</dc:creator>
		<pubDate>Tue, 17 Jan 2012 18:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://haxx.sinequanon.net/?p=200#comment-929</guid>
		<description>It depends on your servlet container where the security policy is stored. For a production Tomcat 6 instance, it&#039;s usually in the conf/ directory and named &quot;catalina.policy&quot;, and your Tomcat startup uses the same -D arguments to java, e.g. -Djava.security.manager -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy</description>
		<content:encoded><![CDATA[<p>It depends on your servlet container where the security policy is stored. For a production Tomcat 6 instance, it&#8217;s usually in the conf/ directory and named &#8220;catalina.policy&#8221;, and your Tomcat startup uses the same -D arguments to java, e.g. -Djava.security.manager -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://haxx.sinequanon.net/2009/06/security-policy/comment-page-1/#comment-928</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 11 Jan 2012 17:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://haxx.sinequanon.net/?p=200#comment-928</guid>
		<description>Hi, 

I am new to Grails. I am trying to run the following java RMI-client code from within my Grails web app: 

(grails/appname/src/java/ClientProgram.java) 

... 

import java.rmi.registry.LocateRegistry; 
import java.rmi.registry.Registry; 
import java.math.BigDecimal; 
import compute.Compute; 
import java.util.Properties; 
import java.io.FileInputStream; 

public class ClientProgram { 
... 

        public static void run( String regHost, String precision ) { 
                setSystemProps(); 
                if(System.getSecurityManager() ==  null) { 
                        System.setSecurityManager(new SecurityManager()); 
                } 
                try { 
                        String name = &quot;Compute&quot;; 
                        Registry registry = LocateRegistry.getRegistry(regHost); 
                        Compute comp = (Compute) registry.lookup(name); 
                        Pi task = new Pi(Integer.parseInt(precision)); 
                        BigDecimal pi = comp.executeTask(task); 
                        System.out.println(pi); 
                } catch(Exception e) { 
                        System.err.println(&quot;ComputePi exception.&quot;); 
                        e.printStackTrace(); 
                } 
        } 

... 
} 

See http://pastebin.com/GpQVhvee for the complete class source. 

I get the following error when the code is executed: 

2012-01-09 19:20:48,794 [http-9876-1] ERROR [/smartmeters].[gsp]  - Servlet.service() for servlet gsp threw exception 
java.security.AccessControlException: access denied (java.util.PropertyPermission grails.full.stacktrace read) 
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) 
        at java.security.AccessController.checkPermission(AccessController.java:546) 
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) 
        at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285) 
        at java.lang.System.getProperty(System.java:650) 
... 

Please see http://pastebin.com/jTzaiWfj for the full error message. 

I believe this error may appear because I have not got the correct policy settings for this code. I need the following rule in the security policy: 

grant codeBase &quot;file:/opt/grails/grails-1.3.7/appname/src/&quot; { 
        permission java.security.AllPermission; 
}; 

But I cannot find where the policy file is created or stored. If this was just a normal java application I would pass the security policy file in as a system property as follows: 

java -Djava.security.policy=policy.file main-class 

But I don&#039;t know how to achieve the same effect in Grails. Please can someone tell me how to set the java security policy for my Grails app? 

Thanks, 
Tom</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I am new to Grails. I am trying to run the following java RMI-client code from within my Grails web app: </p>
<p>(grails/appname/src/java/ClientProgram.java) </p>
<p>&#8230; </p>
<p>import java.rmi.registry.LocateRegistry;<br />
import java.rmi.registry.Registry;<br />
import java.math.BigDecimal;<br />
import compute.Compute;<br />
import java.util.Properties;<br />
import java.io.FileInputStream; </p>
<p>public class ClientProgram {<br />
&#8230; </p>
<p>        public static void run( String regHost, String precision ) {<br />
                setSystemProps();<br />
                if(System.getSecurityManager() ==  null) {<br />
                        System.setSecurityManager(new SecurityManager());<br />
                }<br />
                try {<br />
                        String name = &#8220;Compute&#8221;;<br />
                        Registry registry = LocateRegistry.getRegistry(regHost);<br />
                        Compute comp = (Compute) registry.lookup(name);<br />
                        Pi task = new Pi(Integer.parseInt(precision));<br />
                        BigDecimal pi = comp.executeTask(task);<br />
                        System.out.println(pi);<br />
                } catch(Exception e) {<br />
                        System.err.println(&#8220;ComputePi exception.&#8221;);<br />
                        e.printStackTrace();<br />
                }<br />
        } </p>
<p>&#8230;<br />
} </p>
<p>See <a href="http://pastebin.com/GpQVhvee" rel="nofollow">http://pastebin.com/GpQVhvee</a> for the complete class source. </p>
<p>I get the following error when the code is executed: </p>
<p>2012-01-09 19:20:48,794 [http-9876-1] ERROR [/smartmeters].[gsp]  &#8211; Servlet.service() for servlet gsp threw exception<br />
java.security.AccessControlException: access denied (java.util.PropertyPermission grails.full.stacktrace read)<br />
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)<br />
        at java.security.AccessController.checkPermission(AccessController.java:546)<br />
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)<br />
        at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)<br />
        at java.lang.System.getProperty(System.java:650)<br />
&#8230; </p>
<p>Please see <a href="http://pastebin.com/jTzaiWfj" rel="nofollow">http://pastebin.com/jTzaiWfj</a> for the full error message. </p>
<p>I believe this error may appear because I have not got the correct policy settings for this code. I need the following rule in the security policy: </p>
<p>grant codeBase &#8220;file:/opt/grails/grails-1.3.7/appname/src/&#8221; {<br />
        permission java.security.AllPermission;<br />
}; </p>
<p>But I cannot find where the policy file is created or stored. If this was just a normal java application I would pass the security policy file in as a system property as follows: </p>
<p>java -Djava.security.policy=policy.file main-class </p>
<p>But I don&#8217;t know how to achieve the same effect in Grails. Please can someone tell me how to set the java security policy for my Grails app? </p>
<p>Thanks,<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Security policy permissions for Grails in Tomcat « haxx qua non &#124; MySQL Security</title>
		<link>http://haxx.sinequanon.net/2009/06/security-policy/comment-page-1/#comment-663</link>
		<dc:creator>Security policy permissions for Grails in Tomcat « haxx qua non &#124; MySQL Security</dc:creator>
		<pubDate>Fri, 05 Jun 2009 01:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://haxx.sinequanon.net/?p=200#comment-663</guid>
		<description>[...] See the original post: Security policy permissions for Grails in Tomcat « haxx qua non [...]</description>
		<content:encoded><![CDATA[<p>[...] See the original post: Security policy permissions for Grails in Tomcat « haxx qua non [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

