I'm trying to decide what authorization technology/methodology to do for a project and XACML has a lot of interesting features. One thing I can't wrap my head around though is the need for combining algorithms. Are there complex scenarios where they are needed?
Say that, instead, access to a resource type (or whatever) is Permit or Deny per default. A rule defines a condition for either a permit or deny (never both).
If there's any deny it's denied (immediately). If it's "deny by default" and there's no permit, it's also denied. Rules could have priority and a permit/deny on any higher level would override those below it.
Rules would be more piecemeal Permit/Deny rather than one big rule with advanced combining algorithms.
Am I missing some major scenarios (probably) that wouldn't be covered by such an approach? Maybe a hard question to answer :) Hoping someone with a lot of XACML experience and/or access control can shed some light on the design thinking and their experience with such policies.
Thanks in advance!
EDIT: (as reply to George because too long)
Super thanks for answering David! Read a lot of your posts and articles, good stuff.
I hear what you're saying and there's a lot of intricacies (reading the emailing list on some of the design decisions and the evaluation logic, whew, hairy stuff :) But it almost seems like the hierarchical structure is what adds a lot of complexity, and I don't quite see why it's needed.
According to the logic I wrote, I could just have these two rules (if I understand the XACML correctly)
PERMIT: unit = "bu1"
DENY: unit = "bu1" AND apiPath == "/finance" AND objectType== "trade" AND trade.amount > user.allowedAmount
- Give access if a user is in the unit
- Under a set of specific circumstances deny
- Could even drop the business unit restriction of the DENY rule if it's a company-wide rule, which it seems it should be
It seems easier to individually tailor rules than them being part of one big rule, and does one really need to think of them as one rule if you write them like this? I guess you'd have a general mindset of permitting the general cases and denying the exceptions.
So second sample, this is why I think you actually need "priority levels" to resolve some things.
Priority 1:
PERMIT: megaemergency = true
Priority 2:
PERMIT: emergency = true AND u.approvalLimit >= c.amount.
Priority 3:
PERMIT: u.region = c.region AND u.approvalLimit >= c.amount.
Since it short circuits on PERMIT or DENY on any "priority level", and they're evaluated in order, wouldn't the result be the same? And the person who authors the lower priority rules wouldn't really need to know about the rules with higher priority.
Last example would be:
PERMIT: u.citizenship == "U.S" AND u.enteringFrom == "Canada"
DENY: u.citizenship != "U.S" AND u.enteringFrom == "Canada"
(I mean there would have to be other rules too :)
Since DENY overrides Permit, and any DENY denies you're set.
I guess I'm having trouble seeing the edge-cases that can't be handled by such an approach... Maybe I'm having a head fart :)
Sorry again, the scope of the question is a bit wide.