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

Unexpected nil authentication with inspec exec -t and WinRM #1901

Closed
jerryaldrichiii opened this issue Jun 7, 2017 · 0 comments
Closed

Unexpected nil authentication with inspec exec -t and WinRM #1901

jerryaldrichiii opened this issue Jun 7, 2017 · 0 comments
Labels
Type: Bug Feature not working as expected

Comments

@jerryaldrichiii
Copy link
Contributor

Description

When running inspec exec foo -t winrm://user@some.host.com --password and not specifying a password, the user is not warned that a one is required. Instead, InSpec performs an auth with a nil password thus causing the account to become locked out.

Possible Solutions

Prompt the user with a warning to prevent unexpected lock outs.

@adamleff adamleff self-assigned this Jun 7, 2017
@adamleff adamleff added the Type: Bug Feature not working as expected label Jun 7, 2017
arlimus added a commit that referenced this issue Jun 11, 2017
Due to limitations in Thor it is not possible to set an argument to be both optional and its value to be mandatory. E.g. the user supplying the --password argument is optional and not always required, but whenever it is used, it requires a value. Handle options that were defined with mandatory values in a way that fails with an `ArgumentError` if the value is missing, i.e.:

```
> inspec exec examples/profile --password
ArgumentError: Please provide a value for --password. For example: --password=hello.
```

It works without `--password` or with `--password=arg`. Also handled for `--sudo-password`.

Fixes: #1901
As suggested: #1904
arlimus added a commit that referenced this issue Jun 11, 2017
Due to limitations in Thor it is not possible to set an argument to be both optional and its value to be mandatory. E.g. the user supplying the --password argument is optional and not always required, but whenever it is used, it requires a value. Handle options that were defined with mandatory values in a way that fails with an `ArgumentError` if the value is missing, i.e.:

```
> inspec exec examples/profile --password
ArgumentError: Please provide a value for --password. For example: --password=hello.
```

It works without `--password` or with `--password=arg`. Also handled for `--sudo-password`.

Fixes: #1901
As suggested: #1904

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
arlimus added a commit that referenced this issue Jun 11, 2017
Due to limitations in Thor it is not possible to set an argument to be both optional and its value to be mandatory. E.g. the user supplying the --password argument is optional and not always required, but whenever it is used, it requires a value. Handle options that were defined with mandatory values in a way that fails with an `ArgumentError` if the value is missing, i.e.:

```
> inspec exec examples/profile --password
ArgumentError: Please provide a value for --password. For example: --password=hello.
```

It works without `--password` or with `--password=arg`. Also handled for `--sudo-password`.

Fixes: #1901
As suggested: #1904

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
adamleff pushed a commit that referenced this issue Jun 12, 2017
Due to limitations in Thor it is not possible to set an argument to be both optional and its value to be mandatory. E.g. the user supplying the --password argument is optional and not always required, but whenever it is used, it requires a value. Handle options that were defined with mandatory values in a way that fails with an `ArgumentError` if the value is missing, i.e.:

```
> inspec exec examples/profile --password
ArgumentError: Please provide a value for --password. For example: --password=hello.
```

It works without `--password` or with `--password=arg`. Also handled for `--sudo-password`.

Fixes: #1901
As suggested: #1904

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
Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants