I'm trying to test a security method in MapReduce and i'm wondering if my approach makes sens. I would like to transform access control list policy which exist in MapReduce to an XACML policy to do that i take the file where the ACL is defined and copy the name and value of each propriety then put it in a policy following the XACML format.
this is the ACL definition
<property>
<name>mapreduce.job.acl-modify-job</name>
<value>user </value>
</property>
<property>
<name>mapreduce.job.acl-view-job</name>
<value>user </value>
</property>
this is the policy in XACML
<Policy PolicyId="GeneratedPolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:ordered-permit-overrides">
<Target>
<Subjects>
<Subject>
<SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">user </AttributeValue>
<SubjectAttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</SubjectMatch>
</Subject>
</Subjects>
<Resources>
</AnyResource>
</Resources>
</Target>
<Rule RuleId="rule1" Effect="Permit">
<Target>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">mapreduce.job.acl-view-job</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</ActionMatch>
</Action>
</Actions>
</Target>
</Rule>
<Rule RuleId="rule2" Effect="Deny"/>
</Policy>
is this considred correct?
A couple of comments on your policy:
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">user </AttributeValue>
. Get rid of it (unless you really mean to test on 'user '.urn:oasis:names:tc:xacml:1.0:action:action-id
== mapreduce.job.acl-view-job
urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:ordered-permit-overrides
). Generally I avoid using it because it means that in the case of a Deny and a Permit, Permit wins. That's too permissive to my liking. Use first-applicable (urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable
) instead. You can read up on combining algorithms here.