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

Profile fails inspec json #33

Closed
james-stocks opened this issue May 21, 2019 · 2 comments · Fixed by #34
Closed

Profile fails inspec json #33

james-stocks opened this issue May 21, 2019 · 2 comments · Fixed by #34

Comments

@james-stocks
Copy link
Contributor

Describe the bug

Using InSpec 4.3.2

bundle exec inspec json nginx-baseline-2.3.0.tar.gz > nginx-baseline-2.3.0.tar.gz.json
--
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:22)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:28)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:34)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:40)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:46)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:52)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:58)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:64)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:70)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:76)
  | [2019-05-21T12:15:44+00:00] WARN: DEPRECATION: The 'default' option for attributes is being replaced by 'value' - please use it instead. attribute name: 'Inspec::Input' (used at nginx-baseline-2.3.0/controls/nginx_spec.rb:82)
  | bundler: failed to load command: inspec (/workdir/vendor/bundle/ruby/2.6.0/bin/inspec)
  | Encoding::UndefinedConversionError: "\xE2" from ASCII-8BIT to UTF-8
  | /workdir/vendor/bundle/ruby/2.6.0/gems/json-2.2.0/lib/json/common.rb:224:in `encode'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/json-2.2.0/lib/json/common.rb:224:in `generate'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/json-2.2.0/lib/json/common.rb:224:in `generate'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/json-2.2.0/lib/json/common.rb:394:in `dump'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/inspec-4.3.2/lib/inspec/cli.rb:70:in `json'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
  | /workdir/vendor/bundle/ruby/2.6.0/gems/inspec-bin-4.3.2/bin/inspec:15:in `<top (required)>'
  | /workdir/vendor/bundle/ruby/2.6.0/bin/inspec:23:in `load'
  | /workdir/vendor/bundle/ruby/2.6.0/bin/inspec:23:in `<top (required)>'

There are a number of issues open and closed for encoding in InSpec profiles https://github.com/inspec/inspec/issues?utf8=%E2%9C%93&q=is%3Aissue+encoding

To work in all versions of InSpec currently supported, this profile should either keep the # encoding: UTF-8 declarations, or should limit the InSpec control source to ASCII characters.

@chris-rock
Copy link
Member

I recommend going with encoding, any PR to make it happen is welcome.

james-stocks pushed a commit to james-stocks/nginx-baseline that referenced this issue May 21, 2019
Fixes dev-sec#33

There are a number of issues open and closed for encoding in InSpec profiles https://github.com/inspec/inspec/issues?utf8=%E2%9C%93&q=is%3Aissue+encoding

To work in all versions of InSpec currently supported, this profile should keep the `# encoding: UTF-8` declaration.

Signed-off-by: James Stocks <jstocks@chef.io>
james-stocks pushed a commit to james-stocks/nginx-baseline that referenced this issue May 21, 2019
Fixes dev-sec#33

There are a number of issues open and closed for encoding in InSpec profiles https://github.com/inspec/inspec/issues?utf8=%E2%9C%93&q=is%3Aissue+encoding

To work in all versions of InSpec currently supported, this profile should keep the `# encoding: UTF-8` declaration.

Signed-off-by: James Stocks <jstocks@chef.io>
chris-rock pushed a commit that referenced this issue May 21, 2019
Fixes #33

There are a number of issues open and closed for encoding in InSpec profiles https://github.com/inspec/inspec/issues?utf8=%E2%9C%93&q=is%3Aissue+encoding

To work in all versions of InSpec currently supported, this profile should keep the `# encoding: UTF-8` declaration.

Signed-off-by: James Stocks <jstocks@chef.io>
@james-stocks
Copy link
Contributor Author

I raised an InSpec issue with a small reproduction profile:
inspec/inspec#4135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants