-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix SSH zero address OTP delete #6390
Fix SSH zero address OTP delete #6390
Conversation
Fixed bug where SSH OTP roles could not be deleted if a zero-address role previously existed, and there currently exist no zero-address roles. Fixes #6382
@meirish - Could you take a look at the failing ember test please; I don't believe this has any relevance to my PR. Indeed the tests are failing on master anyway. I think this is the bit that is failing, but I could be wrong: ok 64 Chrome 72.0 - [884 ms] - Acceptance | secrets/secret/create: version 2 with restricted policy still allows creation
2019-03-11T09:58:07.602Z [ERROR] secrets.system.system_30a74536: mount failed: path=kv-v2/ error="existing mount at kv-v2/"
ok 65 Chrome 72.0 - [1038 ms] - Acceptance | secrets/secret/create: version 2 with restricted policy still allows edit
2019-03-11T09:58:08.642Z [INFO] core: successful mount: namespace= path=kv/ type=kv
ok 66 Chrome 72.0 - [2627 ms] - Acceptance | secrets/secret/create: paths are properly encoded
2019-03-11T09:58:11.277Z [ERROR] secrets.system.system_30a74536: mount failed: path=kv/ error="existing mount at kv/" TIA |
@mbamber Thanks for finding this. Your PR does suppress the error, but zeroaddress is left with |
@mbamber We'd like to close this issue in the next few days. If you're able to make the changes to |
Sure I can have a go at this - thanks for the help :) |
@kalafut - Looking over this again this morning I'm not quite sure I understand :/ AFAICT, // If slice has zero or one item, remove the item by setting slice to nil.
if length < 2 {
r.Roles = nil
return nil
} I think the issue with this, is that Perhaps you could take a look and update the PR for me? |
@mbamber The error was was due to |
@kalafut - lgtm! Thanks for the help :) |
@mbamber Thanks for raising this issue. |
Fixed bug where SSH OTP roles could not be deleted if a zero-address role
previously existed, and there currently exist no zero-address roles.
Fixes #6382
The bug states the bug can be reproduced using the following sequence of commands:
vault secrets enable ssh vault write ssh/roles/everyone default_user=ubuntu key_type=otp vault write ssh/config/zeroaddress roles=everyone vault delete ssh/roles/everyone vault write ssh/roles/everyone default_user=ubuntu key_type=otp vault delete ssh/roles/everyone
The result of running these with this change is below: