-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
secrets for python actions capturable in cleartext using ps -ef | grep action_wrapper #5997
Comments
That's a good find! Probably not a bug, but a side effect of using CLI arguments as an input interface. Perhaps it makes sense to document this side effect in the https://docs.stackstorm.com/reference/runners.html when CLI args are used. |
I would understand this for some scripts, where you convert already existing scripts and adapt them to ST2, but many of the scripts I'm creating are exclusively to be used in the context of ST2 and use st2 client, or for example the SQL pack (or any pack that allows password to be an input) on stackstorm-exchange. Maybe I can work around this by using K8s, where the individual processes run in pods and hopefully what happens in pods is not capturable in trivial way such as ps -ef. |
I think it could be worse in K8s considering amount of potential neighbours in the cluster and higher blast radius in case of something goes wrong. Add here different logging and metrics K8s capabilities that might read the process list. Yeah, I agree. CLI args should still apply to However considering deeper python logic of |
SUMMARY
Python actions leak sensitive data when viewing processes
STACKSTORM VERSION
st2 3.7.0, on Python 3.8.13
OS, environment, install method
RHEL8, instance and mongoDB running on the same DL360 Proliant wtih 16 core / 64G RAM configuration
Steps to reproduce the problem
create sample flow:
with python script:
run the flow and do ps -ef | grep action_wrapper:
[user@host ~]$ ps -ef | grep action_wrapper root 1540283 1421574 1 06:17 ? 00:00:00 /opt/stackstorm/virtualenvs/testing/bin/python -u /opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py --pack=testing --file-path=/opt/stackstorm/internal_packs/testing/actions/secret_test.py --user=fdrab --parent-args=["--config-file","/etc/st2/st2.conf"] --parameters={"secret":"superSecretString"} --log-level=INFO user 1540289 1533819 0 06:17 pts/0 00:00:00 grep --color=auto action_wrapper [user@host ~]$
This leads to secrets being printed to the screen and easily captured even by a non-root user or anyone using ps -ef | grep. Secret is still properly masked in UI and does not appear in the logs.
Expected Results
I'd expect the secret parameters to be provided to the script in a secure way (even though I have no clue how).
Actual Results
secrets printed to console.
The text was updated successfully, but these errors were encountered: