Method: InspecPlugins::Compliance::API.target_is_automate2_server?
- Defined in:
- lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb
.target_is_automate2_server?(url, insecure) ⇒ Boolean
291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb', line 291 def self.target_is_automate2_server?(url, insecure) automate_endpoint = '/dex/auth' response = InspecPlugins::Compliance::HTTP.get(url + automate_endpoint, nil, insecure) if response.code == '400' Inspec::Log.debug( "Received 400 from #{url}#{automate_endpoint} - " \ 'assuming target is a Chef Automate2 instance', ) true else false end end |