vault icon indicating copy to clipboard operation
vault copied to clipboard

MFA: TOTP: Add a non-administrative destory call, use non-administrative calls in the UI

Open the-glu opened this issue 3 years ago • 5 comments

Hello,

The UI to setup MFA with TOTP is using administrative calls, which can be can issue since entities with restricted rights must have permission to call those endpoints, allowing then to add or remove TOTP to any entity.

This PR change the UI to use the non-administrative endpoints who can be granted to anyone since they does not pose a security risk.

Since the 'destroy' endpoint exists only in a administrative version, this PR also add a new non-administrative endpoint, like the 'generate' endpoint.

the-glu avatar Jul 29 '22 08:07 the-glu

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Jul 29 '22 08:07 hashicorp-cla

Hello,

Any feedback for this PR? It would be great to have this feature :)

Thanks,

the-glu avatar Aug 25 '22 19:08 the-glu

I too was looking to allow a non-administrative user to generate their own TOTP method using the UI, so would like to see this included 😄

Having just had a browse through the file changes, should the default policy also grant access to the identity/mfa/method/totp/generate and identity/mfa/method/totp/destroy endpoints? e.g.

# Allow a user to generate their own TOTP QR code / method
path "identity/mfa/method/totp/generate" {
  capabilities = ["create", "update"]
}

# Allow a user to destroy their own TOTP method
path "identity/mfa/method/totp/destroy" {
  capabilities = ["create", "update"]
}

Otherwise, I think there should be documentation about the required user policy permissions somewhere.

I've also noticed a typo on the totp.mdc documentation page. Line 178 doesn't need my_totp/ in the URL. I'll add a comment on it.

alexleach avatar Feb 08 '23 10:02 alexleach

non-administrative calls in the UI was added in https://github.com/hashicorp/vault/pull/17932, but non-administrative destroy is still missing.

oyvsi avatar Mar 06 '23 12:03 oyvsi

Hi folks - we are discussing this internally with our engineering teams and product owners. I apologize for the delay and want to say that we appreciate your patience. :)

heatherezell avatar Apr 17 '23 21:04 heatherezell