kubernetes-sigs / windows-gmsa

External components to support Windows GMSA in Kubernetes
Apache License 2.0
30 stars 57 forks source link

Enhancement request: admission webhook expression filter #148

Open Zombro opened 5 months ago

Zombro commented 5 months ago

issue

gmsa admission webhook intercepts everything, including pods that have nothing to do with gmsa.

image

the gmsa mutating webhook has no object selector / match expressions. it may be preferable to incorporate a few filters as this chart moves forward with k8s.

the easy move forward might be something like an objectSelector that matches a label like gmsa-mutate: true

a more hands-free future solution could leverage match conditions testing existence of spec securityContext.windowsOptions.gmsaCredentialSpecName

references

took a look at - https://github.com/kubernetes-sigs/windows-gmsa/pull/145/files. good. this mostly circumvents the issue.

last year k8s added enhancement to support expression filters in webhooks https://github.com/kubernetes/enhancements/issues/3716, marked stable in v1.30+

k8s docs object filter - start here: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-objectselector, fancy new CEL expressions (1.30+): https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-matchconditions

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

jsturtevant commented 1 month ago

/remove-lifecycle stale

This is something we should probably look into at some point /help

k8s-ci-robot commented 1 month ago

@jsturtevant: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes-sigs/windows-gmsa/issues/148): >/remove-lifecycle stale > >This is something we should probably look into at some point >/help Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.