Skip to content
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

inspec check raises when the profile contains non UTF-8 characters #3625

Open
alexpop opened this issue Nov 20, 2018 · 0 comments
Open

inspec check raises when the profile contains non UTF-8 characters #3625

alexpop opened this issue Nov 20, 2018 · 0 comments
Labels
Component: CLI: check Type: Bug Feature not working as expected

Comments

@alexpop
Copy link
Contributor

alexpop commented Nov 20, 2018

🎛 Description

This is a 🐛 bug report

inspec check should not pass if the files inside the profile have non UTF-8 characters that will lead to failure down the line.

🌍 InSpec and Platform Version

$ inspec version
3.0.52

$ inspec detect

== Platform Details

Name:      mac_os_x
Families:  darwin, bsd, unix, os
Release:   17.7.0
Arch:      x86_64

🤔 Replication Case

$ inspec check https://github.com/dev-sec/apache-baseline/archive/0b5f21e668940d53e85c2ca36b41ba7ae18fac01.tar.gz

Location:    https://github.com/dev-sec/apache-baseline/archive/0b5f21e668940d53e85c2ca36b41ba7ae18fac01.tar.gz
Profile:     apache-baseline
Controls:    14
Timestamp:   2018-11-20T19:49:29+00:00
Valid:       true

No errors or warnings

$ inspec exec https://github.com/dev-sec/apache-baseline/archive/0b5f21e668940d53e85c2ca36b41ba7ae18fac01.tar.gz -t docker://cc_pg --reporter json-automate

/usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/reporters/json_automate.rb:13:in `encode': "\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/reporters/json_automate.rb:13:in `to_json'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/reporters/json_automate.rb:13:in `render'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/reporters.rb:39:in `render'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/runner.rb:118:in `block in render_output'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/runner.rb:117:in `each'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/runner.rb:117:in `render_output'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/runner.rb:142:in `run_tests'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/runner.rb:111:in `run'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/lib/inspec/cli.rb:245:in `exec'
  from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
  from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-3.0.52/bin/inspec:12:in `<top (required)>'
  from /usr/local/bin/inspec:23:in `load'
  from /usr/local/bin/inspec:23:in `<main>'
@alexpop alexpop added the Type: Bug Feature not working as expected label Nov 20, 2018
@zenspider zenspider changed the title inspec check should fail when the profile contains non UTF-8 characters inspec check raises when the profile contains non UTF-8 characters Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CLI: check Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants