Skip to content

[Entity Analytics][9.0] Remove all legacy risk engine code and features #201810

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

Merged
merged 53 commits into from
Jan 10, 2025

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Nov 26, 2024

Summary

Closes https://github.com/elastic/security-team/issues/11253
Breaking change proposal: https://github.com/elastic/dev/issues/2822

The host and user risk scoring modules or "legacy risk engine" as we often call it internally, has been superseded since v8.10.0 by the risk engine. We submitted a breaking change proposal for v9.0.0 to remove all support to this legacy approach which was approved.

In 8.18 users will be given a warning if they are still using the legacy risk engine and directed to upgrade, this is implemented in #202775.

Changes

  • we previously used the presence of the risk index to decide whether to show the "enable risk engine" button instead of the risk score table, now that we only have only one risk scoring approach, I have changed this to use the risk engine status API, if the risk engine has ever been installed we show the table.

Deletions

  • all code related to displaying legacy risk score
  • we no longer enrich alerts with legacy risk score
  • all code related to upgrading to the "new" risk engine
  • telemetry on the ml_risk_score* indices
  • all internal APIs related to the legacy risk engine

@hop-dev hop-dev changed the title Delete legacy risk engine [Entity Analytics][9.0] Remove all legacy risk engine code Dec 2, 2024
@hop-dev hop-dev self-assigned this Dec 2, 2024
@hop-dev hop-dev added release_note:deprecation backport:skip This commit does not require backporting v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Entity Analytics Security Entity Analytics Team labels Dec 2, 2024
@hop-dev
Copy link
Contributor Author

hop-dev commented Dec 2, 2024

/ci

@hop-dev
Copy link
Contributor Author

hop-dev commented Dec 2, 2024

/ci

@hop-dev
Copy link
Contributor Author

hop-dev commented Dec 3, 2024

/ci

@hop-dev
Copy link
Contributor Author

hop-dev commented Dec 3, 2024

/ci

Copy link
Contributor

@angorayc angorayc left a comment

Choose a reason for hiding this comment

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

Thanks for removing the unused code!

@vitaliidm vitaliidm removed their request for review January 7, 2025 09:33
@hop-dev hop-dev requested a review from MadameSheema January 8, 2025 20:13
cy.get(ENABLE_HOST_RISK_SCORE_BUTTON).should('be.visible');

cy.get(ENABLE_USER_RISK_SCORE_BUTTON).should('be.visible');
it('shows enable risk button', () => {
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if we can invest time to try to unskip this spec file :)

});

after(() => {
cy.task('esArchiverUnload', { archiveName: 'risk_users' });
});

describe('Custom query rule', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Same as before, it would be great to try to unskip the test :)

Copy link
Contributor

@nkhristinin nkhristinin left a comment

Choose a reason for hiding this comment

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

DE changes LGTM!

Copy link
Member

@MadameSheema MadameSheema left a comment

Choose a reason for hiding this comment

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

Thanks for reviewing all the comments :)

@hop-dev
Copy link
Contributor Author

hop-dev commented Jan 10, 2025

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6541 6445 -96

Async chunks

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

id before after diff
securitySolution 22.2MB 21.1MB -1.1MB

Page load bundle

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

id before after diff
securitySolution 88.2KB 87.3KB -882.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 575 573 -2

References to deprecated APIs

id before after diff
securitySolution 464 355 -109

Total ESLint disabled count

id before after diff
securitySolution 659 657 -2

History

cc @hop-dev

@hop-dev hop-dev merged commit 80baa2c into elastic:main Jan 10, 2025
8 checks passed
@hop-dev hop-dev deleted the delete-legacy-risk-engine branch January 13, 2025 13:11
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
machadoum added a commit that referenced this pull request May 6, 2025
…219858)

## Summary

Closes #219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR #201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 6, 2025
…lastic#219858)

## Summary

Closes elastic#219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR elastic#201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
(cherry picked from commit 64d20bb)
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…lastic#219858)

## Summary

Closes elastic#219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR elastic#201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…lastic#219858)

## Summary

Closes elastic#219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR elastic#201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
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:deprecation Team:Entity Analytics Security Entity Analytics Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants