status-im / infra-office-legacy

Infrastructure for cloud office services
0 stars 0 forks source link

Configure WebAuthN for Keycloak #3

Closed jakubgs closed 2 years ago

jakubgs commented 3 years ago

We want to use WebAuthN standard for Authentication with KeyCloak.

This task is required to complete integrations with other services:

jakubgs commented 3 years ago

I'm still worried that if credentials are missing someone can login with just username.

jakubgs commented 3 years ago

Now, if this was only an issue for administrators removing credentials this wouldn't be that bad, but users can do it too:

image

So if a user accidentally removes both then anyone can just login as them by simply knowing the username.

jakubgs commented 3 years ago

I've opened an issue describing this behavior: https://issues.redhat.com/browse/KEYCLOAK-19316

jakubgs commented 3 years ago

I've moved https://keycloak.status.im/ to https://keycloak.infra.status.im/ since it will be only for internal use: https://github.com/status-im/infra-office/commit/52f4fca8

We'll use https://auth.status.im/ for the status-im realm and any services for core contributors.

jakubgs commented 3 years ago

We had a call today with Serhan and Frederic and we came to a few conclusions:

For these reasons we decided on the following steps:


Some other things we discussed:

jakubgs commented 3 years ago

I verified that with this configuration:

image

I get prompted to change password and OTP on first login via Google OAuth, but not for WebAuthn, which stays optional:

image

jakubgs commented 3 years ago

I also changed the display name for the status-im realm to be auth.status.im, same as domain.

This makes it more descriptive in something like AndOTP.

jakubgs commented 3 years ago

Based on @OxFred's suggestion I've made User Verification Requirement required in WebAuthn configuration:

image

Docs:

jakubgs commented 3 years ago

It's worth noting that the Require Resident Key requirement makes YubiKeys older than 4th generation(2015) incompatible.

jakubgs commented 3 years ago

I've also switched Attestation Conveyance Preference to direct based on these docs:

  • indirect -This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in order to protect the user’s privacy, or to assist Relying Parties with attestation verification in a heterogeneous ecosystem.
  • direct - This value indicates that the Relying Party wants to receive the attestation statement as generated by the authenticator.

https://www.w3.org/TR/webauthn/#attestation-conveyance

Since I don't think we care about any "Anonymization CAs" for our use cases.

jakubgs commented 2 years ago

As far as I know WebAuthN works in Keycloak fine.