I was following CombinerParameters conversation when I had an idea for some syntactic sugar that I think would make reading XACML policies easier. I realize that there are things like Alpha to shield policy writers from the nuances of XACML policy writing, but I have always felt that where possible creating a policy framework that lends itself it simplicity (ala brevity) would help with adoption...or at least perception.
I was looking at the XML and thinking about Steven's proposal for global variables and was wondering if there would be value in creating global entities for things like DataTypes to assist in making policies more human readable. While I understand the value and precision of full URx notation, the amount of duplication for things like string definitions seems like overkill given the (what I believe to be) unlikely Use Case of having different types of strings in a PxP domain, as well as the assumption the PDP processing logic is using simple string matching of "http://www.w3.org/2001/XMLSchema#string" to process what it has already consumed and cached vs. attempting some sort of lookup each time it is read...
In simple terms I was thinking of a global entity as something like this:
GlobalEntity:
type: data
name: ^string
value: "http://www.w3.org/2001/XMLSchema#string"
(I'm just using YAML, for simple clarity and "^" as a callout for example only)
It/ would reduce Steven's example in the thread to:
<?xml version="1.0" encoding="UTF-8"?> <Policy xmlns="urn:oasis:names:tc:xacml:4.0:core:schema" PolicyId="http://example.com/test" Version="1.0" CombiningAlgId="urn:test:my-custom-combining-alg"> <CombinerParameter ParameterName="p1"> <AttributeValue DataType="^string">a</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p2"> <AttributeValue DataType="^string">b</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p3"> <PolicyId>http://example.com/P1</PolicyId/> <AttributeValue DataType="^string">c</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p4"> <PolicyId>http://example.com/P1</PolicyId> <AttributeValue DataType="^string">d</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p5"> <AttributeValue DataType="^string">e</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p6"> <AttributeValue DataType="^string">f</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p7"> <PolicyId>http://example.com/PS1</PolicyId> <AttributeValue DataType="^string">g</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p8"> <PolicyId>http://example.com/PS1</PolicyId> <AttributeValue DataType="^string">h</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p9"> <AttributeValue DataType="^string">i</AttributeValue> </CombinerParameter> <CombinerParameter ParameterName="p10"> <AttributeValue DataType="^string">j</AttributeValue> </CombinerParameter> <PolicyIdReference>http://example.com/P1</PolicyIdReference> <PolicyIdReference>http://example.com/PS1</PolicyIdReference> </Policy>
If we wanted to really go crazy, we could also create domain entities:
GlobalEntity:
type: domain
name: ^example
value: "http://example.com"
subdomin: "/foo"
Applying that to the XML snippet above and we get:
<?xml version="1.0" encoding="UTF-8"?>
<Policy xmlns="urn:oasis:names:tc:xacml:4.0:core:schema" PolicyId="^example:test" Version="1.0"
CombiningAlgId="urn:test:my-custom-combining-alg">
<CombinerParameter ParameterName="p1">
<AttributeValue DataType="^string">a</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p2">
<AttributeValue DataType="^string">b</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p3">
<PolicyId>^example:P1</PolicyId/>
<AttributeValue DataType="^string">c</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p4">
<PolicyId>^example:P1</PolicyId>
<AttributeValue DataType="^string">d</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p5">
<AttributeValue DataType="^string">e</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p6">
<AttributeValue DataType="^string">f</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p7">
<PolicyId>^example:PS1</PolicyId>
<AttributeValue DataType="^string">g</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p8">
<PolicyId>^example:PS1</PolicyId>
<AttributeValue DataType="^string">h</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p9">
<AttributeValue DataType="^string">i</AttributeValue>
</CombinerParameter>
<CombinerParameter ParameterName="p10">
<AttributeValue DataType="^string">j</AttributeValue>
</CombinerParameter>
<PolicyIdReference>^example:P1</PolicyIdReference>
<PolicyIdReference>^example:PS1</PolicyIdReference>
</Policy>
The XML Policy is slimmed down and it looks even more svelte in JSON and YAML ��
{
"Policy": {
"xmlns": "urn:oasis:names:tc:xacml:4.0:core:schema",
"PolicyId": "^example:test",
"Version": "1.0",
"CombiningAlgId": "urn:test:my-custom-combining-alg",
"CombinerParameter": [
{
"ParameterName": "p1",
"AttributeValue": {
"DataType": "^string",
"value": "a"
}
},
{
"ParameterName": "p2",
"AttributeValue": {
"DataType": "^string",
"value": "b"
}
},
{
"ParameterName": "p3",
"PolicyId": "^example:P1",
"AttributeValue": {
"DataType": "^string",
"value": "c"
}
},
{
"ParameterName": "p4",
"PolicyId": "^example:P1",
"AttributeValue": {
"DataType": "^string",
"value": "d"
}
},
{
"ParameterName": "p5",
"AttributeValue": {
"DataType": "^string",
"value": "e"
}
},
{
"ParameterName": "p6",
"AttributeValue": {
"DataType": "^string",
"value": "f"
}
},
{
"ParameterName": "p7",
"PolicyId": "^example:PS1",
"AttributeValue": {
"DataType": "^string",
"value": "g"
}
},
{
"ParameterName": "p8",
"PolicyId": "^example:PS1",
"AttributeValue": {
"DataType": "^string",
"value": "h"
}
},
{
"ParameterName": "p9",
"AttributeValue": {
"DataType": "^string",
"value": "i"
}
},
{
"ParameterName": "p10",
"AttributeValue": {
"DataType": "^string",
"value": "j"
}
}
],
"PolicyIdReference": [
"^example:P1",
"^example:PS1"
]
}
}
+++
Policy:
xmlns: urn:oasis:names:tc:xacml:4.0:core:schema
PolicyId: "^example:test"
Version: "1.0"
CombiningAlgId: urn:test:my-custom-combining-alg
CombinerParameter:
- ParameterName: p1
AttributeValue:
DataType: "^string"
value: a
- ParameterName: p2
AttributeValue:
DataType: "^string"
value: b
- ParameterName: p3
PolicyId: "^example:P1"
AttributeValue:
DataType: "^string"
value: c
- ParameterName: p4
PolicyId: "^example:P1"
AttributeValue:
DataType: "^string"
value: d
- ParameterName: p5
AttributeValue:
DataType: "^string"
value: e
- ParameterName: p6
AttributeValue:
DataType: "^string"
value: f
- ParameterName: p7
PolicyId: "^example:PS1"
AttributeValue:
DataType: "^string"
value: g
- ParameterName: p8
PolicyId: "^example:PS1"
AttributeValue:
DataType: "^string"
value: h
- ParameterName: p9
AttributeValue:
DataType: "^string"
value: i
- ParameterName: p10
AttributeValue:
DataType: "^string"
value: j
PolicyIdReference:
- "^example:P1"
- "^example:PS1"
...and yes, this could just as easily apply to the Combing Algorithm identification as well.
Curious what others think.
thanks
b