Knowledge

Abbreviated Language for Authorization

Source 📝

562:/** * Control access to medical records */ policy accessMedicalRecord{ target clause actionId == "view" and objectType == "medical record" apply firstApplicable /** * Doctors can view medical records of patients they are assigned to */ rule allowRegularAccess{ target clause user.role == "doctor" condition patient.assignedDoctor == user.identifier permit } /** * Doctors can view any medical reason in the case of an emergency */ rule allowBreakTheGlassAccess{ target clause isEmergency == true permit on permit{ obligation auditLog{ message = "A doctor has gotten access to a medical record by breaking the glass" user.identifier = user.identifier record.identifier = record.identifier currentDateTime = currentDateTime } } } /** * Deny other accesses. If access is normally denied, tell doctors how * they can get access by "breaking the glass". */ rule denyAccess{ deny on deny{ obligation breakTheGlass{ message = "You do not have access to this medical record. To be granted access, set the isEmergency flag to true." record.identifier = record.identifier currentDateTime = currentDateTime } } } } } 543:"com.axiomatics.examples.user.role" type = string } attribute identifier{ category = subjectCat id = "com.axiomatics.examples.user.identifier" type = string } } namespace patient{ attribute assignedDoctor{ category = resourceCat id = "com.axiomatics.examples.user.assignedDoctor" type = string } } namespace record{ attribute identifier{ category = resourceCat id = "com.axiomatics.examples.record.identifier" type = string } } attribute actionId{ category = actionCat id = "com.axiomatics.examples.actionId" type = string } attribute objectType{ category = resourceCat id = "com.axiomatics.examples.objectType" type = string } attribute isEmergency{ category = environmentCat id = "com.axiomatics.examples.isEmergency" type = boolean } attribute message{ category = environmentCat id = "com.axiomatics.examples.message" type = string } 529:
between 9 and 5 */ rule denyOutsideHours{ target clause currentTime<"09:00:00":time or currentTime>"17:00:00":time deny on deny{ advice notify{ acme.obligations.message = "You cannot access this service outside office hours" } } } /** * This rule grants managers access */ rule allowManagers{ target clause acme.user.role=="manager" permit } /** * This rule catches anything else that might have fallen to this point */ rule failsafeDeny{ deny on deny{ advice notify{ acme.obligations.message = "Your request did not match the policy. Please try again" } } } } }
628:* Access to progress notes */ policy progressNotes{ target clause objectType=="progress note" apply firstApplicable /* * A primary physician can create a patient's progress note */ rule createNote{ target clause role=="physician" and action=="create" condition primaryPhysician==requestorId permit } /* * A physician can update a patient's progress note he/she wrote themselves */ rule updateNote{ target clause role=="physician" and action=="update" condition author==requestorId permit } /* * Safety rule to explicitly deny access unless one of the matching rules above has been matched */ rule safetyHarness{ deny } } 33: 220:, the eXtensible Access Control Markup Language, uses XML as its main encoding language. Writing XACML policies directly in XACML leads to bloated, human-unfriendly text, therefore a new, more lightweight, notation was necessary. Axiomatics researcher, Pablo Giambiagi, therefore designed ALFA, the Axiomatics Language for Authorization. 514:
namespace com.axiomatics{ namespace example{ /** * A policy about what managers can do. It is linked to from the * documents policy set. */ policy managers{ target clause role == "manager" apply firstApplicable rule allowSameDepartment{ condition user.department
287:
Like in XACML, a PolicySet can contain PolicySet and Policy elements. A Policy can contain Rule elements. A Rule contains a decision (either Permit or Deny). In addition, in ALFA, it's possible to add Rule elements to PolicySet and Policy elements. PolicySet, Policy, and Rule elements can be nested
528:
namespace example{ import Attributes.* advice notify = "example.notify" policy readDocuments{ target clause actionId=="read" and objectType=="document" apply firstApplicable /** * This rule denies access if the time is not
484:
The following ALFA example represents a XACML policy which contains a single rule. The policy and rule both have a target. The rule also has a condition which is used to compare 2 attributes together to implement a relationship check (user ID must be equal to owner). Whenever one needs to check 2
571:
The following is an example of an ABAC policy implemented using ALFA. It uses time as attributes. It uses a XACML condition to compare the currentTime attribute to the value representing 5pm (expressed in 24-hour time). Note the use of :time to convert the String value to the right data type.
307:
Core Specification. Some datatypes e.g. numerical (integer, double) and boolean map directly from ALFA to XACML. Others need to be converted such as date or time attributes. To convert an attribute into the relevant data type, use the "value":datatype notation. See below for examples
500:
namespace exampleTime{ policy checkTimeAccess { apply firstApplicable rule checkNightAccess { target clause role == "supervisor" and document == "medicalrecord" condition timeInRange(timeOneAndOnly(currentTime), "22:00:00":time,
515:== document.department permit } } } /** * The main policy. It references the managers policy */ policyset documents{ target clause resourceType == "document" apply firstApplicable // The following is a policy reference example.managers } } 542:
namespace com.axiomatics.examples{ import Attributes.* obligation breakTheGlass = "com.axiomatics.examples.breakTheGlass" obligation auditLog = "com.axiomatics.examples.auditLog" namespace user{ attribute role{ category = subjectCat id =
325:
namespace exampleBoolean{ policy article{ target clause userRole == "editor" and actionId == "edit" and itemType=="article" apply firstApplicable rule publishedArticles{ target clause published == true permit } } }
489:
namespace example{ policy article{ target clause itemType=="article" apply firstApplicable rule editArticle{ target clause actionId == "edit" and userRole == "editor" permit condition userId == owner } } }
625: 626:
https://web.archive.org/web/20160304081703/http://wiki.hl7.org/index.php?title=Security_and_Privacy_Ontology_Use_Cases#Access_Control_Based_on_Category_of_Action#Access_Control_Based_on_Category_of_Action
524:
Obligations and advice are statements in XACML that can be returned from the PDP to the PEP alongside the decision (Permit, Deny...). Obligations and advice are triggered on either Permit or Deny.
654:
The ALFA Plugin for Eclipse is a tool that converts your Eclipse programming IDE to a dedicated editor of authorization policies using ALFA syntax. ALFA policies can then easily be converted into
783: 236: 257:
Insurance use case: an insurance agent can approve the claim of a user if the claim is in the same region as the agent and if the claim amount is less than the agent's approval amount.
180: 642:
A free extension for the VS Code editor that supports code completion, syntax highlighting, refactoring, and go-to-definition navigation. It can also compile ALFA into
607: 291:
In order to resolve conflicts between siblings, ALFA (as does XACML) uses combining algorithms. There are several combining algorithms that may be used.
676: 261:
The words doctor, view, medical record, Singapore... are all examples of attribute values. Attributes make up the building blocks of policies in
800: 698: 820: 147: 43: 184: 50: 757: 399: 262: 17: 384: 254:
Financial use case: employees in Singapore can view the customer accounts of employees based in Singapore.
389: 379: 316:
String, integer, double, and boolean all map directly from ALFA to XACML. They do not need a conversion
394: 769: 722: 242:
ALFA was consequently renamed Abbreviated Language for Authorization and filed for standardization.
805: 201: 510:
ALFA can use policy (set) references. They are in fact used implicitly when doing the following.
251:
Medical use case: doctors can view the medical records of patients they have a relationship with.
81: 746: 557:
the third rule is the rule that triggers the obligation telling the user how to break the glass.
551:
the first rule is for normal access (doctors can view records of patients they are assigned to.
76: 8: 126: 98: 374: 369: 677:"Axiomatics releases free plugin for the Eclipse IDE to author XACML3.0 policies" 465:
target clause url == "http://<host>:<port>/profile/":anyURI
88: 364: 814: 359: 311: 758:
https://www.identityserver.com/documentation/enforcer/alfa/QuickGuideToAlfa/
349: 354: 554:
the second rule is for special access because the glass has been broken.
344: 339: 300: 806:
A Template-Based Policy Generation Interface for RESTful Web Services
330: 239:
XACML Technical Committee in order to advance its standardization.
699:"Simplifying XACML – the Axiomatics ALFA plugin for Eclipse IDE" 658:
3.0 policies and loaded into your XACML policy management tool.
235:
In March 2014, Axiomatics announced it was donating ALFA to the
566: 494: 335:
The following attribute datatypes need an explicit conversion:
479: 747:
https://www.linkedin.com/grp/post/3934718-5851696088934801412
655: 643: 618: 304: 217: 168: 624:/* * Access Control Based on Category of Action * URL: 312:
Native attribute values mapped directly from ALFA to XACML
603: 533: 164: 319: 400:
urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression
223:
ALFA maps directly into XACML. ALFA contains the same
273:
Just like XACML, ALFA has three structural elements:
139: 587:
condition currentTime > "17:00:00":time
501:"06:00:00":time) permit } } } 405: 204:
used in the formulation of access-control policies.
230: 538:Start by defining the attributes and obligations: 375:http://www.w3.org/2001/XMLSchema#yearMonthDuration 331:Attribute values which need an explicit conversion 385:urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name 812: 410:This policy, converts a String value to anyURI. 390:urn:oasis:names:tc:xacml:2.0:data-type:ipAddress 370:http://www.w3.org/2001/XMLSchema#dayTimeDuration 613: 485:attributes together, they must use a condition. 380:urn:oasis:names:tc:xacml:1.0:data-type:x500Name 395:urn:oasis:names:tc:xacml:2.0:data-type:dnsName 365:http://www.w3.org/2001/XMLSchema#base64Binary 674: 567:Time-based fine-grained authorization policy 547:The policy can now be defined with 3 rules: 495:Using time in a XACML policy written in ALFA 606:defines a series of medical access control 480:A simple policy & rule with a condition 227:as XACML i.e. PolicySet, Policy, and Rule. 784:"How Can I Use Policy References in ALFA?" 619:Access control based on category of action 360:http://www.w3.org/2001/XMLSchema#hexBinary 519: 350:http://www.w3.org/2001/XMLSchema#dateTime 355:http://www.w3.org/2001/XMLSchema#anyURI 14: 813: 794: 534:Break the glass authorization scenario 194:Abbreviated Language for Authorization 649: 610:which can be easily defined in ALFA. 345:http://www.w3.org/2001/XMLSchema#date 340:http://www.w3.org/2001/XMLSchema#time 637: 505: 320:ALFA policy using boolean attributes 26: 439:"userDisallowedResources" 245: 24: 770:"ALFA - Visual Studio Marketplace" 632: 474: 25: 832: 801:European analysts talk about ALFA 406:Example: ALFA policy using anyURI 53:and remove advice or instruction. 231:Axiomatics donates ALFA to OASIS 154:Axiomatics, Rock Solid Knowledge 31: 821:XML-based programming languages 593: 93:Pablo Giambiagi, David Brossard 776: 762: 751: 740: 715: 691: 668: 303:that are defined in the OASIS 224: 13: 1: 675:Gebel, Gerry (16 July 2012). 661: 294: 614:Sample ALFA policies for HL7 598: 268: 7: 10: 837: 265:and consequently in ALFA. 207: 212: 179: 174: 163: 158: 153: 145: 135: 125: 107: 97: 87: 75: 723:"XACML 3, section 4.2.3" 574: 560: 540: 526: 512: 498: 487: 455: 412: 323: 202:domain-specific language 418:userDisallowedResources 82:Declarative programming 520:Obligations and advice 299:ALFA supports all the 113:; 12 years ago 51:rewrite this article 795:External References 225:structural elements 127:Filename extensions 108:First appeared 72: 650:Plugin for Eclipse 461:allowProfileAccess 288:or referenced to. 111:July 16, 2012 70: 638:VS Code extension 506:Policy references 190: 189: 68: 67: 44:a manual or guide 16:(Redirected from 828: 788: 787: 780: 774: 773: 766: 760: 755: 749: 744: 738: 737: 735: 733: 727: 719: 713: 712: 710: 709: 695: 689: 688: 686: 684: 672: 588: 585: 581: 578: 469: 466: 462: 459: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 246:Sample use cases 121: 119: 114: 89:Designed by 73: 69: 63: 60: 54: 42:is written like 35: 34: 27: 21: 836: 835: 831: 830: 829: 827: 826: 825: 811: 810: 797: 792: 791: 782: 781: 777: 768: 767: 763: 756: 752: 745: 741: 731: 729: 725: 721: 720: 716: 707: 705: 697: 696: 692: 682: 680: 673: 669: 664: 652: 640: 635: 633:Implementations 630: 629: 621: 616: 601: 596: 591: 590: 586: 583: 579: 576: 569: 564: 563: 545: 544: 536: 531: 530: 522: 517: 516: 508: 503: 502: 497: 492: 491: 482: 477: 475:Sample policies 472: 471: 467: 464: 460: 457: 454: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 417: 414: 408: 333: 328: 327: 322: 314: 297: 271: 248: 233: 215: 210: 148:implementations 117: 115: 112: 64: 58: 55: 48: 36: 32: 23: 22: 15: 12: 11: 5: 834: 824: 823: 809: 808: 803: 796: 793: 790: 789: 775: 761: 750: 739: 714: 690: 666: 665: 663: 660: 651: 648: 639: 636: 634: 631: 623: 622: 620: 617: 615: 612: 600: 597: 595: 592: 575: 568: 565: 561: 559: 558: 555: 552: 541: 535: 532: 527: 521: 518: 513: 507: 504: 499: 496: 493: 488: 481: 478: 476: 473: 456: 413: 407: 404: 403: 402: 397: 392: 387: 382: 377: 372: 367: 362: 357: 352: 347: 342: 332: 329: 324: 321: 318: 313: 310: 296: 293: 285: 284: 281: 278: 270: 267: 259: 258: 255: 252: 247: 244: 232: 229: 214: 211: 209: 206: 188: 187: 177: 176: 172: 171: 161: 160: 156: 155: 151: 150: 143: 142: 137: 133: 132: 129: 123: 122: 109: 105: 104: 101: 95: 94: 91: 85: 84: 79: 66: 65: 39: 37: 30: 9: 6: 4: 3: 2: 833: 822: 819: 818: 816: 807: 804: 802: 799: 798: 786:. 2016-10-10. 785: 779: 772:. 2021-09-10. 771: 765: 759: 754: 748: 743: 724: 718: 704: 703:KuppingerCole 700: 694: 678: 671: 667: 659: 657: 647: 645: 627: 611: 609: 605: 580:allowAfter5pm 573: 556: 553: 550: 549: 548: 539: 525: 511: 486: 411: 401: 398: 396: 393: 391: 388: 386: 383: 381: 378: 376: 373: 371: 368: 366: 363: 361: 358: 356: 353: 351: 348: 346: 343: 341: 338: 337: 336: 317: 309: 306: 302: 292: 289: 282: 279: 276: 275: 274: 266: 264: 256: 253: 250: 249: 243: 240: 238: 228: 226: 221: 219: 205: 203: 199: 195: 186: 182: 178: 173: 170: 166: 162: 159:Influenced by 157: 152: 149: 144: 141: 138: 134: 130: 128: 124: 110: 106: 102: 100: 96: 92: 90: 86: 83: 80: 78: 74: 62: 52: 47: 45: 40:This article 38: 29: 28: 19: 778: 764: 753: 742: 730:. Retrieved 717: 706:. Retrieved 702: 693: 681:. Retrieved 679:. Axiomatics 670: 653: 641: 602: 594:HL7 policies 570: 546: 537: 523: 509: 483: 409: 334: 315: 298: 290: 286: 272: 260: 241: 234: 222: 216: 197: 193: 191: 56: 49:Please help 41: 18:ALFA (XACML) 708:2017-02-10 662:References 430:subjectCat 301:data types 295:Data types 175:Influenced 140:alfa.guide 118:2012-07-16 103:Axiomatics 608:use cases 599:Use cases 415:attribute 277:PolicySet 269:Structure 99:Developer 59:June 2023 815:Category 424:category 77:Paradigm 728:. OASIS 208:History 200:) is a 136:Website 116: ( 683:31 May 584:permit 468:permit 448:string 280:Policy 213:Origin 146:Major 732:2 May 726:(PDF) 656:XACML 646:3.0. 644:XACML 305:XACML 237:OASIS 218:XACML 185:Cedar 169:XACML 131:.alfa 734:2021 685:2017 577:rule 458:rule 442:type 283:Rule 263:ABAC 198:ALFA 192:The 181:Rego 71:ALFA 604:HL7 165:XML 817:: 701:. 589:} 582:{ 470:} 463:{ 433:id 183:, 167:, 736:. 711:. 687:. 451:} 445:= 436:= 427:= 421:{ 196:( 120:) 61:) 57:( 46:. 20:)

Index

ALFA (XACML)
a manual or guide
rewrite this article
Paradigm
Declarative programming
Designed by
Developer
Filename extensions
alfa.guide
implementations
XML
XACML
Rego
Cedar
domain-specific language
XACML
structural elements
OASIS
ABAC
data types
XACML
http://www.w3.org/2001/XMLSchema#time
http://www.w3.org/2001/XMLSchema#date
http://www.w3.org/2001/XMLSchema#dateTime
http://www.w3.org/2001/XMLSchema#anyURI
http://www.w3.org/2001/XMLSchema#hexBinary
http://www.w3.org/2001/XMLSchema#base64Binary
http://www.w3.org/2001/XMLSchema#dayTimeDuration
http://www.w3.org/2001/XMLSchema#yearMonthDuration
urn:oasis:names:tc:xacml:1.0:data-type:x500Name

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.