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

Dont sanitize strings filters #625

Merged
merged 3 commits into from
Jul 18, 2016
Merged

Dont sanitize strings filters #625

merged 3 commits into from
Jul 18, 2016

Conversation

mstemm
Copy link
Contributor

@mstemm mstemm commented Jul 12, 2016

Stop sanitizing string values when comparing events to filtering expressions. String values are still sanitized when displaying events.

To give an idea of the cpu savings, running falco with a fairly optimized set of rules (but not the complete set of changes like optimized in (...) and per-event filters) had a cpu usage of 18% with the phoronix apache test. Disabling string optimization reduced the cpu usage to 14%.

@mstemm mstemm force-pushed the dont-sanitize-strings-filters branch from 143bc58 to 9563e90 Compare July 12, 2016 21:56
It turns out that with -O3 (release flags), using erase/remove_if with
an operator struct is slightly faster than the inline version that was
here, as the compiler can inline the operators. It isn't faster with -O2
and is much slower without optimization.

Optimize for the release build by adding the operators back.
Making whitespace changes in separate commit.
Modify sinsp_filter_check::extract to take an optional argument
sanitize_strings, defaulting to true. It controls whether the
filtercheck should sanitize any string arguments when extracting the
value from the event.

The only place where it is set to false is in
sinsp_filter_check::compare(). This means that when comparing events
against a filter expression, any string values are not sanitized. They
will still be sanitized when the events are displayed.

This significantly speeds up users like falco that have complicated
filter expressions that run against lots of events.
@mstemm mstemm force-pushed the dont-sanitize-strings-filters branch from 9563e90 to 729bbef Compare July 18, 2016 16:50
@mstemm mstemm merged commit abf11d8 into dev Jul 18, 2016
@mstemm mstemm deleted the dont-sanitize-strings-filters branch July 18, 2016 16:51
mstemm added a commit that referenced this pull request Jul 19, 2016
While merging together #624 (multi string search) and #625 (don't
sanitize strings), the length was only being set when string
sanitization was enabled.

Additionally, the length was not being initialized to 0, meaning that it
was not defined.

This led to some FPs for some of the falco tests.
mstemm added a commit that referenced this pull request Jul 19, 2016
While merging together #624 (multi string search) and #625 (don't
sanitize strings), the length was only being set when string
sanitization was enabled.

Additionally, the length was not being initialized to 0, meaning that it
was not defined.

This led to some FPs for some of the falco tests.
gianlucaborello added a commit that referenced this pull request Aug 16, 2016
While merging together #624 (multi string search) and #625 (don't
sanitize strings), the length was only being set when string
sanitization was enabled.

Additionally, the length was not being initialized to 0, meaning that it
was not defined.

This led to some FPs for some of the falco tests.
gianlucaborello added a commit that referenced this pull request Aug 16, 2016
* Switch back to erase/remove_if for sanitization.

It turns out that with -O3 (release flags), using erase/remove_if with
an operator struct is slightly faster than the inline version that was
here, as the compiler can inline the operators. It isn't faster with -O2
and is much slower without optimization.

Optimize for the release build by adding the operators back.

* Whitespace diffs.

Making whitespace changes in separate commit.

* Make sanitize_string cfgable and off for filters.

Modify sinsp_filter_check::extract to take an optional argument
sanitize_strings, defaulting to true. It controls whether the
filtercheck should sanitize any string arguments when extracting the
value from the event.

The only place where it is set to false is in
sinsp_filter_check::compare(). This means that when comparing events
against a filter expression, any string values are not sanitized. They
will still be sanitized when the events are displayed.

This significantly speeds up users like falco that have complicated
filter expressions that run against lots of events.
dmyerscough pushed a commit to dmyerscough/sysdig that referenced this pull request Mar 3, 2017
* Switch back to erase/remove_if for sanitization.

It turns out that with -O3 (release flags), using erase/remove_if with
an operator struct is slightly faster than the inline version that was
here, as the compiler can inline the operators. It isn't faster with -O2
and is much slower without optimization.

Optimize for the release build by adding the operators back.

* Whitespace diffs.

Making whitespace changes in separate commit.

* Make sanitize_string cfgable and off for filters.

Modify sinsp_filter_check::extract to take an optional argument
sanitize_strings, defaulting to true. It controls whether the
filtercheck should sanitize any string arguments when extracting the
value from the event.

The only place where it is set to false is in
sinsp_filter_check::compare(). This means that when comparing events
against a filter expression, any string values are not sanitized. They
will still be sanitized when the events are displayed.

This significantly speeds up users like falco that have complicated
filter expressions that run against lots of events.
dmyerscough pushed a commit to dmyerscough/sysdig that referenced this pull request Mar 3, 2017
While merging together draios#624 (multi string search) and draios#625 (don't
sanitize strings), the length was only being set when string
sanitization was enabled.

Additionally, the length was not being initialized to 0, meaning that it
was not defined.

This led to some FPs for some of the falco tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant