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

[Backport 2.x] Notification security fix #861

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport e0b7a5a from #852

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)
@opensearch-trigger-bot opensearch-trigger-bot bot requested a review from a team April 17, 2023 17:07
lezzago added 2 commits April 17, 2023 11:26
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
@codecov-commenter
Copy link

Codecov Report

Merging #861 (9a4cd14) into 2.x (4f5d97b) will increase coverage by 0.25%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##                2.x     #861      +/-   ##
============================================
+ Coverage     76.37%   76.62%   +0.25%     
  Complexity      116      116              
============================================
  Files           125      125              
  Lines          7051     7055       +4     
  Branches       1033     1034       +1     
============================================
+ Hits           5385     5406      +21     
+ Misses         1139     1123      -16     
+ Partials        527      526       -1     
Impacted Files Coverage Δ
...in/kotlin/org/opensearch/alerting/MonitorRunner.kt 65.88% <100.00%> (+2.59%) ⬆️
...rch/alerting/opensearchapi/OpenSearchExtensions.kt 56.66% <100.00%> (+6.66%) ⬆️

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@AWSHurneyt AWSHurneyt merged commit 6b3c09c into 2.x Apr 17, 2023
@github-actions github-actions bot deleted the backport/backport-852-to-2.x branch April 17, 2023 19:17
stevanbz pushed a commit to stevanbz/alerting that referenced this pull request Apr 17, 2023
* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)

* remove unneeded import

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
lezzago added a commit that referenced this pull request Apr 17, 2023
* Notification security fix (#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin



* compile fix



* refactored user_info injection to use InjectSecurity



* ktlint fix



---------


(cherry picked from commit e0b7a5a)

* remove unneeded import



---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
stevanbz added a commit to stevanbz/alerting that referenced this pull request Apr 17, 2023
…ensearch-project#863)

* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin



* compile fix



* refactored user_info injection to use InjectSecurity



* ktlint fix



---------


(cherry picked from commit e0b7a5a)

* remove unneeded import



---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
stevanbz added a commit to stevanbz/alerting that referenced this pull request Apr 17, 2023
…ensearch-project#863)

* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin



* compile fix



* refactored user_info injection to use InjectSecurity



* ktlint fix



---------


(cherry picked from commit e0b7a5a)

* remove unneeded import



---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
lezzago added a commit that referenced this pull request Apr 17, 2023
#857)

* Refactored workflowIndexing validation - removed coroutine and context client context lost

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored getting the workflows

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Changed the logic according to secure test findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* [Backport 2.x] Notification security fix (#861) (#863)

* Notification security fix (#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin



* compile fix



* refactored user_info injection to use InjectSecurity



* ktlint fix



---------


(cherry picked from commit e0b7a5a)

* remove unneeded import



---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Stashed user together with it's roles

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
eirsep pushed a commit that referenced this pull request May 24, 2023
#857)

* Refactored workflowIndexing validation - removed coroutine and context client context lost

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored getting the workflows

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Changed the logic according to secure test findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* [Backport 2.x] Notification security fix (#861) (#863)

* Notification security fix (#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin



* compile fix



* refactored user_info injection to use InjectSecurity



* ktlint fix



---------


(cherry picked from commit e0b7a5a)

* remove unneeded import



---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Stashed user together with it's roles

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
eirsep pushed a commit to eirsep/alerting that referenced this pull request May 24, 2023
opensearch-project#857)

* Refactored workflowIndexing validation - removed coroutine and context client context lost

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored getting the workflows

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Changed the logic according to secure test findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* [Backport 2.x] Notification security fix (opensearch-project#861) (opensearch-project#863)

* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

* compile fix

* refactored user_info injection to use InjectSecurity

* ktlint fix

---------

(cherry picked from commit e0b7a5a)

* remove unneeded import

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Stashed user together with it's roles

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
eirsep pushed a commit to eirsep/alerting that referenced this pull request May 25, 2023
opensearch-project#857)

* Refactored workflowIndexing validation - removed coroutine and context client context lost

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored getting the workflows

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Changed the logic according to secure test findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* [Backport 2.x] Notification security fix (opensearch-project#861) (opensearch-project#863)

* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

* compile fix

* refactored user_info injection to use InjectSecurity

* ktlint fix

---------

(cherry picked from commit e0b7a5a)

* remove unneeded import

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Stashed user together with it's roles

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
eirsep pushed a commit to eirsep/alerting that referenced this pull request May 25, 2023
opensearch-project#857)

* Refactored workflowIndexing validation - removed coroutine and context client context lost

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored getting the workflows

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Changed the logic according to secure test findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* [Backport 2.x] Notification security fix (opensearch-project#861) (opensearch-project#863)

* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

* compile fix

* refactored user_info injection to use InjectSecurity

* ktlint fix

---------

(cherry picked from commit e0b7a5a)

* remove unneeded import

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Stashed user together with it's roles

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
eirsep added a commit that referenced this pull request May 25, 2023
* Added layer for creating and updating the workflow (#831)

* Renamed chainedFindings to chainedMonitorFindings

* Removed unecessary mappings from workflow definition

* Improved logging when saving the workflows

* Added a workflow id in response

* Added role check and index access once the workflow is being created

* Updated mappings for the workflow

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Fixed xContent dependencies due to OSCore changes (#839)

Signed-off-by: Angie Zhang <langelzh@amazon.com>

* Dependency fix (#846)

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Refactored workflowIndexing validation - removed coroutine and contex… (#857)

* Refactored workflowIndexing validation - removed coroutine and context client context lost

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored getting the workflows

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Changed the logic according to secure test findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* [Backport 2.x] Notification security fix (#861) (#863)

* Notification security fix (#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

* compile fix

* refactored user_info injection to use InjectSecurity

* ktlint fix

---------

(cherry picked from commit e0b7a5a)

* remove unneeded import

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Stashed user together with it's roles

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Added workflow execution logic (#850)

* Added workflow execution logic

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Adjusted code according to comments

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Updated version of the findings json

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Updating the workflow metadata in the case of updating flag set to false while the metadata alerady exist

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Added logging for workflow metadata update

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Added Rest Execute Workflow action

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Extended workflow context with workflowMetadataId. Adjusted the doc level monitor findings

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Updated conditions for unstashing the context when indexing and deleting the workflow

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Added fix when executing the workflow and when chained findings index… (#890)

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Fixed deleting monitor workflow metadata (#882)

* Fixed deleting monitor metadata and workflow metadata.

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>

* fix monitor metadata error from conflict resolution

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

* remove unused import

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

* remove rest execute workflow action

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

* increment schema version for findings mapping json

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

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Angie Zhang <langelzh@amazon.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Co-authored-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Co-authored-by: Angie Zhang <langelzh@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
@opensearch-trigger-bot
Copy link
Contributor Author

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

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

@opensearch-trigger-bot
Copy link
Contributor Author

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-861-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6b3c09cb326e05ceabbd2d37d1b9d1ab233f5b81
# Push it to GitHub
git push --set-upstream origin backport/backport-861-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-861-to-2.5.

AWSHurneyt pushed a commit to AWSHurneyt/OpenSearch-Alerting that referenced this pull request May 31, 2023
* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)

* remove unneeded import

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
AWSHurneyt pushed a commit to AWSHurneyt/OpenSearch-Alerting that referenced this pull request Jun 6, 2023
* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)

* remove unneeded import

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
lezzago added a commit to lezzago/alerting-opensearch that referenced this pull request Jun 8, 2023
* Notification security fix (opensearch-project#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)

* remove unneeded import

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
lezzago added a commit that referenced this pull request Jun 8, 2023
* Added exception check once the .opendistro-alerting-config index is b… (#650)

* Added exception check once the .opendistro-alerting-config index is being created

During .opendistro-alerting-config index creation, if ResourceAlreadyExists exception is being raised, the flow will check first if the index is in yellow state and then it will re-try to index monitor

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* Formating of the file fixed

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>

* refactored DeleteMonitor Action to be synchronious (#628) (#630)

* refactored DeleteMonitor Action to be synchronious

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

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

* [Backport 2.x] QueryIndex rollover when field mapping limit is reached (#729)

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

* Mappings fix backport 2.x (#730)

* Added support for "nested" mappings (#645)

* example

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

* fixed updating mappings for queryIndex

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

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

* mappings traversal bug fix (#669)

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

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

* Added unwrapping exception from core; added more debug logs (#728)

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

* Add DataSources test for future backports

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

* fix  percolator mapping error when having field name 'type' (#726)

Signed-off-by: Raj Chakravarthi <raj@icedome.ca>

* [BUG] ExecuteMonitor inserting metadata doc during dry run (#758)

* execute monitor bugfix

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

* added IT

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

* fixed created retval when skipIndex=true

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

---------

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

* fix for ERROR alert state generation in doc-level monitors (#768)

Signed-off-by: Subhobrata Dey <sbcd90@gmail.com>

* Adjusting max field index setting dynamically for query index (#776)

* added adjusting max field index setting dynamicly for query index

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

* Multiple indices support in DocLevelMonitorInput (#784)

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

* Doc transform 2.x backport (#853)

* conflict resovle - backport from main to 2.x

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

* fixed module class names

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

---------

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

* Update config index schema if needed at the start of each monitor execution (#849)

* Update config index schema if needed at the start of each monitor execution

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

* Mappings parsing fix (#851)

* fixed mappings parsing when field name named "properties" exists in mappings

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

* message typo fix

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

---------

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

* [Backport 2.x] Notification security fix (#861)

* Notification security fix (#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)

* remove unneeded import

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>

* Fixed a bug that prevented alerts from being generated for doc level monitors that use wildcard characters in index names. (#894)

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* fixed security tests (#484) (#794)

* fixed security tests

Signed-off-by: Raj Chakravarthi <raj@icedome.ca>
(cherry picked from commit c51940f)

---------

Signed-off-by: Stevan Buzejic <buzejic.stevan@gmail.com>
Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Raj Chakravarthi <raj@icedome.ca>
Signed-off-by: Subhobrata Dey <sbcd90@gmail.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
Co-authored-by: Stevan Buzejic <30922513+stevanbz@users.noreply.github.com>
Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: RAJ CHAKRAVARTHI <49325334+raj-chak@users.noreply.github.com>
Co-authored-by: Subhobrata Dey <sbcd90@gmail.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: AWSHurneyt <hurneyt@amazon.com>
Co-authored-by: RAJ CHAKRAVARTHI <raj@icedome.ca>
AWSHurneyt added a commit that referenced this pull request Jun 8, 2023
* [Backport 2.x] QueryIndex rollover when field mapping limit is reached (#729)

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

* log error messages and clean up monitor when indexing doc level queries or metadata creation fails (#900) (#912)

* log errors and clean up monitor when indexing doc level queries or metadata creation fails
* refactor delete monitor action to re-use delete methods
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* [Backport 2.x] Notification security fix (#861)

* Notification security fix (#852)

* added injecting whole user object in threadContext before calling notification APIs so that backend roles are available to notification plugin

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

* compile fix

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

* refactored user_info injection to use InjectSecurity

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

* ktlint fix

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

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
(cherry picked from commit e0b7a5a)

* remove unneeded import

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>

---------

Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Added missing imports.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Multiple indices support in DocLevelMonitorInput (#784) (#808)

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

* Removed redundant calls to initDocLevelQueryIndex and indexDocLevelQueries.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Fixed a bug that prevented alerts from being generated for doc level monitors that use wildcard characters in index names. (#894) (#902)

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
(cherry picked from commit 8c033b9)

Co-authored-by: AWSHurneyt <hurneyt@amazon.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Resolved backport issue for PR 729.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Resolved backport issue for PR 758.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

---------

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Co-authored-by: Petar Dzepina <petar.dzepina@gmail.com>
Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Agrawal <ashisagr@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.

4 participants