This discussion is archived
5 Replies Latest reply: Dec 20, 2011 7:28 AM by 376398 RSS

Security manager: what is it for?

Squall867 Newbie
Currently Being Moderated
Like title says...when sm is active I have to give explicit authorization for every sensible operation.
Now, say in my program I want to open a socket: why introduce a security managar and tell it I want to open it?I mean...I need to open this socket, so it's obvious I'll give my ok and this goes for every sensible operation I'll need to do!
Final user will have my program and use it: he/she can't modify my code and introduce some other sensible operation so I guess security manager is for me, the programmer...
In the end I feel like building a wall and soon after pierce through it...so why to build it in the first place?
What am I missing??
  • 1. Re: Security manager: what is it for?
    DrClap Expert
    Currently Being Moderated
    What you are missing is that Java code can be written by malicious programmers. Just saying that you promise to do the right thing doesn't mean anything.
  • 2. Re: Security manager: what is it for?
    Squall867 Newbie
    Currently Being Moderated
    Ok, but say I'm a malicious programmer: I'll NEVER introduce security manager in my code!
    Or, if I introduced it, I'd allow every malicious operation I'll want to do..
  • 3. Re: Security manager: what is it for?
    796440 Guru
    Currently Being Moderated
    user3957847 wrote:
    Ok, but say I'm a malicious programmer: I'll NEVER introduce security manager in my code!
    You don't have to. It's called by a lot of key methods in the core API, and the user can decide to put security policies in place.
    Or, if I introduced it, I'd allow every malicious operation I'll want to do..
    You don't make that call. The user does, with his policy configuration.
  • 4. Re: Security manager: what is it for?
    Squall867 Newbie
    Currently Being Moderated
    Aaahh ok, then it's the user who uses it! Ok thanks
  • 5. Re: Security manager: what is it for?
    376398 Newbie
    Currently Being Moderated
    The key thing to keep in mind is that the person creating a program and the person on running the program or on whose behalf the program is run are often not the same.

    Here is a sample flow.

    1. Person A create a program and for sensitive operation invoke the Security Manager (SM)
    2. Person B deploys the program in step 1. They may choose to run it with/without SM depending upon their risk analysis.
    3. Person B, deploys a policy for the program that might allow User A some operation, while not allowing the same operation to user B.

    While the default SM and the default Java Policy file is geared towards code source, there is support for subject based policy. Hope this helps.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points