Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a right way to manipulate GoogleAppEngine security permissions?

I have a GoogleAppEngine application that is required to connect to another localhost server, but when I'm trying to do this from the server code, I get:

java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)

I know that I can specify my additional security grant by using java virtual machine arguments (I specify them in Web Application run configuration):

java -Djava.security.manager -Djava.security.policy=WEB-INF/java.policy

with java.policy contents:

grant {
       permission java.net.SocketPermission "localhost:8081", "connect, resolve";
};

but it overrides the GoogleAppEngine internal security manager which is located in private class at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager, so the properties, required for AppEngine itself are disabled in that way.

Is there any way to make GoogleAppEngine internal security manager class use my policy file instead of replacing it manually with a stub (allowing anything) file in a jar?

like image 774
shaman.sir Avatar asked Sep 21 '09 13:09

shaman.sir


People also ask

How do I manage Google Permissions?

Go to the Security section of your Google Account. Under “Third-party apps with account access,” select Manage third-party access. Select the app or service you want to remove. Select Remove Access.

What is App Engine service admin?

App Engine Admin ( roles/appengine.appAdmin ) Read/Write/Modify access to all application configuration and settings. To deploy new versions, a principal must have the Service Account User ( roles/iam. serviceAccountUser ) role on the App Engine default service account, and the Cloud Build Editor ( roles/cloudbuild.


1 Answers

You can't open sockets on App Engine. You need to use the URLFetch API, either via java.net or directly. How do you expect to access 'localhost' when your app has been uploaded to App Engine, though?

like image 94
Nick Johnson Avatar answered Oct 22 '22 18:10

Nick Johnson