feat(helm): Add configurable reinvocationPolicy for MutatingWebhookConfiguration#501
Open
EscobozaEstrada wants to merge 1 commit intoCrowdStrike:mainfrom
Conversation
…er.webhook Expose Kubernetes reinvocationPolicy (default Never, configurable to IfNeeded) in the Falcon Sensor Helm chart. All webhook values are now consistently nested under .Values.container.webhook. Updated README and values.yaml for consistency.
Author
|
@mr-jungchoi please review this pr. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces support for configuring the
reinvocationPolicyfield on the Falcon SensorMutatingWebhookConfigurationresource via a new Helm value. The default behavior (Never) is preserved, maintaining full backward compatibility.Motivation
In clusters running multiple mutating admission webhooks — such as Kyverno or OPA Gatekeeper — webhook execution ordering can result in scenarios where a subsequent webhook modifies a Pod after the Falcon Injector has already evaluated it. In such cases, Kubernetes does not automatically re-invoke earlier webhooks, which can cause the Falcon sensor sidecar to be omitted from the final Pod spec.
The Injection Annotation Problem
A concrete and common example of this is the Falcon injection opt-in annotation:
Some teams use policy controllers (e.g., Kyverno
ClusterPolicyor OPAAssignMetadata) to dynamically add this annotation to Pods at admission time — rather than hardcoding it in every workload manifest. However, if the policy controller's webhook runs after the Falcon webhook, the following race condition occurs:Setting
reinvocationPolicy: IfNeededresolves this by instructing the Kubernetes API server to re-invoke the Falcon webhook whenever a later admission controller mutates the object, ensuring the annotation is visible during Falcon's evaluation.The Kubernetes
reinvocationPolicy: IfNeededsetting instructs the API server to re-invoke a webhook if the object is mutated by a later admission controller. Exposing this field as a configurable Helm value allows operators to opt into this behavior without requiring manual patch operations on the webhook resource.This is particularly relevant in Amazon Elastic Kubernetes Service (EKS) environments, where AWS-managed admission controllers may interfere with webhook evaluation order.
Changes
New Helm Value
A new optional value has been added under
container.webhook:Template Update
templates/container_deployment_webhook.yamlnow rendersreinvocationPolicydynamically:Documentation
values.yaml— documents the newreinvocationPolicyfield with its default value and accepted options.README.md— updated to reflect the new parameter under thecontainer.webhookconfiguration table..Values.container.webhookfor structural consistency.Backward Compatibility
reinvocationPolicybehaviorNever)values.yamloverridesExample Usage
To enable re-invocation when running alongside other mutating webhooks:
Validation
helm lintpasses with both default and overridden valueshelm templaterenders the correctreinvocationPolicyfield in theMutatingWebhookConfigurationreinvocationPolicy: Never(default) andIfNeeded(override)References