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

The Security plugin should not rely on _cat APIs #116971

Closed
jportner opened this issue Nov 1, 2021 · 1 comment · Fixed by #136899
Closed

The Security plugin should not rely on _cat APIs #116971

jportner opened this issue Nov 1, 2021 · 1 comment · Fixed by #136899
Assignees
Labels
bug Fixes for quality problems that affect the customer experience chore good first issue low hanging fruit impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@jportner
Copy link
Contributor

jportner commented Nov 1, 2021

The _cat APIs are only intended for humans, not machine consumption, and they are subject to change without warning.

The Security plugin's security_checkup module currently relies on cat.indices to check and see if there is any user data:

const indices = await esClient.cat.indices({
format: 'json',
h: ['index', 'docs.count'],
});
clusterHasUserData = indices.body.some((indexCount) => {
const isInternalIndex =
indexCount.index?.startsWith('.') || indexCount.index?.startsWith('kibana_sample_');
return !isInternalIndex && parseInt(indexCount['docs.count']!, 10) > 0;
});

We should change to use indices.stats instead.

@jportner jportner added bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Nov 1, 2021
@elasticmachine
Copy link
Contributor

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

@jportner jportner added the chore label Nov 1, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Nov 1, 2021
@legrego legrego added the good first issue low hanging fruit label Feb 7, 2022
@exalate-issue-sync exalate-issue-sync bot added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Feb 11, 2022
@kc13greiner kc13greiner linked a pull request Jul 26, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience chore good first issue low hanging fruit impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants