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

Alerts in correlations #1048

Merged

Conversation

riysaxen-amzn
Copy link
Collaborator

@riysaxen-amzn riysaxen-amzn commented Jun 18, 2024

Description

  • Alerts in Correlations Feature

Issues Resolved

[988]

Testing

1).Create Correlation Rule with Alert Trigger

createCorRule.mov

2). View Correlation Alerts and check Notifications

corrAlerts.mov

3). Error when correlation-rule is deleted

errorScenarios.mov

UX Review changes

After UX review changes incorporated

  • Alert Trigger Panel alignment

Image 6-20-24 at 3 40 PM

  • LogTypes added as a column while viewing Correlation Alerts
    Image 6-20-24 at 3 41 PM

  • Create Correlation Rule
    Image 6-24-24 at 10 00 AM

  • Experimental on the Correlations tab

Image 6-24-24 at 12 00 PM

Check List

  • 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.

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
this.getFindings();
}

getFindings = async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dedupe these utility methods between the regular alert flyout and this one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will raise a seperate PR to refactor this.

Comment on lines +84 to +90
correlatedItems: CorrelationAlertTableItem[];
alerts: AlertItem[];
correlationAlerts: CorrelationAlertTableItem[];
flyoutData?: { alertItem: AlertItem };
flyoutCorrelationData?: { alertItem: CorrelationAlertTableItem };
alertsFiltered: boolean;
filteredCorrelationAlerts: CorrelationAlertTableItem[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should club all these fields and instead have a single field called tabState or something which gets updated on tab switch. That way the UI will automatically refresh when the state changes and we don't need to duplicate so much code below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will raise a seperate PR to refactor this.

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
@riysaxen-amzn
Copy link
Collaborator Author

riysaxen-amzn commented Jun 26, 2024

CI alert tests passing in local:
Image 6-25-24 at 5 36 PM

All Tests

Image 6-25-24 at 7 44 PM

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Copy link
Collaborator

@amsiglan amsiglan left a comment

Choose a reason for hiding this comment

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

Approving with assumption that the code refactor will be done in a quick follow up PR

@riysaxen-amzn riysaxen-amzn merged commit 2ada9e4 into opensearch-project:main Jun 26, 2024
8 of 12 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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-dashboards-plugin/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.x
# Create a new branch
git switch --create backport-1048-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2ada9e43fd05ef358173f479e995f983e8495ec8
# Push it to GitHub
git push --set-upstream origin backport-1048-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport-1048-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.15 failed:

The process '/usr/bin/git' failed with exit code 1

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-dashboards-plugin/backport-2.15 2.15
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.15
# Create a new branch
git switch --create backport-1048-to-2.15
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2ada9e43fd05ef358173f479e995f983e8495ec8
# Push it to GitHub
git push --set-upstream origin backport-1048-to-2.15
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.15

Then, create a pull request where the base branch is 2.15 and the compare/head branch is backport-1048-to-2.15.

riysaxen-amzn added a commit to riysaxen-amzn/security-analytics-dashboards-plugin that referenced this pull request Jun 26, 2024
* alerts in Correlations inital commit

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* added experimental banner and correlation

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* working partially

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fix for Findings API and correlationAlert flyout changes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed acknowledge button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed redundant files

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fixes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed bugs and removed console.log

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed Generate Message Button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* addressed the comments by UX

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* Alerts in Correlations Experimental

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* update snapshot for Alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* timeout removed to fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed unnecessary change

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

---------

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
(cherry picked from commit 2ada9e4)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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-dashboards-plugin/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.x
# Create a new branch
git switch --create backport-1048-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2ada9e43fd05ef358173f479e995f983e8495ec8
# Push it to GitHub
git push --set-upstream origin backport-1048-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport-1048-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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-dashboards-plugin/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.x
# Create a new branch
git switch --create backport-1048-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2ada9e43fd05ef358173f479e995f983e8495ec8
# Push it to GitHub
git push --set-upstream origin backport-1048-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport-1048-to-2.x.

riysaxen-amzn added a commit to riysaxen-amzn/security-analytics-dashboards-plugin that referenced this pull request Jun 26, 2024
* alerts in Correlations inital commit

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* added experimental banner and correlation

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* working partially

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fix for Findings API and correlationAlert flyout changes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed acknowledge button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed redundant files

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fixes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed bugs and removed console.log

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed Generate Message Button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* addressed the comments by UX

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* Alerts in Correlations Experimental

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* update snapshot for Alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* timeout removed to fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed unnecessary change

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

---------

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
(cherry picked from commit 2ada9e4)
riysaxen-amzn added a commit that referenced this pull request Jun 27, 2024
* alerts in Correlations inital commit

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* added experimental banner and correlation

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* working partially

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fix for Findings API and correlationAlert flyout changes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed acknowledge button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed redundant files

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fixes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed bugs and removed console.log

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed Generate Message Button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* addressed the comments by UX

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* Alerts in Correlations Experimental

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* update snapshot for Alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* timeout removed to fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed unnecessary change

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

---------

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
(cherry picked from commit 2ada9e4)
riysaxen-amzn added a commit that referenced this pull request Jun 28, 2024
* alerts in Correlations inital commit

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* added experimental banner and correlation

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* working partially

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fix for Findings API and correlationAlert flyout changes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed acknowledge button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed redundant files

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* bug fixes

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed bugs and removed console.log

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed Generate Message Button

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* addressed the comments by UX

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* Alerts in Correlations Experimental

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* update snapshot for Alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* address the review comments

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* timeout removed to fix integ tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* fixed alert tests

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

* removed unnecessary change

Signed-off-by: Riya Saxena <riysaxen@amazon.com>

---------

Signed-off-by: Riya Saxena <riysaxen@amazon.com>
(cherry picked from commit 2ada9e4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants