Description
The exec plugin style allowed for the plugin to be placed in a directory outside of the Kustomize path. This allowed for GitOps based workflows that support Kustomize (e.g. ArgoCD, Red Hat Advanced Cluster Management) to have Kustomize plugins preinstalled that are trusted and supported by the administrator or GitOps tool. For Red Hat Advanced Cluster Management, an exec plugin comes preinstalled and is usable in the GitOps workflow as documented here. We would like to continue a similar approach with the Exec KRM functions.
Based on my understanding of the documentation of the exec KRM plugins, it seems that the plugin must be in the same directory tree as the Kustomize configuration. This means that the GitOps tool must perform some kind of hack to copy the preinstalled plugin into the Kustomize configuration directory and hope that the user specified the correct path in their config.kubernetes.io/function
annotation.
This also means that if a GitOps tool enables Kustomize plugins, it is susceptible to arbitrary code execution since a user can now just include any binary in their Kustomize configuration repo to be run as a plugin. Requiring that exec plugins be in a directory tree outside of the user provided Kustomize configuration guarded against this.
I see two options to rectify this:
- Add a configuration option/environment variable that sets the directory where plugins are located and the user specifies the plugin by name rather than by path in their
config.kubernetes.io/function
annotation. - Add an allow list option of plugins that can be executed either by name or by digest. This would at least allow the hacky approach of copying the preinstalled plugin into the user provided Kustomize configuration repo when cloned down without exposing the GitOps tool to running a binary provided by the user.