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 compliance login* should support a hostname for the SERVER argument #1473

Closed
billmeyer opened this issue Feb 8, 2017 · 2 comments · Fixed by #1861
Closed

inspec compliance login* should support a hostname for the SERVER argument #1473

billmeyer opened this issue Feb 8, 2017 · 2 comments · Fixed by #1861
Assignees

Comments

@billmeyer
Copy link

billmeyer commented Feb 8, 2017

Description

inspec compliance login SERVER and inspec compliance login_automate SERVER don't specify if SERVER argument is a hostname or a URL. When using a hostname, the login will fail with an exception (see below).

InSpec and Platform Version

1.7.2

Replication Case

$ inspec compliance login chefcompliance01.billmeyer.corp --insecure --user='bmeyer' --token='eyJh...qqpQ'

Possible Solutions

Accept either a hostname or a URL.

Stacktrace

Please include the stacktrace output or link to a gist of it, if there is one.

/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.7.2/lib/bundles/inspec-compliance/http.rb:70:in `send_request': Unable to parse URI: chefcompliance01.billmeyer.corp/api/version (RuntimeError)
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.7.2/lib/bundles/inspec-compliance/http.rb:20:in `get'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.7.2/lib/bundles/inspec-compliance/api.rb:55:in `version'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.7.2/lib/bundles/inspec-compliance/cli.rb:298:in `store_access_token'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.7.2/lib/bundles/inspec-compliance/cli.rb:45:in `login'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:115:in `invoke'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:242:in `block in subcommand'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.7.2/bin/inspec:12:in `<top (required)>'
	from /opt/chefdk/embedded/bin/inspec:22:in `load'
	from /opt/chefdk/embedded/bin/inspec:22:in `<main>'
@arlimus
Copy link
Contributor

arlimus commented Feb 8, 2017

For solution see #1471

@arlimus
Copy link
Contributor

arlimus commented May 30, 2017

Another error in the same category discovered by @billmeyer

Profile is valid
Start upload to bmeyer/cis-rhel6-level1
Uploading to Chef Automate
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.25.1/lib/bundles/inspec-compliance/http.rb:42:in `post_file': Unable to parse URL: chefautomate01/compliance/profiles/bmeyer (RuntimeError)

arlimus added a commit that referenced this issue May 30, 2017
Non-url URIs may have lead to broader crashes than initially fixed. Overwrite all URL resolvers in the plugin to work with these non-schema URLs.

Fixes #1473
@arlimus arlimus self-assigned this May 30, 2017
arlimus added a commit that referenced this issue May 30, 2017
Non-url URIs may have lead to broader crashes than initially fixed. Overwrite all URL resolvers in the plugin to work with these non-schema URLs.

Fixes #1473

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
aaronlippold pushed a commit to aaronlippold/inspec that referenced this issue Jun 8, 2017
Non-url URIs may have lead to broader crashes than initially fixed. Overwrite all URL resolvers in the plugin to work with these non-schema URLs.

Fixes inspec#1473

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
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.

3 participants