Repository navigation
Add application-controlled security policies for kubeconfig exec plugins - #1930
brendandburns with Copilot wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
|
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
|
@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. |
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Added the README clarification in commit |
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Allowlist mode now blocks PATH, dynamic-loader variables, and common language-runtime injection variables while allowing ordinary overrides such as |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
|
|
||
| private static bool IsDangerousEnvironmentVariable(string name) | ||
| { | ||
| return name != null && (string.Equals(name, "PATH", StringComparison.OrdinalIgnoreCase) || |
| string.Equals(name, "DOTNET_STARTUP_HOOKS", StringComparison.OrdinalIgnoreCase) || | ||
| string.Equals(name, "CORECLR_ENABLE_PROFILING", StringComparison.OrdinalIgnoreCase) || | ||
| name.StartsWith("CORECLR_PROFILER", StringComparison.OrdinalIgnoreCase) || | ||
| string.Equals(name, "COR_ENABLE_PROFILING", StringComparison.OrdinalIgnoreCase) || | ||
| name.StartsWith("COR_PROFILER", StringComparison.OrdinalIgnoreCase) || | ||
| string.Equals(name, "BASH_ENV", StringComparison.OrdinalIgnoreCase) || | ||
| string.Equals(name, "PYTHONUSERBASE", StringComparison.OrdinalIgnoreCase)); |


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.