Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand Kubernetes examples for multiple categories of CEL use #41

Open
liggitt opened this issue Nov 3, 2023 · 2 comments
Open

Expand Kubernetes examples for multiple categories of CEL use #41

liggitt opened this issue Nov 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@liggitt
Copy link

liggitt commented Nov 3, 2023

Feature Description

The existing Kubernetes examples in the drop-down are really nice, but CEL is supported in multiple contexts in Kubernetes, which have their own distinct inputs, documentation, and expected return types:

  1. CRD validation rules
    • self / oldSelf variables contain data
    • boolean return value is expected
  2. Admission webhook matchConditions and ValidatingAdmissionPolicy expressions
    • object / oldObject variables contain data, request..., params, namespaceObject variables contain metadata, authorizer variable allows access to authorization functions
    • boolean return value is expected
  3. OIDC claim mapping and user validation rules (new in 1.29, configured via file in kube-apiserver arg, design, in-progress docs)
    • claims variable contains claim data for validation (boolean return value) or extracting (string / string array return value, depending on the context)
    • user variable contains user info for validation
    • boolean return value is expected
  4. Authorization matchConditions (new in 1.29, configured via file in kube-apiserver arg, design, in-progress docs)
    • request variable contains SubjectAccessReview data
    • boolean return value is expected

The existing examples could be even more useful with some additions:

  1. examples per category
  2. links to docs for that category
  3. access to functions (like authorizer) with mocked return values available to that category
  4. type checking of the expected return value(s) for that category
@liggitt liggitt added the enhancement New feature or request label Nov 3, 2023
@knrc
Copy link
Contributor

knrc commented Nov 4, 2023

Thanks for these @liggitt, they are very useful. #33 makes a start on some of these items, however there's still more to go

@knrc
Copy link
Contributor

knrc commented May 7, 2024

We have a PR about to merge which will cover some of these use cases. The PR introduces support for ValidatingAdmissionPolicy (except parameters) and the Admission Webhooks.

@knrc knrc mentioned this issue Aug 12, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants