开发者

High level Java security framework

开发者 https://www.devze.com 2023-03-10 05:00 出处:网络
What security framework do you use in your Java projects? I used Spring Security and Apache Shiro and they both look immature.

What security framework do you use in your Java projects?

I used Spring Security and Apache Shiro and they both look immature.

Spr开发者_如何转开发ing Security flaws:

  1. no native support for permissions;
  2. no ability to use explicitly in Java code (sometimes it's necessary);
  3. too much focused on classic (non AJAX) web applications.

Apache Shiro flaws:

  1. bugs in final release (like the problem with Spring integration);
  2. no support for OpenID and some other widely used technologies;
  3. performance issues reported.

There is also lack of documentation for both of them.

Maybe most of the real projects develop their own security frameworks?


As for Apache Shiro:

I'm not sure why you've listed the things you did:

  1. Every project in the world has release bugs, without question. The big key here however is that Shiro's team is responsive and fixes them ASAP. This is not something to evaluate a framework on, otherwise you'd eliminate every framework, including any you write yourself.
  2. OpenID support will be released shortly in Shiro 1.2 - maybe a month out?.
  3. What performance issues? No one has ever reported performance issues to the dev list, especially since the caching support in Shiro is broad and first-class. Without clarifications or references, this comes across as FUD.
  4. Documentation now is really good actually - some of the best in Open Source that I've seen lately (it was re-worked 2 weeks ago). Do you have specific examples of where it falls short for you?

I'd love to help, but your concerns are generalizations that aren't supported by references or concrete examples. Maybe you could represent specific things that your project needs that you've fail to accomplish thus far?

Apache Shiro continues to be the most flexible and easiest to understand security framework for Java and JVM languages there is - I doubt you'll find better.

But, above all, and I mean this with all sincerity, please don't write your own security framework unless you plan on putting a ridiculous amount of time into it. Nearly every company I've ever seen that tries to do this themselves fails miserably. It is really hard to get 'right' (and secure). Trust me - after writing one for 8 years, that's one thing I'm absolutely sure of :)

Anyway, feel free to join the Shiro user list and you're sure to find that the community is happy and willing to work through whatever issues you may have. You'll find that we take care of the people that ask questions and do our best to help out.

HTH!


My current projects use SpringSecurity and involve doing all three things you claim to be flaws in SpringSecurity:

  • The projects implement fine-grained access rules that go beyond simple ROLEs, and variously involve state of domain objects, extra request parameters, and so on. These are implemented using custom "access policy objects" that get called within my MVC controllers. However, access check failures are handed back to SpringSecurity by throwing the relevant exception. (These could have been implemented as standard SpringSecurity method-level interceptors, but the checks typically involve examining domain objects.)

  • The projects support both web and AJAX access, and deal with access failures differently for the two cases. This is done by writing some custom Authentication entrypoint components for SpringSecurity that choose between different authentication behaviors depending on the request URL, etc.

In other words, it can be done ...

Having said that, I agree with you on a couple of points:

  • It is not easy to wire this up kind of thing. I kept on running into roadblocks when using the <http> element and its associated configurer. Like ... you want it to use a different version of component X. But to do that you have to replace Y, Z, P and Q as well.

  • The documentation is really sparse, and not helpful if you are trying to do something out of the ordinary.


Andrey, I think this answer comes too late to be helpful to you; it is intended for those who land on this thread later and I hope it helps.

My company recently released as open source, OACC, an advanced Java Application Security Framework. OACC is designed for systems that require up to object-level security granularity.

OACC provides a high performance API that provides permission based authorization services. In a nutshell, OACC allows your application to enforce security by answering the question: Is entity ‘A’ allowed to perform action ‘p’ on entity ‘B’?

One of the key abstractions in OACC is a resource. A resource serves as the placeholder in OACC for the object in the application domain that needs to be secured. Both the actors (e.g. users, processes) and the objects being secured (e.g. documents, servers) are represented as resources in OACC. The application domain objects that are actors, or are secured, simply store the resource id to the associated resource.

The resource abstraction allows OACC, unlike other major security frameworks, to provide a rich API that manages permissions between resources. OACC persists security relationships in RDBMS tables (DB2, Oracle, MS-SQLServer and PostgreSQL are currently supported).

For more information please check out the project website: http://oaccframework.org


We use a layered security in one of our projects. The layers are the following:

  1. HTTPS as protocol (Apache-AJCConnectors-TomcatServlets)
  2. Only binary objects transferred between client and servlet
  3. Individual elements in the passed objects (either way) are encrypted
  4. Encryption key is dynamic, set up during initial handshaking, valid for 1 session

Conceptually, the security consists of the encryption key, encryption algorithm and the data on which it is applied. We make sure that more than 1 of the 3 is never passed simultaneously during a communication. Hope that helps. Regards, - M.S.

0

精彩评论

暂无评论...
验证码 换一张
取 消