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

Add API endpoint for getting view tables names #17958

Open
Michal-Leszczynski opened this issue Mar 21, 2024 · 8 comments
Open

Add API endpoint for getting view tables names #17958

Michal-Leszczynski opened this issue Mar 21, 2024 · 8 comments

Comments

@Michal-Leszczynski
Copy link

Knowing which tables are views (both indexes and materialized) is useful information for Scylla Manager for:

  • ensuring base table is repaired before view table
  • not backing up and restoring views (as it is safer to just recreate them on restored base table)

Right now Scylla Manager check this information by querying system_schema.views table which requires CQL access (which is not always granted). Having a dedicated endpoint for getting all view tables would be really useful for reducing repair/backup dependency on CQL access.

From Scylla Manager perspective, such endpoint could just return all view table names, but making it accept keyspace path param could make it more versatile.

cc: @karol-kokoszka @denesb @asias

@kostja
Copy link
Contributor

kostja commented Mar 21, 2024

Erm, what's wrong with select * from system_schema.views?
I see ;)

@denesb
Copy link
Contributor

denesb commented Mar 21, 2024

Erm, what's wrong with select * from system_schema.views?

It requires CQL credentials, which the Manager doesn't always have.

@kostja
Copy link
Contributor

kostja commented Mar 21, 2024

I don't know Scylla policy, but vendors usually don't provide unauthorized access to user data, and view names are user generated. CQL way is the standard way. I mean, when does this stop? Next Scylla Manager needs to read data or DROP KEYSPACE, and we add an endpoint?

@tzach please approve.

@denesb
Copy link
Contributor

denesb commented Mar 21, 2024

You can already list all keyspace and table names via the API. Adding a filter for views is hardly an information breach.

Note that the API can only be accessed from localhost. If you have access to the node, you already have access to this information (you have access to the data dir).

@kostja
Copy link
Contributor

kostja commented Mar 21, 2024

It can be accessed by any user on the local host. The data on disk can be encrypted, the api is not.

@karol-kokoszka
Copy link

karol-kokoszka commented Mar 21, 2024

On the other hand, is it so problematic that we keep these credentials in Scylla Manager and query system keyspace ?
We need them still to do the restore and to include schema in CQL into the backup.

If user doesn't want to provide credentials, he cannot restore (using manager ofc).

@tzach
Copy link
Contributor

tzach commented Mar 21, 2024

I agree that the current API should be limited to Admin, not data,
But in this case, I agree with @denesb: adding a filter for views makes sense.

@denesb
Copy link
Contributor

denesb commented Mar 22, 2024

It can be accessed by any user on the local host. The data on disk can be encrypted, the api is not.

Directory names are not encrypted. But I see your point. I think eventually we should add TLS+auth to our API. Then we could expose it on public IPs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants