-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Feature request: add option to hide output from cmd module state return data #30842
Comments
@cmclaughlin, thanks for the report. What happens when you run the state like this: django-auth-models:
cmd.run:
- name: echo "{{ create_admin_cmd }}" | {{ dir }}/manage-wrapper.sh shell && touch {{ dir }}/.admin:
- creates: {{ dir }}/.admin
- output_loglevel: quiet
- quiet: True When you combine the name and id, salt will report the single value in the log to record that the state succeeded. If you want to hide the command run from the log, you will need to use a separate name and id. For further explanation, see the documentation on highstate data format. |
@jfindlay thanks for the suggestion. The password is still logged. Here's my change and resulting log in case I'm missing something... Code:
Logs:
|
@cmclaughlin, thanks for the extra information. I can confirm that the INFO log is showing slsjmoney-main ~ master # cat /srv/salt/test.sls
django-auth-models:
cmd.run:
- name: echo secret | wc
- output_loglevel: quiet
- quiet: True commandjmoney-main ~ master # salt jmoney-main state.apply test
jmoney-main:
----------
ID: django-auth-models
Function: cmd.run
Name: echo secret | wc
Result: True
Comment: Command "echo secret | wc" run
Started: 17:48:25.963892
Duration: 19.518 ms
Changes:
----------
pid:
16488
retcode:
0
stderr:
stdout:
1 1 7
Summary for jmoney-main
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 19.518 ms logs
|
Seeing the same issue. Trying to use ceph-authtool without exposing the key I'm using. |
As much as i too love logging all my super top secret info. Can we get this fixed please. Would be nice to have a 'sensitive' flag much like chef's that suppresses everything |
Is there a way to completely disable logging on a per state basis? If not, what would be a good way to disable logging only for say cmd.run states on only certain nodes? Regards, |
'output_loglevel: quiet' still shows full cmd.run output in version 2016.11.5 Please provide some way to hide sensitive output from cmd states. |
This bug still exists in version 2017.7.1 Do we have a work around for this issue? Or an ETA for the bug fix? |
I have looked into writing a tmp file via file.append. this also logs the file changes. |
|
This has been implemented in #44840. |
Is there a bug fix release for this? We have 2017.7.4 and still cannot stop the output of selected sensitive text. Tried all suggested options, hide_output: True, output_loglevel: quiet, quiet: True etc.... |
@thetoolsmith, and anybody else running into this. I've had success using cmd.run environment variables. Example: cmd.run:
- name: echo -en "$password\n$password\n" | smbpasswd -s -a backups
- env:
- password: {{pillar['samba']['password']}} output:
|
Also works when the CLI tool doesn't read the password from stdin:
|
I found issue #19479... I seem to be having the same problem. This isn't my finest work, but here's the SLS:
It's logged as follows:
The minions and master are running v2015.8.3. Please let me know if I can provide more info that would help.
The text was updated successfully, but these errors were encountered: