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

Consistent handling for connectivity issues #366

Open
chris-rock opened this issue Oct 11, 2018 · 1 comment
Open

Consistent handling for connectivity issues #366

chris-rock opened this issue Oct 11, 2018 · 1 comment
Labels
Component: Connection API Type: Bug Feature not working as expected

Comments

@chris-rock
Copy link
Contributor

Description

Most train backends for cloud (e.g. aws and azure) are not handling authentication issues properly. Users will see a stacktrace of errors if something is going wrong. We intentionally created different error classes in Train to handle this properly. Instead each resource needs to handle connectivity errors at this point. See https://github.com/inspec/inspec/blob/7deed13425c299ded99ff6e4095b1e0db969a826/lib/resources/aws/aws_iam_root_user.rb#L20-L25

Strangely inspec detect returns fine.

inspec detect -t aws://

== Platform Details

Name:      aws
Families:  cloud, api
Release:   aws-sdk-v2.11.35

But when I run a profile, things are handled in inspec resources only.

$ inspec exec https://github.com/chris-rock/aws-baseline -t aws://us-east1
transformed to https://github.com/chris-rock/aws-baseline/archive/master.tar.gz. Consider using the git fetcher
[2018-10-11T16:10:07+02:00] ERROR: It appears that you have not set your AWS credentials.  You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target.  See https://www.inspec.io/docs/reference/platforms for details.
[2018-10-11T16:10:07+02:00] ERROR: It appears that you have not set your AWS credentials.  You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target.  See https://www.inspec.io/docs/reference/platforms for details.
unable to sign request without credentials set

This issue is related to inspec/inspec#2881 and https://github.com/inspec/inspec/issues/2976

Train and Platform Version

1.5.1

Replication Case

See above

Possible Solutions

This behaviour should be consistent with ssh, docker and winrm. Train connections could easily raise issues:

       # check account to verify authentication
        begin
          @uuid = droplet_client.account.info.uuid
        rescue DropletKit::Error
          raise Train::TransportError, msg
        end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Connection API Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants