Authorization in a multilayer system #287
Replies: 2 comments 1 reply
-
This is a great topic! I think in general, authorization in recent years has more and more moved from the "gateway model" — where checks for identity and permissions have been performed at the outer perimeter of a system only — towards a zero trust security model, where the same checks are performed everywhere. If that can be accomplished, that would generally be preferable, I'd say. Some common hurdles preventing this model include:
I've blogged some about potential workarounds for this in the past, and I believe some models would be interesting to look at more closely. Would appreciate hearing from others too! |
Beta Was this translation helpful? Give feedback.
-
Hi @anderseknert, Thank you for your contribution! I read your post and got some ideas from there, mainly from item 4 because it could deliver security and performance. I imagine that it would be possible to hash the authorization context (headers, body data, etc) in some way and put it on the OPA's signed token and the subsequent layers must validate de token and check if the context remains the same comparing the request and the token hash. For example: Business System A:
Core System:
This was an example to demonstrate that we can explore the JWT custom claims to express what was authorized before. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
Multilayer system was the best term that I think to describe my use case. I am struggling to define the best way to apply authorization to a system composed of some layers, for example:
mobile app -> business system A -> core system
mobile app -> business system B -> core system
After some analysis, I reached two different approaches:
1 - Put fine-grained authorization rules in business systems
In this case, the fine-grained authorization will be applied in business systems, that is intermediate systems. I think that in this way the rules and data will be more compliant with the domain. In contrast, the generic rules will be applied in core systems because the more granular ones were applied before. The problem is that the core systems must trust the business system and this could be a risk.
2 - Put fine-grained authorization rules in core systems
In this case, the fine-grained authorization will be applied in core systems, that possess the most valuable information, this way I have total control over the way the resources are consumed. In contrast, the generic rules will be applied in business systems. The problem is that the request must travel over all layers to find out something is not authorized, and the complexity will be elevated on the core systems because I will bring rules and data from many different contexts and domains.
At the end of the day, it is a trade-off and there is no correct response for this, but I appreciate your opinion and ideas about this case. Maybe there are alternative ways to handle authorization in a multilayer system that I really would like to know.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions