With this configuration, xyz writer can do any _snapshot actions, including getting the snapshots of other users on the same cluster. It seems that no restrictions to the indices is applied. Specifically, any user can steal the indices of other users like this:
This happily goes through, and xyz can now read the contents of index. The replacement name does not even have to match the index pattern of the user, it can be anything in fact.
We’ve worked around this by restricting the write actions by adding:
This still allows users to see the indices other users have backed up but at least they cannot spy at them any longer. However, they cannot restore their own backups either any longer, and need the cluster admins for that.
Let us know if you need any additional information.
This bug is triggered because in Elasticsearch, RestoreSnapshotRequest does not implement the IndicesRequest interface and it’s not detected as indices-related by ROR. Therefore the indices rule won’t apply.
See the related bug report I opened in ES repo:
In the meanwhile, and to cover all the past ES releases, I explicitly took care of this case in ROR logic.
The fix is present in the current release 1.16.16 of ReadonlyREST for Elasticsearch. Please @schwicke have a look and see if there’s anything else we can do about this.
We’ve done a brief testing of this. Users will still be able to query the snapshots of other users, simply because the snapshot names are arbitrary. They cannot steal foreign indices any longer with this patch.
Thanks a lot, that is good progress!
For the first issue I wonder if having another rule, similar to the “index: [list]” would do the job, like “snaphots: [list]”.
Coming back to this. Sorry for the delay, we’ve been rather busy with other stuff recently.
For backups we currently do not need dynamic variables.
While testing this, I wonder if the restriction is on the snapshot name or on the repository name.
If the restriction is on the actual snapshot name only, I wonder if that would still allow users to guess the repository name of others (eg. ‘backup’), and put their backups into foreign repositories ?