Closed uberspot closed 5 years ago
I think this needs a bit more discussion on the user experience. Does it make sense to use/abuse the secrets system for such feature? Is an exec
type really necessary? Should it be a function instead?
I also think the best solution is actually to allow the user to define custom functions for their templates
@uberspot . Exec feature can also be abused. Like running some malicious command. Though we can put some checks that only specific commands are allowed like in eval_func
. https://github.com/deepmind/kapitan/blob/master/kapitan/refs/functions.py#L30
Those malicious commands will have to be coming from the developers themselves I assume. We could start with a list of allowed commands but sanitizing these seems like extra effort to restrict the developers themselves. Kapitan isn't meant to handle external/unsanitised user input anyway. It's a templating tool.
Let's close this and work on allowing custom functions instead?
:+1: closing
Possible example, but the format of the inventory is flexible, you can use whatever is better.
And the output would be saved/cached somewhere.