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

test update detector with aggregation rules #1423

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Dec 16, 2024

Description

Since detectors with sigme aggregation rules create a single match_all doc level monitor to perform chained findings, we cannot use query_id of the doc level monitor to perform trigger condition where alerts are created on rule matches.

We add the rule id to tag so that we can create doc level trigger condition to match something like `
_(query[tag=cloudtrail]) && (query[tag=agg_rule_id1] || query [tag=agg_rule_id2])
instead of doing (query[tag=cloudtrail]) && (query[id=agg_rule_id1] || query [id=agg_rule_id2])
since query id of chained findings doc level monitor cannot associate to multiple agg rules that it will alert for.

@eirsep eirsep merged commit 8a4176b into opensearch-project:main Dec 17, 2024
6 of 9 checks passed
@opensearch-trigger-bot
Copy link
Contributor

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

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

opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423)

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 8a4176b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423)

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 8a4176b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423)

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 8a4176b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423)

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 8a4176b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423)

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 8a4176b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423)

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 8a4176b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
eirsep pushed a commit that referenced this pull request Dec 17, 2024
…rules (#1423) (#1430)

(cherry picked from commit 8a4176b)

Signed-off-by: Surya Sashank Nistala <[email protected]>
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>
@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:

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

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

sbcd90 pushed a commit that referenced this pull request Dec 18, 2024
…rules (#1423) (#1428)

(cherry picked from commit 8a4176b)

Signed-off-by: Surya Sashank Nistala <[email protected]>
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>
sbcd90 pushed a commit that referenced this pull request Dec 18, 2024
…rules (#1423) (#1426)

(cherry picked from commit 8a4176b)

Signed-off-by: Surya Sashank Nistala <[email protected]>
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.

3 participants