Skip to content

Changing semantics of unspecified appliesTo.principalTypes/appliesTo.resourceTypes #351

@max2me

Description

@max2me

Category

Cedar validation features

Describe the feature you'd like to request

Current behavior
In Cedar 2.x, if action's appliesTo.principalTypes or appliesTo.resourceTypes is not given (or if entire appliesTo element is given), then it's interpreted as action that applies to all principal types and resource types.

Challenges
Discussion of RFC 24 highlighted challenges this introduces, primarily the risk of unintentionally specifying that action applies to all principal types / resource types and related complications it causes for analysis and experience of actual policy validation as error messages become more confusing.

Feature request
We can mitigate challenges listed above by making following changes:

  • Specified appliesTo but ommited appliesTo.principalTypes / appliesTo.resourceTypes means that request component is unspecified, i.e., corresponding to the None option in the principal and/or resource component of a Request.
  • Omitted appliesTo means that action cannot be used in a request is used exclusively as an action group
  • Disallow empty arrays for appliesTo.principalTypes / appliesTo.resourceTypes
  • Disallow empty appliesTo attribute thus requiring at least one of principalTypes, resourceTypes or context to be specified if appliesTo is specified.

Describe alternatives you've considered

  • Keeping it as is
  • Improving documentation / tooling
  • Introducing explicit way of specifying that action applies to all principal types / all resource types

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis issue requets a substantial new featurerequires-RFCThis issue requests a substanial change to the Cedar langauge which needs to follow the RFC process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions