-
Notifications
You must be signed in to change notification settings - Fork 34
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
SM can't make alternator query ping when authorization is required #4036
Comments
Is it even important for use to use the query ping on alternator healthcheck instead of the simple ping? // QueryPing checks if host is available, it returns RTT and error. Special errors
// are ErrTimeout and ErrUnauthorised. Ping is based on executing
// a real query. Simple ping: // SimplePing sends GET request to alternator port and expects 200 response code. |
@Michal-Leszczynski So, the short term is not only to change the alternator ping to simple ping when authorization is required, but document this fact in the documentation + test backup and restore against alternator. The long term is to change the API and include the flags you mentioned. |
OK, thanks for the explanation @Michal-Leszczynski on slack. So, let's use the simple ping at the moment. |
Here is some proof that enforcing alternator authentication results in failed alternator healthcheck (even when CQL creds are provided):
|
Up to this point, we were testing alternator without enforced authorization:
We should test the enabled version instead, but it looks like SM does not handle this case well.
Simply enforcing authorization results in:
Here is the dynamodb config used for pinging alternator:
Even though it contains the
Password
andUsername
fields, they are never set.The same goes for the
RequiresAuthentication
field.They are only used here:
Which means that we always use the anonymous credentials.
The problem here is not about simply setting
Password
,Username
,RequiresAuthentication
fields to known values.According to alternator docs, the password used for authenticating alternator queries is not the CQL password, but rather its salted hash kept in
system.roles
table. This means that even when user specifies CQL credentials for the cluster, we are still missing the alternator password.The short workaround would be to only use QueryPing when
RequiresAuthentication = false
.The proper fix would be to add a new cluster fields
--alternator-user
,--alternator-password
and use them for alternator healthcheck.I was also thinking about SM retrieving the salted hash from Scylla itself when the CQL credentials are set (by querying the
system.roles
table), but this seems like something easy to break in the future. Not to say that SM might not have the right permissions to read fromsystem.roles
table in the first place.The text was updated successfully, but these errors were encountered: