-
Notifications
You must be signed in to change notification settings - Fork 74
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
Alerts in Correlations Part 2 #1062
Alerts in Correlations Part 2 #1062
Conversation
Signed-off-by: Riya <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
will add all the tests in a seperate PR |
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
Signed-off-by: Riya Saxena <[email protected]>
why is there not an API for list correlation alerts for all rules and only per rule id? |
import static org.opensearch.action.ValidateActions.addValidationError; | ||
|
||
public class GetCorrelationAlertsRequest extends ActionRequest { | ||
private String correlationRuleId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this be a list of rule ids?
|
||
public class GetCorrelationAlertsRequest extends ActionRequest { | ||
private String correlationRuleId; | ||
private String correlationRuleName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is name required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now, name is not needed because we are not using it to filter the correlation Alerts but at some point we can have a requirement to filter correlations by name, because correlation Ids will always be unique but name can be same. User can create a different correlationRules with same names, there's no correlation rule name validation
yeah so the API will give all the alerts if ruleId is not passed |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ƒew comments but LGTM from a quick scan. unit and integ tests pending
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
@@ -139,119 +149,177 @@ public void indexCorrelationAlert(CorrelationAlert correlationAlert, TimeValue i | |||
} | |||
} | |||
|
|||
public void getCorrelationAlerts(String ruleId, Table tableProp, ActionListener<GetCorrelationAlertsResponse> listener) { | |||
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery(); | |||
if (ruleId != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isblank?
a74f509
into
opensearch-project:main
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security-analytics/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security-analytics/backport-2.x
# Create a new branch
git switch --create backport-1062-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a74f509ccbac51531b77c371550b81fcd867931a
# Push it to GitHub
git push --set-upstream origin backport-1062-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics/backport-2.x Then, create a pull request where the |
* notification for alerting in correlation * correlation alerts mapping change * working code Signed-off-by: Riya Saxena <[email protected]> * alertsInCorrelation without notifciations Signed-off-by: Riya Saxena <[email protected]> * alertsInCorrelation without notifciations Signed-off-by: Riya Saxena <[email protected]> * alertsInCorrelation without notifciations Signed-off-by: Riya Saxena <[email protected]> * alerts in correlations notification service added Signed-off-by: Riya Saxena <[email protected]> * addressing the comments Signed-off-by: Riya Saxena <[email protected]> * addressing the comments Signed-off-by: Riya Saxena <[email protected]> * getCorrelationAlerts API changes Signed-off-by: Riya Saxena <[email protected]> * APIs added for Alerts in Correlations Signed-off-by: Riya Saxena <[email protected]> * update alerts with an errorMessage when correlationRule is deleted Signed-off-by: Riya Saxena <[email protected]> * address the design changes discussed Signed-off-by: Riya Saxena <[email protected]> * address the design changes discussed Signed-off-by: Riya Saxena <[email protected]> * fixed tests Signed-off-by: Riya Saxena <[email protected]> * minor fixes due to merge Signed-off-by: Riya Saxena <[email protected]> * alerts API changes Signed-off-by: Riya Saxena <[email protected]> * klint fixes Signed-off-by: Riya Saxena <[email protected]> * license headers added Signed-off-by: Riya Saxena <[email protected]> * fixed format violations Signed-off-by: Riya Saxena <[email protected]> --------- Signed-off-by: Riya <[email protected]> Signed-off-by: Riya Saxena <[email protected]> (cherry picked from commit a74f509) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* notification for alerting in correlation * correlation alerts mapping change * working code * alertsInCorrelation without notifciations * alertsInCorrelation without notifciations * alertsInCorrelation without notifciations * alerts in correlations notification service added * addressing the comments * addressing the comments * getCorrelationAlerts API changes * APIs added for Alerts in Correlations * update alerts with an errorMessage when correlationRule is deleted * address the design changes discussed * address the design changes discussed * fixed tests * minor fixes due to merge * alerts API changes * klint fixes * license headers added * fixed format violations --------- (cherry picked from commit a74f509) Signed-off-by: Riya <[email protected]> Signed-off-by: Riya Saxena <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
will address the remaining comments for this PR, in the follow up PR |
* notification for alerting in correlation * correlation alerts mapping change * working code Signed-off-by: Riya Saxena <[email protected]> * alertsInCorrelation without notifciations Signed-off-by: Riya Saxena <[email protected]> * alertsInCorrelation without notifciations Signed-off-by: Riya Saxena <[email protected]> * alertsInCorrelation without notifciations Signed-off-by: Riya Saxena <[email protected]> * alerts in correlations notification service added Signed-off-by: Riya Saxena <[email protected]> * addressing the comments Signed-off-by: Riya Saxena <[email protected]> * addressing the comments Signed-off-by: Riya Saxena <[email protected]> * getCorrelationAlerts API changes Signed-off-by: Riya Saxena <[email protected]> * APIs added for Alerts in Correlations Signed-off-by: Riya Saxena <[email protected]> * update alerts with an errorMessage when correlationRule is deleted Signed-off-by: Riya Saxena <[email protected]> * address the design changes discussed Signed-off-by: Riya Saxena <[email protected]> * address the design changes discussed Signed-off-by: Riya Saxena <[email protected]> * fixed tests Signed-off-by: Riya Saxena <[email protected]> * minor fixes due to merge Signed-off-by: Riya Saxena <[email protected]> * alerts API changes Signed-off-by: Riya Saxena <[email protected]> * klint fixes Signed-off-by: Riya Saxena <[email protected]> * license headers added Signed-off-by: Riya Saxena <[email protected]> * fixed format violations Signed-off-by: Riya Saxena <[email protected]> --------- Signed-off-by: Riya <[email protected]> Signed-off-by: Riya Saxena <[email protected]>
Description
This PR contains the APIs for alerts in Correlations:
1). New acknowledge Correlation Alerts API
new API signature
POST /_plugins/_security_analytics/_acknowledge/correlationAlerts
Req body: {"alerts":["4dc7f5a9-2c82-4786-81ca-433a209d5205"]}
GetAcknowledgeAlertsResponse API response
2). New API: To get/retrieve list of correlation alerts:
GET /_plugins/_security_analytics/<b>correlationAlerts
Issues Resolved
Issue
Check List
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.