OASIS eXtensible Access Control Markup Language (XACML) TC

 View Only
  • 1.  global entity outside-the-box ruminations...

    Posted 02-11-2025 18:42
    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



  • 2.  RE: global entity outside-the-box ruminations...

    Posted 02-12-2025 22:30

    The URIs take up a lot of real estate in a policy even in XML but it will be more apparent in a less verbose syntax like YAML, and most of it is repetitive. A good-quality PAP would shield the policy writer from that, but there aren't many of those and it seems the common PAP experience isn't much better than a plain text editor, so making the text more readable would be an advantage for perception and practical reality for many. Reducing the byte size of the policies doesn't hurt either.

    You are clearly looking for something that is part of the core language, that is faithfully preserved in translations between the different policy syntaxes, rather that applying some sort of preprocessing. That means that the type of a field like DataType can't just be anyURI anymore. It also needs to be able to carry the name of an entity and optional extra text (typically a suffix). We already have a data-type called entity so we should use a different name for these things. For the sake of argument I'll call them labels. So a field like DataType needs to be able to hold a URI or a text string with embedded label names. We could try to express that in the policy syntax type system (XML Schema, JSON Schema, ...). However, if we restrict the use of labels to fields for URIs (the main culprits) then we could just define an IdentifierType as a replacement for the current anyURI that is formally a string in the type system but in prose is required to be a URI after the substitution of any label names.

    You alluded to global variables so I assume you are thinking that the label definitions are constructs separate from policies. That certainly reduces duplication since many policies can then share the same label definitions. An advantage of URIs is that they are globally unique. The appeal of labels is that they are short and simple, so not globally unique. Any situation where policies from different sources are composed together runs the risk of label name conflicts. To avoid that I suggest lumping label definitions into collections that are identified with a URI, and have policies list, by URI, any collections they are using. Policies from different sources would bring their own label collections, which they unambiguously reference, avoiding name conflicts.

    We could define a standard label collection for all the standard-defined URIs as a convenience.



    ------------------------------
    Steven Legg
    Product Architect
    ViewDS Identity Solutions
    Melbourne VIC
    ------------------------------



  • 3.  RE: global entity outside-the-box ruminations...

    Posted 02-12-2025 23:31
    Yes, this is a nice interpretation of what I was thinking...label could work but I think it has a reserved meaning in YAML. I have noticed that as we try to span schematic domains that the list of reserved words grows. I'm sure we can find something if the idea makes sense to pursue by the TC ("notion", "ref"...doodad? ��)

    " To avoid that I suggest lumping label definitions into collections that are identified with a URI, and have policies list, by URI, any collections they are using. Policies from different sources would bring their own label collections, which they unambiguously reference, avoiding name conflicts."

    I like that idea. 

    b





  • 4.  RE: global entity outside-the-box ruminations...

    Posted 02-13-2025 23:16

    > I'm sure we can find something if the idea makes sense to pursue by the TC ("notion", "ref"...doodad? ��)

    Shortcut?

    We would want to be able to easily tell the difference between a literal URI and a label surrounded by URI parts without imposing the need to apply escaping to any characters in a URI. These characters aren't allowed in a URI: "<>\^`{|} so we can use any of them to introduce a label. Your example used ^ at the start. That's okay, but without a distinct end character the label can only be followed by URI characters that can't be part of a label name, so ^label/foo is good but ^labelfoo isn't. If we wrap the label there is no restriction on what follows, e.g., <label>foo or {label}foo . And do we have a special case for a field value that is just a label name? So DataType="^string" or DataType="{string}" is the same as DataType="string". This would align with what the JSON REST profile is already doing.



    ------------------------------
    Steven Legg
    Product Architect
    ViewDS Identity Solutions
    Melbourne VIC
    ------------------------------



  • 5.  RE: global entity outside-the-box ruminations...

    Posted 02-14-2025 13:03
    > Shortcut?

    That could work. Maybe "short" (for brevity? ...I'm on a mission! ��)

    Some other ideas: 

    • "alt" (HTML bleed over, but clean in XML, JSON, YAML)
    • "mask"
    • "facade" (Sorry for misspelling, Cyril ��)
    • "guise"
    • "trunc"
    • "nub"
    • "gist"

    +1 on the wrapping idea. I also like it because it calls out the "representative" nature of the value in our context.

    b



    On Feb 13, 2025, at 8:16 PM, Steven Legg via OASIS <Mail@mail.groups.oasis-open.org> wrote:







  • 6.  RE: global entity outside-the-box ruminations...

    Posted 02-16-2025 18:34

    > Maybe "short" (for brevity? ...I'm on a mission! ��)

    There isn't a strong case for brevity in what we call these things. The concept name would appear once in a policy to introduce the references to collections (XXXCollections). A short concept name here wouldn't make much difference (and be incongruous) since we have stayed with meaningful field names elsewhere in a policy. The collections themselves carry the concept name (XXXCollection), but I anticipate only one or a few of those. The items (XXX) in the collection would be more numerous, but still only once per distinct URI and a lot shorter than the URI they bind to the text string.



    ------------------------------
    Steven Legg
    Product Architect
    ViewDS Identity Solutions
    Melbourne VIC
    ------------------------------