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

fix detector writeTo() method missing fields #695

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Oct 26, 2023

Description

fix detector writeTo() method missing fields.

Fixes flaky test org.opensearch.securityanalytics.model.WriteableTests.testDetectorAsAStream()

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.

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #695 (a1bbde1) into main (92a620d) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main     #695      +/-   ##
============================================
+ Coverage     26.91%   26.94%   +0.02%     
  Complexity     1064     1064              
============================================
  Files           274      274              
  Lines         12346    12351       +5     
  Branches       1343     1343              
============================================
+ Hits           3323     3328       +5     
  Misses         8748     8748              
  Partials        275      275              
Files Coverage Δ
...g/opensearch/securityanalytics/model/Detector.java 65.11% <100.00%> (+0.58%) ⬆️

@eirsep eirsep merged commit 7a45203 into opensearch-project:main Oct 26, 2023
11 of 15 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 26, 2023
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 7a45203)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 26, 2023
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 7a45203)
eirsep added a commit that referenced this pull request Oct 26, 2023
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 7a45203)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
eirsep added a commit that referenced this pull request Oct 26, 2023
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 7a45203)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
riysaxen-amzn pushed a commit to riysaxen-amzn/security-analytics that referenced this pull request Feb 20, 2024
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.9 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.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport/backport-695-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7a452039e4bb7c6010cebffb1a455b84a23514f3
# Push it to GitHub
git push --set-upstream origin backport/backport-695-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.5 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.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-695-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7a452039e4bb7c6010cebffb1a455b84a23514f3
# Push it to GitHub
git push --set-upstream origin backport/backport-695-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.7 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.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport/backport-695-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7a452039e4bb7c6010cebffb1a455b84a23514f3
# Push it to GitHub
git push --set-upstream origin backport/backport-695-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7

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

engechas pushed a commit to engechas/security-analytics that referenced this pull request Mar 14, 2024
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
@engechas engechas mentioned this pull request Mar 15, 2024
5 tasks
goyamegh pushed a commit to goyamegh/security-analytics that referenced this pull request Mar 15, 2024
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
engechas added a commit that referenced this pull request Mar 15, 2024
* query_field_names bugfix (#335)

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>

* Reduce log level for informative message (#203)

Signed-off-by: Enrico Tröger <enrico.troeger@uvena.de>

* fix detector writeTo() method missing fields (#695)

* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix null query filter conversion from sigma to query string query (#722)

* fix null query filter conversion from sigma to query string query

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix rule to query conversion tests for null filter

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* enhance test to verify non null doc doesnt match null query

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* Bump version 2.5.1, fix build

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Manual cherry-pick of #873

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Fix miss from manual cherry-pick

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Undo exceptional case not originally present

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Revert test from previous commit reversion

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Fix another miss from manual cherry-pick

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

* Revert behavior for no rules in detector

Signed-off-by: Chase Engelbrecht <engechas@amazon.com>

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
Signed-off-by: Enrico Tröger <enrico.troeger@uvena.de>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: Chase Engelbrecht <engechas@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Enrico Tröger <enrico.troeger@uvena.de>
Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
riysaxen-amzn pushed a commit that referenced this pull request Mar 18, 2024
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
# Conflicts:
#	src/main/java/org/opensearch/securityanalytics/model/Detector.java
riysaxen-amzn pushed a commit that referenced this pull request Mar 18, 2024
* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
@riysaxen-amzn riysaxen-amzn mentioned this pull request Mar 18, 2024
5 tasks
riysaxen-amzn added a commit that referenced this pull request Mar 18, 2024
* Fix duplicate ecs mappings which returns incorrect log index field in mapping view API (#786) (#788)

* field mapping changes

Signed-off-by: Joanne Wang <jowg@amazon.com>

* add integ test

Signed-off-by: Joanne Wang <jowg@amazon.com>

* turn unmappedfieldaliases as set and add integ test

Signed-off-by: Joanne Wang <jowg@amazon.com>

* add comments

Signed-off-by: Joanne Wang <jowg@amazon.com>

* fix integ tests

Signed-off-by: Joanne Wang <jowg@amazon.com>

* moved logic to method for better readability

Signed-off-by: Joanne Wang <jowg@amazon.com>

---------

Signed-off-by: Joanne Wang <jowg@amazon.com>

* Fix get mappings view API incorrectly returning ecs path (#867)

* add logic and integ tests to not add duplicate to log-types-config index

Signed-off-by: Joanne Wang <jowg@amazon.com>

* change naming for existingFieldMapping and change contains to equals

Signed-off-by: Joanne Wang <jowg@amazon.com>

---------

Signed-off-by: Joanne Wang <jowg@amazon.com>

* fix integ test (#918)

Signed-off-by: Joanne Wang <jowg@amazon.com>

* fix detector writeTo() method missing fields (#695)

* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* removing threatIntel related code

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

* removing threatIntel related code

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

* ignore flaky tests

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

---------

Signed-off-by: Joanne Wang <jowg@amazon.com>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: Riya Saxena <riysaxen@amazon.com>
Co-authored-by: Joanne Wang <jowg@amazon.com>
Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
@toepkerd toepkerd mentioned this pull request Mar 19, 2024
5 tasks
engechas pushed a commit that referenced this pull request Mar 19, 2024
* Version bump to 2.7.1

Signed-off-by: Megha Goyal <goyamegh@amazon.com>

* fix detector writeTo() method missing fields (#695)

* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix test

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix null query filter conversion from sigma to query string query (#722)

* fix null query filter conversion from sigma to query string query

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix rule to query conversion tests for null filter

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* enhance test to verify non null doc doesnt match null query

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* * #709 Return empty response for empty mappings and no applied aliases

Signed-off-by: Megha Goyal <goyamegh@amazon.com>

* Adding integ tests for empty mappings/aliases use-cases

Signed-off-by: Megha Goyal <goyamegh@amazon.com>

* Fix unit tests for MappingsTraverser

Signed-off-by: Megha Goyal <goyamegh@amazon.com>

---------

Signed-off-by: Megha Goyal <goyamegh@amazon.com>

* fixing build failures for previous cherry-pick PR for SAP2.7 (to be squashed)

Signed-off-by: Dennis Toepker <toepkerd@amazon.com>

* Pass rule field names in doc level queries during monitor/creation. Remove blocking actionGet() calls  (#873)

* pass query field names in doc level queries during monitor creation/updation

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* remove actionGet() and change get index mapping call to event driven flow

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix chained findings monitor

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* add finding mappings

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* remove test messages from logs

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* revert build.gradle change

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

---------

Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fixing an import

Signed-off-by: Dennis Toepker <toepkerd@amazon.com>

---------

Signed-off-by: Megha Goyal <goyamegh@amazon.com>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Co-authored-by: Megha Goyal <goyamegh@amazon.com>
Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
Co-authored-by: Megha Goyal <56077967+goyamegh@users.noreply.github.com>
Co-authored-by: Dennis Toepker <toepkerd@amazon.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.

None yet

4 participants