Using the Security Manager to restrict access to a single package

After reading up on the Security Manager, the package.access property and the use of the [accessClassInPackage RuntimePermission|http://java.sun.com/javase/6/docs/technotes/guides/security/permissions.html#RuntimePermission] , it seemed to me that it would possible to set up the following: I have a security-sensitive code base packaged in a jar, and I want to make sure that only one client code base that I specify is permitted to access it. The idea here is to prevent malicious code from executing anything in the sensitive code base; the sensitive code is only accessible to one client that I name in a security policy file. Perhaps rather foolishly, I advised a client to consider this before testing out a sample myself, because much to my surprise, it appears to me that it isn't possible to get the Security Manager to do this at all. Am I missing something? I'm a bit startled by this conclusion -- it seems like such an obvious use for the Security Manager, I'm hard-pressed to be believe that it can't be done, and more inclined to suspect that I'm going about it wrong.
Here's what I thought I could do: set up the package.access property so that it denies access to any package; then in the policy file, grant the RuntimePermission/accessClassInPackage to the client code base that is permitted to access the sensitive code.
Of course, you wouldn't want the package.access property to exclude all packages in the global java.security file, because then no code could be accessed at all. It would be necessary to use the trick of resetting the package.access property within the code, as [illustrated in the secure coding guidelines|http://java.sun.com/security/seccodeguide.html#1-1a] .
But the problem lies in the idea of "use the package.access property to deny access to +any+ package". There doesn't seem to be any way to use wildcards or the like with the property -- it has to specifically name packages (or package prefixes) to which access is forbidden. It wouldn't do to try to name the packages to which I'm trying to prevent access, since we're trying to prevent access from malicious code -- the attacker could just choose package names that aren't on the list. I'd really need to say that access is denied to all packages, except for those in the permitted code base, but the security mechanisms for package access don't seem to allow that.
Moreover, the trick of changing the value of package.access can't be done within the client code -- otherwise, the attacker client would just set the property to his own purposes. But it can't really be done within the sensitive package either, because the whole idea is to prevent access to that package, and by the time it's busy setting the property, it's already too late, because the package has to have been accessed by a client to get there at all.
It seems to me that this a symptom of something I've never really understood about the design of the Security Manager -- you can grant permissions to specific code bases, but you can't revoke permissions from specific code bases, let alone all code bases. What I want to do here is grant access permission to one specific code base and revoke it from all others. There doesn't seem to be any way to express that with the mechanisms of the Security Manager.
The more I look at it, the more it seems that there's just no way to use the Security Manager this way -- set up package access so that a specific code base can only be accessed by one specific client code base. There are surely other ways to get the effect that I'm looking for, but as far as I can tell, none of them involve restricting package access (for example: define a custom permission, grant it only to the permitted client. and check against that permission within the sensitive code base; meaning that the sensitive code has to be accessible to anyone in the first place). This conclusion really surprises me (not to mention my bit of embarrassment with the client); wouldn't this be precisely the sort of thing the Security Manager ought to be good for?

You're looking at this back to front. The security policy file is there for the client to decide how much access he is going to give this application, not for to application to restrict who can use it. If you want to control what used to be called 'state orientation' you can do that directly by looking down the stack trace inside your code.

Similar Messages

  • Disabling the Security Manager

    When the J2EE 1.4 refernce server is running with the Security Manager disabled the web based admin console stops working (some sort of JACC error),although asadmin seems to work fine. Which leads to a few questions :
    1. Is there a way to disable the Security Manager and use the web console ?
    2. Are there other downstream effects to running the server without the Security Manager enabled ? What other features can/will fail?
    Its nice to see Sun putting an emphasis on out of the box security, but using the Security Manager is a real pain during development and is overkill for alot of internal deployments.

    Hi,
    There is no mechanism to disable the SecurityManager in J2EE 1.4. JACC (JSR115) is a new spec that went into 1.4 that allowed for plugging authorization provider in the J2EE. This spec makes it mandatory for us to have the security manager on all the time.
    If you turn off the security manager, the web console should not work properly as it is a web app and has security permissions defined that are interpreted by our JACC provider.
    Downstream effects of running the server with security manager disabled, will mean that all checks that we have as part of the server policy will fail and ofcourse all applications that use authorization checks will fail too.
    We have spent considerable time from this release to improve the performance of the system with the security manager enabled. You should look out for the next release coming out that will have these optimizations.

  • An impersonation error occurred using the security context of the current user. -- Report server is on remote server and file share folder is on local server

    I have deployed a report on the server (e.g. remoteserver\reports) from my local machine. I opened the report in browser in my local machine and created a new subscription with windows file share delivery option.
    But its giving an error "Failure writing file \\localserver\subscriptions\Report1.xls : An impersonation error occurred using the security context of the current user." Here "subscriptions"
    is the folder which I have created in my local machine.
    I followed the instructions found in the link "http://msdn.microsoft.com/en-us/library/ms157386.aspx"
    Please help to solve this issue.

    Hi,
    Thank you for your reply.
    I have followed the same process. The credentials which I have given are same as my PC. But I am getting the same error. Can you please clarify the statement "Service
    account that is using for file share subscription should have write access to shared folder."
    given in the above link?
    I am the one who created the folder and subscribing the report, so probably I have the full write permissions to the shared folder. What is the service account in this context?
    I think the problem is, I am deploying the report on the server and creating the shared folder in the local machine. I tried giving shared folder permissions to the user on the server. But my local machine is in local domain and I cant access the users on
    the remote server. Do I need to create a shared folder on the server? I am new to SSRS. Please help me.
    PS: I have assigned with all roles viz. Browser, Content Manager, Publisher, Report Builder etc. and My Role name (WEBSERVER\User)
    is different from my local user name (domain\username) in domain.

  • ARM approval error after upgrading to SP14: Database error while using the secure store.

    Dear GRC experts,
    After upgrading GRC 10 to SP14, assigning manual passwords during the approval of a request, the approval process is failing.
    Here is the scenario; your advice will be appreciated.
    Task: Manually assign passwords to multiple systems contained in the request
    Where: On the access request, go to “User System Details” tab
    Issue: After approving/submitting the request, the error “Database error while using the secure store” is generated
    Logs: Nothing on transactions SLG1 or ST22; however ST11 shows the error attached below:
    This is the failed approval of the request:
    Other scenarios executed as a workaround, and passed the password assignment this time:
    The approval will work if only one password is assigned to any of the given systems. The rest of the systems get an auto-generated
    password.
    ARM also accepts multiple passwords when the requestor assigns passwords on the “User System Details” prior submitting a
    request. The GRC admin can approve once reached for system approval.
    AS FYI, “Confirm Password” is only required when creating the request but not on any other stage.
    System information:
      -Netweaver 7
      -GRCFND_A SP14
      -GRCPINW SP13
    Regards,
    Gustavo

    SAP just delivered a note to fix this issue. The number is 2022294.

  • Firefox will not open - I have reinstalled and used the profile manager solution. It was fine earlier today. IE working fine.

    I tried the suggested solutions including the 'clean install', any help would be most appreciated. I've used the Profile Manager, which is not much use when the browser won't even open to test it. I've also reinstalled twice, installed updates and restarted numerous times.
    Firefox does do this on occasion, but usually sorts itself out - not this time.
    Help!

    You should check for malware or go back into regular mode and see if temorarily disabling your antivirus helps.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    '''Scan with all.'''
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.

  • I am trying to change my password, but not remember the security questions and not access recovery email. Please give me a solution.Ana Maria Cappatto Simoes/ F. 11.50414433

    I am trying to change my password, but not remember the security questions and not access recovery email. Please give me a solution.Ana Maria Cappatto Simoes/ F. 11.50414433

    Welcome to the Apple Community.
        1.    Start here (change country if necessary) and navigate to 'Password and Security', reset your security questions using the link provided, you will receive an email to your rescue address, use the link in the email and reset your security questions.
        2.    If that doesn't help, you don't receive a reset email or you don't have a rescue address, you should contact AppleCare who will initially try to assist you with a reset email or if unsuccessful will pass you to the security team to reset your security questions for you.
        3.    If you are in a region that doesn't have international telephone support try contacting Apple through iTunes Store Support.

  • Cannot find security providers when using a security manager.

    Hi all,
    I've done stuff with JAAS and JSSE before, but this is the first time I've combined the two :o)
    I have some code for an application server and I'm using SSL sockets in order to communicate with the outside world. These all work fine, no problems at all.
    However, I want to control what code is executed on the server using the security framework. When I load my server using a security manager and custom security policy it seems that my app can no longer find the security providers.
    Exception in thread "SSLServer" java.lang.RuntimeException: Could not generate DH keypair
         at com.sun.net.ssl.internal.ssl.DHKeyExchange.generateKeyPair(DHKeyExchange.java:137)
         at com.sun.net.ssl.internal.ssl.ServerHandshaker.getEphemeralDHKeys(ServerHandshaker.java:132)
         at com.sun.net.ssl.internal.ssl.ServerHandshaker.trySetCipherSuite(ServerHandshaker.java:707)
         at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.checkEnabledSuites(SSLServerSocketImpl.java:292)
         at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:253)
         at com.essar.hikesoft.server.netio.SSLConnectionServer.run(SSLConnectionServer.java:126)
         at java.lang.Thread.run(Thread.java:595)I start my app as follows:
    java -Djava.security.manager -Djava.security.policy==security.policy -classpath... and I have the following lines in my security.policy file
    permission java.security.SecurityPermission "insertProvider.*";
    permission java.security.SecurityPermission "putProviderProperty.*";I know that the providers are defined in the java.security file, do I have to implement my own Security manager in order to load these providers? Or have I missed something else?
    Am currently chewing through the docs at http://java.sun.com/j2se/1.5.0/docs/guide/security/spec/security-spec.doc6.html but any further assistance greatly appreciated!

    That seems to have cured it cheers - sure I copied the double '=' from somewhere, thought it was wierd at the time.
    Now to solve the odd MySQL errors :-)
    Thanks for your help.

  • Can I use the Profile Manager as an MDM while distributing app through app store?

    Is it possible to use the Profile Manager within the OSX Server to provision profiles through apps purchased in the app store? 
    Ex:  userX buys app in the app store, in downloading the app they get enrolled in the MDM / OSX Server I control.  They select profile settings within my app and submit to OSX Server (Profile Manager) at which point I send back OTA the provisioned profile for them to upload.
    Ex:  https://itunes.apple.com/us/app/parentkit/id600618138?mt=8
    Thanks for the feedback!

    Is this not possible?  Is it possible but not allowed? 

  • Using the transition manager on a movie clip prevents me from physically moving it after that

    Hi,
    I'm using the transitions manager to animate certain objects
    in my movie. let's say I'm using it on a ball - using the following
    code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    function zoomIn(_mc) {
    new Tween(_mc, "_xScale", Bounce.easeOut, 0, 100, .3, true);
    new Tween(_mc, "_yScale", Bounce.easeOut, 0, 100, .3, true);
    function zoomOut(_mc) {
    new Tween(_mc, "_xScale", None.easeIn, this._xscale, 0, .05,
    true);
    new Tween(_mc, "_yScale", None.easeIn, this._xscale, 0, .05,
    true);
    and then calling it later with this:
    zoomIn(ball_mc);
    That works fine. But at a later stage of the movie I then try
    to move the location of the ball - not with code but by adding a
    key frame and physically moving it's location. When I play the
    movie back it does not show that it moves.
    I'd really just like to know why this is!
    Thanks,
    Ray

    I think that once the Tween plays, the ball_mc, now resides
    in it's final resting place, it might do this with all instances of
    the mc, interesting though. I would have thought the same, maybe if
    you move it and give it a different instance name it will not
    effect the position on the new keyframe.

  • How enable my AMD adapter using the device manager

    The message that comes up after updating my AMD driver is this:
    The Catalyst Control Center is not supported by the driver version of your enabled graphics adapter.  Please update your AMD graphics driver, or enable your AMD adapter using the Displays Manager. 
    I am running Windows 7 Home premium
    HP Pavilion DV 7 notebook pc
    Intel Graphics 3000
    Radeon HD 6490M
    please help

    I'm new to this
    What is the solution?

  • Can my employer view my activity (games, twitter usage, etc.) on my personal phone if I use the Citrix Receiver app to access corporate emails?

    Can my employer view my activity (games, twitter usage, etc.) on my personal phone if I use the Citrix Receiver app to access corporate emails?

    No, they cannot see this through Citrix. Citrix is only a 'window' for you to look into the company applications. You do not transfer info from the phone related to other activities.

  • Firefox is running in the background, but the process can't be ended using the task manager?

    The program wouldn't open because it was apparently still running in the background, so I restarted a few times which didn't help. Then I tried using the task manager to end the process but that didn't work either. Then opened the command prompt and used taskkill, then pskill (using the PID number) but neither worked. The problem wasn't with how I was using these commands as they could close any other program I had running, just not firefox.exe*32. Any ideas?

    Try:
    *http://kb.mozillazine.org/Firefox.exe_always_open

  • About 2/3 of the time I leave Firefox, it is evidently retained in memory so I can't restart it without using the task manager. I don't use Norton or Skype programs. How do I keep this from happening?

    About 2/3 of the time I leave Firefox, it is evidently retained in memory so I can't restart it without using the task manager. I don't use Norton or Skype programs. How do I keep this from happening?
    == After I have used Firefox and "closed" it.

    See this:
    https://support.mozilla.com/en-US/kb/Firefox+hangs#Hang_at_exit

  • Create a recovery catalog by using the Enterprise Manager Console

    Dear Sirs:
    I am using the Oracle9i database release 2. After installing the management server and running the Enterprise Manager Configuration Assistant, there was no recovery catalog and no CATTBS tablespace created. According to the Help and to your documentation entitled “Oracle Enterprise Manager Configuratrion Guide” this recovery catalog and CATTBS tablespace should be created automatically.
    Of course I am not running any target database on the same machine.
    How can I create a recovery catalog by using the Enterprise Manager Console, and not by using the rman command prompt?
    Please its urgent and I need an answer as soon as possible.
    Thank you in advance with best regards

    Dear Sir:
    Thank you very much for your reply, but unfortunately it didn’t help me. This article is repeating what is mentioned in the Help and the documents that I downloaded earlier. As I said earlier I know how to setup the recovery catalog by using the rman command prompt, but I couldn’t do it by using the Oracle Enterprise Manager Console. By using the wizards it is supposed to be created automatically but nothing of this happened.
    Please I need help urgently.

  • HT3728 I do not need another wireless network but want to use the airport express for printer access only.  Can this be done and how?

    I do not need another wireless network but want to use the airport express for printer access only.  Can this be done and how?

    You can configure the AirPort Expess to "Join a wireless network" and enable the Ethernet port so that Ethernet devices will be able to connect.
    In order to print from the iOS devices, you will need to have an application like Printopia installed on your Mac. The Mac must be active when you want to print.
    More details here: Printopia - AirPrint to Any Printer - Print from iPad - Print from iPhone ...
    There is a free trial available for Printopia, so make sure that it will work before you buy the AirPort Express.

Maybe you are looking for

  • How do I get Adobe reader to read a PDF book aloud?

    I am trying everythin, it just keeps reading the title of the document.

  • Saving ResultList as binary file

    Hi, I like to store my ResultList as binary on file drive. The aim is to safe drive space and execution time for creating the report (XML or ASCII) for each UUT. At the moment i had nothing figured out doing such stuff in TS. Thats the reason why I s

  • RD Gateway issue from Mac Remote Desktop client - 503 RPC Error: c0021012

    I have an employee who is able to use the Mac Remote Desktop client to connect to her office PC via RD Gateway, but after a short time she consistently has her connection dropped with a 503 RPC Error: c0021012.  I've researched this a little and appa

  • Alphabetical  and Folder Issues

    Ok, let's look at one Event that I have set up and give me some input, correction or answers to the following real scenario if some of you would please. I have all the photos of my daughter from the various years of Easter, from 1998 to 2006. I have

  • COOIS selection screen

    Hi all, in the selection screen of transactio COOIS, can someone explain to me the difference between 'List' field and 'production orders' / 'planned orders' ? Thanks