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

Detect negated content absent buffer 2224 v25 #12162

Conversation

catenacyber
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/2224

Describe changes:

  • detect: adds absent keyword to match on absent buffer

SV_BRANCH=OISF/suricata-verify#1957

#11964 rebased as requested

Still the question of transforms : do you see a use case of buffer + transform + absent keyword ?
Or should we explicitly forbid it ?
cc @jlucovsky about transforms error

- DetectEngineInspectBufferHttpHeader is only used with ALPROTO_HTTP1
- engine->progress should be HTP_REQUEST_HEADERS or HTP_RESPONSE_HEADERS based on the direction
Ticket: 2224

It takes an argument to match only if the buffer is absent,
or it can still match if the buffer is present, but we test
the absence of some content.

For multi buffers, absent matches if there are 0 buffers.

For file keywords, absent matches if there is no file.
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 62.96296% with 60 lines in your changes missing coverage. Please review.

Project coverage is 49.85%. Comparing base (bd7d38e) to head (45ccc69).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12162      +/-   ##
==========================================
+ Coverage   49.81%   49.85%   +0.03%     
==========================================
  Files         909      909              
  Lines      257904   258055     +151     
==========================================
+ Hits       128467   128645     +178     
+ Misses     129437   129410      -27     
Flag Coverage Δ
fuzzcorpus 60.98% <38.75%> (+0.03%) ⬆️
livemode 19.43% <16.27%> (+<0.01%) ⬆️
pcap 44.45% <34.10%> (+0.03%) ⬆️
suricata-verify 62.73% <79.06%> (-0.01%) ⬇️
unittests 8.98% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 23590

@victorjulien
Copy link
Member

I propose we merge this first then look at the open questions. Esp the xform issue could use some more discussion including trying to come up with examples of why it should or should not work.

@victorjulien victorjulien added this to the 8.0 milestone Nov 28, 2024
@victorjulien
Copy link
Member

Merged in #12174, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants