-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Defend Workflows] Fix: proper regexp test for dynamic parameters presence #150696
[Defend Workflows] Fix: proper regexp test for dynamic parameters presence #150696
Conversation
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
…sence (elastic#150696) (cherry picked from commit b5dde1f)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…rs presence (#150696) (#150749) # Backport This will backport the following commits from `main` to `8.7`: - [[Defend Workflows] Fix: proper regexp test for dynamic parameters presence (#150696)](#150696) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Konrad Szwarc","email":"konrad.szwarc@elastic.co"},"sourceCommit":{"committedDate":"2023-02-09T17:02:53Z","message":"[Defend Workflows] Fix: proper regexp test for dynamic parameters presence (#150696)","sha":"b5dde1fcf5f54479906542a178cb87c616c7cb4f","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Defend Workflows","v8.7.0","v8.6.2","v8.8.0"],"number":150696,"url":"https://github.com/elastic/kibana/pull/150696","mergeCommit":{"message":"[Defend Workflows] Fix: proper regexp test for dynamic parameters presence (#150696)","sha":"b5dde1fcf5f54479906542a178cb87c616c7cb4f"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.6"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.6","label":"v8.6.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150696","number":150696,"mergeCommit":{"message":"[Defend Workflows] Fix: proper regexp test for dynamic parameters presence (#150696)","sha":"b5dde1fcf5f54479906542a178cb87c616c7cb4f"}}]}] BACKPORT--> Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
Dynamic parameters are not part of 8.6, so the backport to 8.6.x is not required. |
Bug:
When both Pack and Single Query osQuery response actions were defined within rule's Response Actions, parameter of Single Query wasn't replaced with event data.
Cause:
Due to regexp test inconsistent behaviour (known bug, read more here) dynamic parameter was being found for pack queries but for the following, single query, was being set to false negative.
Fix:
Wrapping regexp string in RegExp constructor fixes the issue.
Before:
After: