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

Rule editor enhancements #924

Merged
merged 7 commits into from
Mar 15, 2024

Conversation

amsiglan
Copy link
Collaborator

@amsiglan amsiglan commented Mar 13, 2024

Description

Improving rule creation UI by making below changes:

  • Relaxed validation for author name and description by supporting more characters in the regex pattern
  • Added validation for level, status, log type in yaml editor
  • Allow rule creation when no id is specified in the yaml editor

Fixes concerns in #772

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: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 31.16%. Comparing base (ac33566) to head (c0997fb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #924      +/-   ##
==========================================
+ Coverage   31.04%   31.16%   +0.11%     
==========================================
  Files         157      158       +1     
  Lines        5244     5240       -4     
  Branches      984      975       -9     
==========================================
+ Hits         1628     1633       +5     
- Misses       3429     3434       +5     
+ Partials      187      173      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan
Copy link
Collaborator Author

Detector tests:
image

Rule tests:
image

Alerts tests:
image

Findings tests:
image

@amsiglan amsiglan merged commit 1a48384 into opensearch-project:main Mar 15, 2024
7 of 9 checks passed
@amsiglan amsiglan added backport 2.x backport 2.12 backport 2.11 PRs to be backported to 2.11 branch labels Mar 15, 2024
@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-924-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1a483840ae3b7fa1d4a00cef67e0c2311889d7ed
# Push it to GitHub
git push --set-upstream origin backport-924-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-924-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

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

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

@opensearch-trigger-bot
Copy link
Contributor

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

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

amsiglan added a commit to amsiglan/security-analytics-dashboards-plugin that referenced this pull request Mar 22, 2024
* rule editor enhancements

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated test snapshots

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* relax validation for author name and description

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added validation for level, status, log type in yaml editor

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fix rule creation with empty or undefined Id

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed cypress tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
amsiglan added a commit that referenced this pull request Mar 22, 2024
* Rule editor enhancements (#924)

* rule editor enhancements

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated test snapshots

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* relax validation for author name and description

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added validation for level, status, log type in yaml editor

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fix rule creation with empty or undefined Id

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed cypress tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Fetch all findings and alerts for the detectors when displaying in the tables (#942)

* fetching all findings using the pagination query params; optimized api calls for alert flyout, correlations

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fetching all alerts; updated correlations UI

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* addressed PR comments; updated snapshots

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed logic to get all alerts (#965)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 22, 2024
* Rule editor enhancements (#924)

* rule editor enhancements

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated test snapshots

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* relax validation for author name and description

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added validation for level, status, log type in yaml editor

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fix rule creation with empty or undefined Id

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed cypress tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Fetch all findings and alerts for the detectors when displaying in the tables (#942)

* fetching all findings using the pagination query params; optimized api calls for alert flyout, correlations

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fetching all alerts; updated correlations UI

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* addressed PR comments; updated snapshots

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed logic to get all alerts (#965)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit a683e9c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amsiglan pushed a commit that referenced this pull request Mar 22, 2024
* Rule editor enhancements (#924)

* rule editor enhancements



* updated test snapshots



* relax validation for author name and description



* added validation for level, status, log type in yaml editor



* fix rule creation with empty or undefined Id



* fixed cypress tests



---------



* Fetch all findings and alerts for the detectors when displaying in the tables (#942)

* fetching all findings using the pagination query params; optimized api calls for alert flyout, correlations



* fetching all alerts; updated correlations UI



* addressed PR comments; updated snapshots



---------



* fixed logic to get all alerts (#965)



---------


(cherry picked from commit a683e9c)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
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>
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.

4 participants