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

Support more cases for detection; use code editor for condition #783

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

amsiglan
Copy link
Collaborator

@amsiglan amsiglan commented Nov 16, 2023

Description

This PR updates rule creation visual editor:

  • Reverts back to using code editor for condition so that we support every condition format
image
  • Relaxes some regex checks to support wider field names and conditions
  • Allows same field name to be used multiple time to support use case of startWith and endsWith
image
  • Allows empty fields to support keywords use case. image

Issues Resolved

#772, opensearch-project/security-analytics#683, #774

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>
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (faf524c) 31.17% compared to head (629abb8) 31.14%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #783      +/-   ##
==========================================
- Coverage   31.17%   31.14%   -0.03%     
==========================================
  Files         151      151              
  Lines        5008     5005       -3     
  Branches      910      857      -53     
==========================================
- Hits         1561     1559       -2     
+ Misses       3257     3255       -2     
- Partials      190      191       +1     

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

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan amsiglan mentioned this pull request Nov 21, 2023
1 task
@amsiglan amsiglan merged commit b3ddb58 into opensearch-project:main Nov 21, 2023
7 of 9 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-783-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b3ddb5836308231aeb664506ff508a48f1570a61
# Push it to GitHub
git push --set-upstream origin backport/backport-783-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

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

@amsiglan amsiglan added the backport 2.11 PRs to be backported to 2.11 branch label Nov 21, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.11 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.11 2.11
# Navigate to the new working tree
cd .worktrees/backport-2.11
# Create a new branch
git switch --create backport/backport-783-to-2.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b3ddb5836308231aeb664506ff508a48f1570a61
# Push it to GitHub
git push --set-upstream origin backport/backport-783-to-2.11
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.11

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

amsiglan added a commit to amsiglan/security-analytics-dashboards-plugin that referenced this pull request Nov 21, 2023
…search-project#783)

* support more cases for detection; use code editor for condition

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

* updated snapshots

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 to amsiglan/security-analytics-dashboards-plugin that referenced this pull request Nov 22, 2023
…search-project#783)

* support more cases for detection; use code editor for condition

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

* updated snapshots

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 Nov 29, 2023
… condition (#783) (#795)

* Support more cases for detection; use code editor for condition (#783)

* support more cases for detection; use code editor for condition

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

* updated snapshots

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>

* fixed babel config

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

* fixed cypress test

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

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.10 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.10 2.10
# Navigate to the new working tree
cd .worktrees/backport-2.10
# Create a new branch
git switch --create backport/backport-783-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b3ddb5836308231aeb664506ff508a48f1570a61
# Push it to GitHub
git push --set-upstream origin backport/backport-783-to-2.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.10

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

amsiglan added a commit that referenced this pull request Jan 3, 2024
…condition (#783) (#846)

* Support more cases for detection; use code editor for condition (#783)

* support more cases for detection; use code editor for condition

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

* updated snapshots

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>

* updated cypress workflow

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

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.10 backport 2.11 PRs to be backported to 2.11 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants