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

Feature/191 multiple detector types breaking change v1 #227

Conversation

stevanbz
Copy link
Contributor

@stevanbz stevanbz commented Jan 4, 2023

Description

Added multiple detector types as part of DetectorInput. Extended detector with new field: docLevelMonitorPerCategory used for storing the doc level category:monitorId pairs (used when detector is being updated in order to determine which monitors should be deleted and which query indices should be removed).

In order to support multiple detector types, detectorInput has been extended with List detectorTypes property. To keep the possibility of getting all alerts and findings per detector type and per detector id AlertsService and FindingsService has been extended to use the groupedListener and then they are joining/merging the search alert/finding results.

When updating the detector, if one of the doc level monitor has been deleted by deselecting rules, and the whole rule category has been removed, query index will also be deleted.

Here is the document describing the changes from the perspective of client

Issues Resolved

[https://github.com//issues/191]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2023

Codecov Report

Merging #227 (3806a78) into main (1770873) will decrease coverage by 0.38%.
The diff coverage is 22.15%.

@@             Coverage Diff              @@
##               main     #227      +/-   ##
============================================
- Coverage     38.97%   38.58%   -0.39%     
- Complexity      892      898       +6     
============================================
  Files           176      176              
  Lines          6746     6896     +150     
  Branches        823      845      +22     
============================================
+ Hits           2629     2661      +32     
- Misses         3876     3990     +114     
- Partials        241      245       +4     
Impacted Files Coverage Δ
.../securityanalytics/action/GetDetectorResponse.java 20.00% <ø> (+0.55%) ⬆️
...ecurityanalytics/action/IndexDetectorResponse.java 60.60% <ø> (+1.78%) ⬆️
...ytics/transport/TransportDeleteDetectorAction.java 0.00% <0.00%> (ø)
...yanalytics/transport/TransportGetAlertsAction.java 0.00% <ø> (ø)
...nalytics/transport/TransportGetFindingsAction.java 0.00% <ø> (ø)
...lytics/transport/TransportIndexDetectorAction.java 0.00% <0.00%> (ø)
...earch/securityanalytics/util/RuleTopicIndices.java 0.00% <0.00%> (ø)
...alytics/config/monitors/DetectorMonitorConfig.java 52.43% <25.00%> (-1.41%) ⬇️
...g/opensearch/securityanalytics/model/Detector.java 66.44% <25.45%> (-4.15%) ⬇️
...search/securityanalytics/alerts/AlertsService.java 25.92% <48.78%> (+4.02%) ⬆️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@stevanbz stevanbz force-pushed the feature/191-multiple-detector-types-breaking-change-v1 branch from 3806a78 to 120e66f Compare January 5, 2023 20:52
@stevanbz stevanbz marked this pull request as ready for review January 5, 2023 21:28
@stevanbz stevanbz requested a review from a team January 5, 2023 21:28
@stevanbz stevanbz force-pushed the feature/191-multiple-detector-types-breaking-change-v1 branch 2 times, most recently from d8997c4 to 17fa1af Compare January 9, 2023 19:06
Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
@stevanbz stevanbz force-pushed the feature/191-multiple-detector-types-breaking-change-v1 branch 2 times, most recently from 4b24acc to 75997d4 Compare January 13, 2023 23:23
riysaxen-amzn pushed a commit to riysaxen-amzn/security-analytics that referenced this pull request Feb 20, 2024
* [FEATURE] Common data store for the rules opensearch-project#473

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Common data store for the rules opensearch-project#473

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Common data store for the rules opensearch-project#473

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Common data store for the rules opensearch-project#473
Fix cypress create rules flaky tests opensearch-project#426

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Common data store for the rules opensearch-project#473
Fix cypress create rules flaky tests opensearch-project#426

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Common data store for the rules opensearch-project#473

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Common data store for the rules opensearch-project#473

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

---------

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
riysaxen-amzn pushed a commit to riysaxen-amzn/security-analytics that referenced this pull request Feb 20, 2024
…oject#487)

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Common data store for the rules opensearch-project#474

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Communicate to users when detector is initializing opensearch-project#227

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Communicate to users when the detector is initializing opensearch-project#487

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Code review

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

---------

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
@praveensameneni
Copy link
Member

@sbcd90 , can you please review and update / close as needed

@sbcd90 sbcd90 closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants