You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add application-controlled security policies for kubeconfig exec plugins - #1930
Untrusted kubeconfigs can launch arbitrary local processes through exec credential plugins. This adds application-controlled authorization without requiring callers to parse and inspect kubeconfig themselves.
Policy API: Immutable AllowAll (default), DenyAll, and Allowlist policies across configuration builders, including Classic and AOT. Existing API signatures remain available.
Enforcement: Checks initial execution and token refresh before process launch. Denials throw ExecCredentialPluginDeniedException; kubeconfig cannot override the application policy.
Allowlist semantics: Match basenames or exact absolute paths, including Windows UNC paths. Empty lists deny all; invalid entries and quoted commands are rejected. Allowlist mode also rejects kubeconfig-supplied environment overrides to prevent command redirection and loader injection.
Trust boundaries: Basenames permit any matching executable location. Arguments and executable contents are not restricted; the policy is not a sandbox.
varconfig=KubernetesClientConfiguration.BuildConfigFromConfigFile(kubeConfigPath,execCredentialPluginPolicy:ExecCredentialPluginPolicy.DenyAll);// Or explicitly approve credential plugins:varconfig=KubernetesClientConfiguration.BuildConfigFromConfigFile(kubeConfigPath,execCredentialPluginPolicy:ExecCredentialPluginPolicy.Allowlist("kubelogin",@"C:\Program Files\Contoso\trusted-plugin.exe"));
This pull-request has been approved by: Copilot Once this PR has been reviewed and has the lgtm label, please ask for approval from brendandburns. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Details
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
kubernetes-prowBot
added
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
and removed
size/XS
Denotes a PR that changes 0-9 lines, ignoring generated files.
labels
Oct 6, 2026
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Security-sensitive process execution changes span multiple target variants, while the PR explicitly indicates build and security validation remain incomplete.
CopilotAI
changed the title
[WIP] Add security policy support for kubeconfig exec credential plugins
Add application-controlled security policies for kubeconfig exec plugins
Oct 6, 2026
@copilot can you add documentation that this is intended for defense in depth and is not a hard security boundary, loading a kubeconfig from an untrusted source is an inherently dangerous activity and should be handled as part of an overall security model, not relying exclusively on this capability.
@copilot can you add documentation that this is intended for defense in depth and is not a hard security boundary, loading a kubeconfig from an untrusted source is an inherently dangerous activity and...
Added the README clarification in commit 36876d0: the policy is defense in depth, not a hard security boundary, and untrusted kubeconfigs must be addressed within the application's overall security model.
The unconditional ':' check rejects valid Unix executable basenames such as plugin:v2, even though the API accepts command basenames and colon is only special for Windows drive syntax. Restrict the colon check to Windows so valid Unix basenames can be allowlisted.
On Windows, PATHEXT controls shell lookup, but CreateRunnableExternalProcess uses UseShellExecute = false. Native process creation appends .exe to an extensionless command; this resolver can instead select a preceding .com, .bat, or .cmd and pin it into FileName. Enabling an allowlist can therefore launch a different executable or fail on a batch shim where the original command would find an .exe. Use native process-creation extension rules and add a Windows test with competing extensions.
@copilot There are some common environment variables used for exec (e.g. AWS_PROFILE) so I think that blocking all environment variables won't work. Can you focus on just blocking dangerous ones and allowing others
@copilot There are some common environment variables used for exec (e.g. AWS_PROFILE) so I think that blocking all environment variables won't work. Can you focus on just blocking dangerous ones and a...
Allowlist mode now blocks PATH, dynamic-loader variables, and common language-runtime injection variables while allowing ordinary overrides such as AWS_PROFILE. Added coverage and updated the README in commit 0157b92.
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
cncf-cla: noIndicates the PR's author has not signed the CNCF CLA.do-not-merge/work-in-progressIndicates that a PR should not merge because it is a work in progress.size/XLDenotes a PR that changes 500-999 lines, ignoring generated files.
3 participants
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.
Untrusted kubeconfigs can launch arbitrary local processes through exec credential plugins. This adds application-controlled authorization without requiring callers to parse and inspect kubeconfig themselves.
AllowAll(default),DenyAll, andAllowlistpolicies across configuration builders, including Classic and AOT. Existing API signatures remain available.ExecCredentialPluginDeniedException; kubeconfig cannot override the application policy.