Sensitive attribute is not respected in shell_out when a timeout occurs
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- operating-systems, security
Research direction
Reproduce the Windows timeout case using the shell_out! example with sensitive: true, then trace the timeout error path and its diagnostic output. Done means the timeout report does not expose the secret command or output while still identifying that the command timed out.
Written by the indexing model from the issue text.
Description
Description
The sensitive attribute does not work in a shell_out block when the command times out. This is very similar to issue chef/chef#7517
Chef Version
chef_version=14.12.3
Platform Version
platform=windows
platform_version=10.0.14393 (Windows Server 2016)
Replication Case
Create a recipe with the following code:
shell_out!('sleep 10; echo "my super secret"', timeout: 5, sensitive: true)
Client Output
Synchronizing Cookbooks:
- sensitive_test (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
================================================================================
Recipe Compile Error in C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/sensitive_test/recipes/default.rb
================================================================================
Mixlib::ShellOut::CommandTimeout
--------------------------------
command timed out:
Command execution failed. STDOUT/STDERR suppressed for sensitive resource
ProcessId: 2824
app_name: C:\Windows\system32\cmd.exe
command_line: cmd /c "sleep 10; echo "my super secret""
timeout: 5
System Info:
------------
chef_version=14.12.3
platform=windows
platform_version=10.0.14393
ruby=ruby 2.5.5p157 (2019-03-15 revision 67260) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client
Running handlers:
[2020-01-31T21:00:21+00:00] ERROR: Running exception handlers
Running handlers complete
[2020-01-31T21:00:21+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 14 seconds
[2020-01-31T21:00:21+00:00] FATAL: Stacktrace dumped to C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
[2020-01-31T21:00:21+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-01-31T21:00:21+00:00] FATAL: Mixlib::ShellOut::CommandTimeout: command timed out:
Command execution failed. STDOUT/STDERR suppressed for sensitive resource
ProcessId: 2824
app_name: C:\Windows\system32\cmd.exe
command_line: cmd /c "sleep 10; echo "my super secret""
timeout: 5
- Dominant language
- Ruby
- Stars
- 133
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from chef/mixlib-shellout
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
chef/mixlib-shellout#287 ·
-
Status: Untriaged Type: Bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
chef/mixlib-shellout#278 ·
-
Status: Untriaged Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
chef/mixlib-shellout#257 ·
-
Status: Untriaged
Difficulty 4/5 3-5 days Newbie friendliness 35/100
chef/mixlib-shellout#245 · 2 comments ·
-
Status: Untriaged Type: Bug
Difficulty 4/5 3-5 days Newbie friendliness 20/100
chef/mixlib-shellout#237 · 1 comment ·
All issues in chef/mixlib-shellout
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lugassawan/swe-workbench#799 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Homebrew/homebrew-core#317477 · 2 comments ·
Maintainers usually reply within 1 day
-
Dumping db structure after migrations fails for projects with spaces in their pathPossibly taken A pull request linked to this issue is open or already merged. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hanami/hanami-cli#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 7 days