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 remote index privileges to role management #154948

Merged
merged 10 commits into from
Apr 19, 2023

Conversation

thomheymann
Copy link
Contributor

@thomheymann thomheymann commented Apr 13, 2023

Resolves #142399

Summary

Add remote index privileges section to role management screen.

Release note

Added ability to configure remote index privileges directly from within the role management screen.

Screenshots

Platinum license

231859070-fd916155-6b34-4cb4-9601-065e33cc7456-2

Basic license

Screenshot 2023-04-19 at 16 10 18

@thomheymann thomheymann changed the title Add remote indices to role management Add remote index privileges to role management Apr 13, 2023
@thomheymann thomheymann added v8.8.0 release_note:enhancement Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Apr 17, 2023
@thomheymann thomheymann marked this pull request as ready for review April 17, 2023 08:10
@thomheymann thomheymann requested a review from a team as a code owner April 17, 2023 08:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Looks great! I just had some questions/minor nits, but nothing blocking approval.

id="xpack.security.management.editRole.elasticSearchPrivileges.controlAccessToRemoteClusterDataDescription"
defaultMessage="Control access to the data in remote clusters. "
/>
{this.learnMore(docLinks.links.security.indicesPrivileges)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we want a more specific doc link in the near future? I don't think more appropriate page exists at the moment, but a page that links to both the remote cluster config page and the index privileges page could be an option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, the docs for this haven't been written yet unfortunately but totally agree that this should link to a dedicated page for remote index privileges.

</KibanaContextProvider>
);
await flushPromises();
expect(wrapper.find(IndexPrivilegeForm)).toHaveLength(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really minor nit: as we're testing that we the render a component for each index privilege, should we use a non-1 test case? I realize this is how it has been (probably) forever, so feel free to ignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll update the tests

@@ -34,11 +34,12 @@ const toOption = (value: string) => ({ label: value });

interface Props {
formIndex: number;
indexPrivilege: RoleIndexPrivilege;
indexType: 'indices' | 'remote_indices';
indexPrivilege: RoleIndexPrivilege | RoleRemoteIndexPrivilege;
indexPatterns: string[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we ignore the incoming index patterns prop if the indexType is 'remote_indices'? Or will this be superseded by future work where we can populate the actual indices?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be down to the consumer of this component to decide whether they want to pass in this props or not (it's optional). For remote indices we currently don't want to auto-complete local indices so I am not passing the prop in. We might want to auto complete remote indices in the future though so I wouldn't restrict it in the component.

});
});

test('it requires privileges when an index is defined', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Could add a test for "It requires indices and privileges when clusters is defined"

@azasypkin
Copy link
Member

Can we also update role management API and UI docs to cover this new functionality in this or follow-up PR (cc @gchaps)?

@thomheymann
Copy link
Contributor Author

thomheymann commented Apr 19, 2023

Can we also update role management API and UI docs to cover this new functionality in this or follow-up PR (cc @gchaps)?

Good catch - Let's do it as a follow up PR: #155289

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
security 557.3KB 563.1KB +5.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
security 0 1 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
security 60.8KB 61.2KB +402.0B
Unknown metric groups

API count

id before after diff
security 280 282 +2

ESLint disabled line counts

id before after diff
securitySolution 394 397 +3

Total ESLint disabled count

id before after diff
securitySolution 474 477 +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@thomheymann thomheymann merged commit eda5b15 into elastic:main Apr 19, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 19, 2023
@gchaps gchaps mentioned this pull request Apr 25, 2023
19 tasks
thomheymann added a commit that referenced this pull request Aug 29, 2023
Resolves #155289

~~Todo: Add link to ES remote indices docs once available
(#154948 (comment)

Update: I don't think there's a better page to link to right now so will
leave as is. We can always change it in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow index privileges to apply to remote clusters
6 participants