authorization - How to trace the value for an attribute using obligations in XACML -
wonder if there way load attribute value loaded pip extension attribute finder , transfer ($myattr1) obligation, in order printout message in clear text, useful doing debug tasks.
below xacml obligation i'd add rule (written in abstract notation):
<xacml2:obligations> <xacml2:obligation fulfillon="permit" obligationid="debug1"> $myattr1 = attributeid="http://red.com/subject/groupsuserbelong" <xacml2:attributeassignment attributeid="debug1" datatype="http://www.w3.org/2001/xmlschema#string">attribute found: $myattr1</xacml2:attributeassignment> </xacml2:obligation> </xacml2:obligations> updated code section
below find example how combine text message dynamic data pip lookup generating output via obligationexpressions:
<rule effect="deny" ruleid="deny-rule1"> <target></target> <condition> <apply functionid="urn:oasis:names:tc:xacml:1.0:function:not"> <apply functionid="urn:oasis:names:tc:xacml:1.0:function:string-is-in"> <attributevalue datatype="http://www.w3.org/2001/xmlschema#string">mygroup</attributevalue> <attributedesignator category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" attributeid="http://red.com/subject/groupsuserbelong" datatype="http://www.w3.org/2001/xmlschema#string" mustbepresent="true"></attributedesignator> </apply> </apply> </condition> <obligationexpressions> <obligationexpression fulfillon="deny" obligationid="groupscheck"> <attributeassignmentexpression attributeid="urn:oasis:names:tc:xacml:3.0:example:attribute:text"> <attributevalue datatype="http://www.w3.org/2001/xmlschema#string">rule 1 - groups validation error</attributevalue> </attributeassignmentexpression> </obligationexpression> <obligationexpression obligationid="debug1" fulfillon="deny"> <attributeassignmentexpression attributeid="debug1"> <attributedesignator attributeid="http://red.com/subject/groupsuserbelong" category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" datatype="http://www.w3.org/2001/xmlschema#string" mustbepresent="false"/> </attributeassignmentexpression> </obligationexpression> </obligationexpressions> </rule>
no, not possible in wso2 , xacml 2.0. in order this, need use xacml 3.0. ability add variables inside obligation (they're called attribute assignments in xacml spec) added xacml 3.0.
the axiomatics policy server support that. point out, neat feature debugging purposes other cases e.g.
- deny user right transfer money + obligation notify manager.
in example, obligation contain manager's email. here example using alfa syntax.
policy transfermoney{ target clause actionid == "transfer" apply firstapplicable rule denyselftransfer{ condition requestor==recipient deny on deny { obligation notifymanager{ message = "an employee tried transfer money themselves" employee = employeeid email = manageremail } } } }
Comments
Post a Comment