Regarding your first question, sending additional attributes that are not necessary to a rule's decision will NOT affect the decision. Take a look at this XACML decision by a PDP:
<EvaluationEvent xmlns="http://www.axiomatics.com/v1/EvaluationEvent" xmlns:xacml-ctx="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17">
<GroupId>ddc4a53f-1c98-403c-81ce-938c97645d7d</GroupId>
<GroupVersion>6</GroupVersion>
<Timestamp>2018-07-24T02:39:21.907Z</Timestamp>
<EvaluationTimeMillis>0</EvaluationTimeMillis>
<ClientIdentity>User+username%3D%22pdp-user%22%2C+roles%3D%22pdp-user%22</ClientIdentity>
<ClientSource>127.0.0.1:49502</ClientSource>
<InterfaceType>SOAP</InterfaceType>
<PdpIdentity>f6a721ba-058e-44df-9434-ec1505e99ddc</PdpIdentity>
<xacml-ctx:Request ReturnPolicyIdList="false" CombinedDecision="false" xmlns:xacml- ctx="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17">
<xacml-ctx:RequestDefaults>
<xacml-ctx:XPathVersion>http://www.w3.org/TR/1999/REC-xpath-19991116</xacml- ctx:XPathVersion>
</xacml-ctx:RequestDefaults>
<xacml-ctx:Attributes Category="urn:oasis:names:tc:xacml:1.0:subject- category:access-subject" >
<xacml-ctx:Attribute AttributeId="com.axiomatics.seniority" IncludeInResult="false">
<xacml-ctx:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">1</xacml- ctx:AttributeValue>
</xacml-ctx:Attribute>
<xacml-ctx:Attribute AttributeId="role" IncludeInResult="false">
<xacml-ctx:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ADMIN</xacml- ctx:AttributeValue>
</xacml-ctx:Attribute>
<xacml-ctx:Attribute AttributeId="com.axiomatics.emailAddress" IncludeInResult="false">
<xacml-ctx:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">userone@user.com</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 AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="false">
<xacml-ctx:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">secretmessage</xacml- ctx:AttributeValue>
</xacml-ctx:Attribute>
</xacml-ctx:Attributes>
</xacml-ctx:Request>
<ResultEntries>
<ResultEntry>
<xacml-ctx:Result>
<xacml-ctx:Decision>Deny</xacml-ctx:Decision>
<xacml-ctx:Status>
<xacml-ctx:StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
</xacml-ctx:Status>
</xacml-ctx:Result>
<EvaluationComplexity>21</EvaluationComplexity>
</ResultEntry>
</ResultEntries>
</EvaluationEvent>
In a sample project on my localhost, the only attribute I'm looking for in subject in a specific rule is whether or not the attribute com.axiomatics.seniority
is equal to 1 or 2. This means the ADMIN
is an extra attribute that is provided. However, it does not affect the decision making.
In regards to your second question, I'm not if I understand completely but I do gather that you are concerned about the PDP's performance. In general, the performance of the PDP's decision making - putting memory and software implementation of XACML aside - is based on your policies. You'll want to get a "DENY" as soon as possible in your policies if one will occur.
In regards to setting attributes in a PEP, I've found it helpful to use a function that sets the default attributes based on the type of decision that will occur, like so:
@Override
public void uiDecisionSetDefaultAttributes() {
Authentication auth =
SecurityContextHolder.getContext().getAuthentication();
attrCatAry.add("SUBJECT");
attrTypeAry.add("INTEGER");
attrIdAry.add("com.axiomatics.seniority");
Integer userId = null;
try {
userId = userRepository.findByEmail(auth.getName()).getSeniority();
} catch (Exception e) {
log.info(e.toString());
}
attrValAry.add(userId);
}
Full disclosure - I work for Axiomatics and my answers are based on a software that is fully compliant with the XACML standard, such as Axiomatics software.