OpenSearch/client
Albert Zaharovits ff0f540255
Permission for restricted indices (#37577)
This grants the capability to grant privileges over certain restricted
indices (.security and .security-6 at the moment).
It also removes the special status of the superuser role.

IndicesPermission.Group is extended by adding the `allow_restricted_indices`
boolean flag. By default the flag is false. When it is toggled, you acknowledge
that the indices under the scope of the permission group can cover the
restricted indices as well. Otherwise, by default, restricted indices are ignored
when granting privileges, thus rendering them hidden for authorization purposes.
This effectively adds a confirmation "check-box" for roles that might grant
privileges to restricted indices.

The "special status" of the superuser role has been removed and coded as
any other role:
```
new RoleDescriptor("superuser",
    new String[] { "all" },
    new RoleDescriptor.IndicesPrivileges[] {
        RoleDescriptor.IndicesPrivileges.builder()
            .indices("*")
            .privileges("all")
            .allowRestrictedIndices(true)
// this ----^
            .build() },
            new RoleDescriptor.ApplicationResourcePrivileges[] {
                RoleDescriptor.ApplicationResourcePrivileges.builder()
                    .application("*")
                    .privileges("*")
                    .resources("*")
                    .build()
            },
            null, new String[] { "*" },
    MetadataUtils.DEFAULT_RESERVED_METADATA,
    Collections.emptyMap());
```
In the context of the Backup .security work, this allows the creation of a
"curator role" that would permit listing (get settings) for all indices
(including the restricted ones). That way the curator role would be able to 
ist and snapshot all indices, but not read or restore any of them.

Supersedes #36765
Relates #34454
2019-01-20 23:19:40 +02:00
..
benchmark Converting randomized testing to create a separate unitTest task instead of replacing the builtin test task (#36311) 2018-12-19 08:25:20 +02:00
client-benchmark-noop-api-plugin Type removal - added deprecation warnings to _bulk apis (#36549) 2019-01-10 21:35:19 +00:00
rest Testing conventions: add support for checking base classes (#36650) 2019-01-08 13:39:03 +02:00
rest-high-level Permission for restricted indices (#37577) 2019-01-20 23:19:40 +02:00
sniffer Testing conventions: add support for checking base classes (#36650) 2019-01-08 13:39:03 +02:00
test Converting randomized testing to create a separate unitTest task instead of replacing the builtin test task (#36311) 2018-12-19 08:25:20 +02:00
transport Testing conventions: add support for checking base classes (#36650) 2019-01-08 13:39:03 +02:00