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

windows: improve regular expression search efficiency to allow parsing large events #6154

Merged
merged 1 commit into from
May 18, 2023

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented May 10, 2023

What does this PR do?

Due to recursive descent, the previous patterns resulted in significant fruitless work, surpassing the regular expression cost limit. This short-circuits the search to improve efficiency.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@efd6 efd6 added bug Something isn't working, use only for issues Team:Security-External Integrations Integration:windows Windows labels May 10, 2023
@efd6 efd6 self-assigned this May 10, 2023
@elasticmachine
Copy link

elasticmachine commented May 10, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-05-14T23:59:35.891+0000

  • Duration: 15 min 11 sec

Test stats 🧪

Test Results
Failed 0
Passed 129
Skipped 0
Total 129

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented May 10, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (4/4) 💚
Files 87.5% (7/8) 👎 -9.634
Classes 87.5% (7/8) 👎 -9.634
Methods 83.516% (76/91) 👎 -8.957
Lines 92.803% (5145/5544) 👍 0.818
Conditionals 100.0% (0/0) 💚

@efd6 efd6 marked this pull request as ready for review May 10, 2023 23:27
@efd6 efd6 requested review from a team as code owners May 10, 2023 23:27
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

…g large events

Due to recursive descent, the previous patterns resulted in significant fruitless
work, surpassing the regular expression cost limit. This short-circuits the search
to improve efficiency.
@efd6 efd6 merged commit 75c6fad into elastic:main May 18, 2023
@elasticmachine
Copy link

Package windows - 1.21.1 containing this change is available at https://epr.elastic.co/search?package=windows

efd6 added a commit to efd6/beats that referenced this pull request Jul 31, 2023
…erformance

The details regexp pattern for the powershell data stream was improved
in the windows integration in elastic/integrations#6154 to reduce
backtracking costs that caused regexp costs to exceed the set runtime
limits. The same pattern on other data streams and in winlogbeat was not
updated. This change brings winlogbeat up to date with the change.
efd6 added a commit to efd6/beats that referenced this pull request Jul 31, 2023
…erformance

The details regexp pattern for the powershell data stream was improved
in the windows integration in elastic/integrations#6154 to reduce
backtracking costs that caused regexp costs to exceed the set runtime
limits. The same pattern on other data streams and in winlogbeat was not
updated. This change brings winlogbeat up to date with the change.
efd6 added a commit to elastic/beats that referenced this pull request Jul 31, 2023
…erformance (#36178)

The details regexp pattern for the powershell data stream was improved
in the windows integration in elastic/integrations#6154 to reduce
backtracking costs that caused regexp costs to exceed the set runtime
limits. The same pattern on other data streams and in winlogbeat was not
updated. This change brings winlogbeat up to date with the change.
mergify bot pushed a commit to elastic/beats that referenced this pull request Jul 31, 2023
…erformance (#36178)

The details regexp pattern for the powershell data stream was improved
in the windows integration in elastic/integrations#6154 to reduce
backtracking costs that caused regexp costs to exceed the set runtime
limits. The same pattern on other data streams and in winlogbeat was not
updated. This change brings winlogbeat up to date with the change.

(cherry picked from commit d8db41b)
efd6 pushed a commit to elastic/beats that referenced this pull request Jul 31, 2023
…etails regexp pattern performance (#36186)

The details regexp pattern for the powershell data stream was improved
in the windows integration in elastic/integrations#6154 to reduce
backtracking costs that caused regexp costs to exceed the set runtime
limits. The same pattern on other data streams and in winlogbeat was not
updated. This change brings winlogbeat up to date with the change.

(cherry picked from commit d8db41b)
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
…erformance (elastic#36178)

The details regexp pattern for the powershell data stream was improved
in the windows integration in elastic/integrations#6154 to reduce
backtracking costs that caused regexp costs to exceed the set runtime
limits. The same pattern on other data streams and in winlogbeat was not
updated. This change brings winlogbeat up to date with the change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues Integration:windows Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[windows][Powershell/Operational] command invocation parsing triggers regex circuit breaker
3 participants