XACML request samples
It is possible to write requests that will test the policy described in the previous section. Since it implements a clearance check on the user, it is interesting to send two requests where one contains a document classified as confidential and the other contains a document classified as top secret. The first request will lead to Permit provided, of course, the request match the policy target. The second will lead to Deny.
XACML request sample 1
<xacml-ctx:request xmlns:xacml-ctx="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" combineddecision="false" returnpolicyidlist="true">
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment">
</xacml-ctx:attributes>
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<xacml-ctx:attribute includeinresult="true" attributeid="urn:org:apache:tomcat:user-attr:clearance">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">SECRET</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
<xacml-ctx:attribute includeinresult="true" attributeid="company">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">Axiomatics</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
<xacml-ctx:attribute includeinresult="true" attributeid="urn:org:apache:tomcat:user-role">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">manager</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
</xacml-ctx:attributes>
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<xacml-ctx:attribute includeinresult="true" attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">view</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
</xacml-ctx:attributes>
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<xacml-ctx:attribute includeinresult="true" attributeid="classification">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">CONFIDENTIAL</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
<xacml-ctx:attribute includeinresult="true" attributeid="urn:oasis:names:tc:xacml:1.0:resource:resource-id">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">document</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
</xacml-ctx:attributes>
</xacml-ctx:request>
XACML request sample 2
<xacml-ctx:request xmlns:xacml-ctx="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" combineddecision="false" returnpolicyidlist="true">
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
<xacml-ctx:attribute includeinresult="false" attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">view</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
</xacml-ctx:attributes>
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
<xacml-ctx:attribute includeinresult="false" attributeid="classification">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">TOPSECRET</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
<xacml-ctx:attribute includeinresult="false" attributeid="urn:oasis:names:tc:xacml:1.0:resource:resource-id">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">document</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
</xacml-ctx:attributes>
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
<xacml-ctx:attribute includeinresult="true" attributeid="urn:org:apache:tomcat:user-attr:clearance">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">SECRET</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
<xacml-ctx:attribute includeinresult="false" attributeid="company">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">Axiomatics</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
<xacml-ctx:attribute includeinresult="false" attributeid="urn:org:apache:tomcat:user-role">
<xacml-ctx:attributevalue datatype="http://www.w3.org/2001/XMLSchema#string">manager</xacml-ctx:attributevalue>
</xacml-ctx:attribute>
</xacml-ctx:attributes>
<xacml-ctx:attributes category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment">
</xacml-ctx:attributes>
</xacml-ctx:request>