Command Module Doesn't Do Shell Expansions
corysabol opened this issue · 0 comments
corysabol commented
The katana command module doesn't seem to handle shell expansions very well. In the case of trying to use it to install kubectl with the following command:
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
It fails to fetch the file and instead resolved the subshell command as part of the URL.
Example yaml:
- name: Download kubectl bin
command:
cwd: /usr/bin
cmd: curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
It might make sense to add the ability to pass shell=True
to the subprocess.run()
call in found here -
samuraiwtf/katana/plugins/Command.py
Line 19 in fbab917