Policy Language

From MgmtWiki
Jump to: navigation, search

Full Title or Meme

A description of the syntax and semantics of a machine-readable Language to enable access decisions.

Context

There are two broad areas of policy:

  1. Business rules
  2. Government Legislation and Regulation (which can include regulations that are situationally dependent like health or emergency.)

Existing Languages

Originally these languages were all written by geeks, and for geeks. What is needed is some policy that works in a real-world user journey. In other words, the user needs to be able to understand what is expected and when. It might be that a Policy Language can be a meta language that can be translated into commonly used language so that the user can understand the impact of the policy, or it might be that the Policy Language is only used to move the policy from one machine to another, but even then debugging would be easier if the Policy Language could be rendered into something that a human could understand.

Cedar

Cedar is a policy syntax invented by Amazon. It's used by the AWS Verified Permissions, Authz-as-a-Service offering. Gluu is working on a new product at the Janssen Project called the "Cedarling"--which leverages the Cedar policy syntax and Amazon's open source Cedar Rust engine. The Cedarling can run anywhere--as a local agent in the browser, embedded in a mobile application, or as a cloud service. It needs no data, because it trusts the JWT tokens that are input to the request by the application. Beyond policy evaluation, the Cedarlng agent has two other capabilities: JWT validation and audit logging. In this episode, Mike will present Gluu's current progress on the Cedarling and show a demo of the Cedarling in action!

Cedarling provides an app that creates its own instance ID. This is part of opensource Jensen project.

Cedar is a new authorization-policy language used by the Amazon Verified Permissions and AWS Verified Access managed services, and we recently released it publicly. Using Cedar, developers can write policies that specify fine-grained permissions for their applications. The applications then authorize access requests by calling Cedar’s authorization engine. Because Cedar policies are separate from application code, they can be independently authored, updated, analyzed, and audited. [1]

Rego

https://www.openpolicyagent.org/docs/latest/policy-language/


https://medium.com/@bhavini_sehgal/exploring-role-based-access-control-rbac-and-rego-a-simplified-guide-to-policy-management-932db0fcdf97

Graph Query Lanage

https://graphql.org/

Open Policy Agent

OPA, the Open Policy Agent

  • Declarative. Express policy in a high-level, declarative Policy Language that promotes safe, performant, fine-grained controls. Use a language purpose-built for policy in a world where JSON is pervasive. Iterate, traverse hierarchies, and apply 150+ built-ins like string manipulation and JWT decoding to declare the policies you want enforced.
  • Context-aware. Leverage external information to write the policies you really care about. Stop inventing roles that represent complex relationships that years down the road no one will understand. Instead, write logic that adapts to the world around it and attach that logic to the systems that need it.

Cardea

They have been working with the government of Aruba and come up with the most through look at the problem in 2022. The have picked the unfortunate name of Machine Readable Governance, but it really is a description of the government's policy. Unfortunately, it might change daily and does not meet the requirement of testing by the user and remaining valid for even the duration of a flight from the US to the island.

XACML

  • XACML 3.0 core spec.
  • This spec is written in XML with no regard of size of the message. XML can easily be converted to json and this is the spec that describes that process.
  • While it is oriented to an overly complex structure using monolithic designs, it has well-thought-out elements that should remain useful in the domain where it was applied. It is less useful in new areas like application of areas like COVID Vaccination.
  • A lot of the language used below is taken from the XACML spec. For example:
    • PDP = policy definition point
    • PEP = policy execution point

LegalRuleML

Is an OASIS spec that attempts to turn law into machine readable format. This wiki page is focused more on the application of the policy to access control.

  • Converting law, written in English (in the US) to a policy to be applied for access control is insanely difficult.[2] Typically the programmer will be given a design document that is coded and ship before the lawyers are asked to adjudicate some discrepancy. Trying to engage the lawyers at the start of the process might sound better, unless you were a program manager with a schedule to keep. And a policy is a basically a programmer's view of the policy in the spec. The likelihood of error is close to one.
  • Adam Wyner commented:
It is very welcome to see a discussion in the ACM about artificial intelligence/computer science applied to law. Applications to tax go all the way back to 1977 with the Taxman system and subsequent work:
https://www.jstor.org/stable/1340132
Further work on AI and Law can be found on the International Association for Artificial Intelligence and Law:
http://www.iaail.org/
and the Journal of Artificial Intelligence and Law:
https://www.springer.com/journal/10506

Drools

  • Supposedly this is open, which apparently applies to the java code implementation which is at the following site.
  • Drools documentation.
  • "Drools is Rule Engine or a Production Rule System that uses the rule-based approach to implement and Expert System. Expert Systems are knowledge-based systems that use knowledge representation to process acquired knowledge into a knowledge base that can be used for reasoning."
  • The rules supported by Drools look a lot like a domain specific programming language, not a business rules language.

HL7 CQL

  • Clinical Quality Language (CQL) is a high-level, domain-specific language focused on clinical quality and targeted at measure and decision support artifact authors.
  • In addition, this specification describes a machine-readable canonical representation called Expression Logical Model (ELM) targeted at implementations and designed to enable sharing of clinical knowledge.

Microsoft ADMX Group Policy Language

Current Activity

IETF

The first attempt at A Policy Framework Charter (2004-11-05) expired two decades ago.

CAREDA

User Agent Example

This section shows the requirements placed on a User Agent by some corresponding site, which could include sources like private data or user credentials. User agents are code provided by a trusted source that can act on behalf of the holder of the device that contains an instance of the User Agent. Note that some parts of the User Agent may be cloud based, but the device resident part will be able to function even if the cloud is inaccessible.

  1. A Trusted Execution Environment (TEE, TPM, Secure Enclave, etc.) may be required on the holder's device.
  2. Similar to a local firewall or the ICS (Internet Connection Sharing) on Windows a policy that either blocks or allows URLs.
  3. An internal firewall may limit access to specified site names or IP addresses depending on the data access rules.
  4. Protection of user private keys may be required to be protected in a TEE.
  5. Some classes of data may be required to be encrypted at rest by a key held the the TEE.
  6. Data in motion may require a TLS of a particular level (eg. 1.3) to share data.
  7. The screen capture functionality may be blocked to prevent data exfiltration.
  8. The user presence at the device may be required for zero access requests.
  9. Continued user liveness tests at the device may be required continuously or all access will be blocked.
  10. A collection of Trust Zones or Federations may be required to access data bound to them.

References

  1. Mike Hicks How we built Cedar with automated reasoning and differential testing 2023-05-19 https://www.amazon.science/blog/how-we-built-cedar-with-automated-reasoning-and-differential-testing
  2. Esther Shein, Converting Laws to Programs pp 15-16 (2022-01) Communications of the ACM Vol. 65 No 1 https://m.acmwebvm01.acm.org/magazines/2022/1/257436-converting-laws-to-programs/fulltext

Other Material