Tx sub states/v1.11#15657
Conversation
|
ERROR: ERROR: QA failed on ASAN_TLPR1_cfg. Pipeline = 32077 |
10b8507 to
b7e0e94
Compare
|
ERROR: ERROR: QA failed on ASAN_TLPR1_cfg. Pipeline = 32080 |
| }); | ||
| //we do not expect more data from client | ||
| tx.progress_ts = HTTP2TxProgress::HTTP2ProgClosed; | ||
| if let HTTP2Progress::STREAM(ref mut stream_tx) = tx.progress { |
There was a problem hiding this comment.
not introduced by this PR, but it's really icky that we modify the progress here from the detection path
There was a problem hiding this comment.
This is not really the detection path. This function should be put in http2.rs I guess
| stream_tx.progress_tc = HTTP2TxProgress::HTTP2ProgHeaders; | ||
| } | ||
| } else { | ||
| panic!("global"); |
There was a problem hiding this comment.
TODO push promise might get here as well?
There was a problem hiding this comment.
push promise is not so nice anyways now, there is https://redmine.openinfosecfoundation.org/issues/7317 about it
| child_stream_id: 0, | ||
| progress_tc: HTTP2TxProgress::HTTP2ProgStart, | ||
| progress_ts: HTTP2TxProgress::HTTP2ProgStart, | ||
| progress: HTTP2Progress::STREAM(HTTP2StreamProgress::init()), |
There was a problem hiding this comment.
maybe init should be started or something, to reflect its initialized to that state
| SCJbSetBool(ctx.js, "is_mpm", app->mpm); | ||
| SCJbSetString(ctx.js, "app_proto", AppProtoToString(app->alproto)); | ||
| SCJbSetUint(ctx.js, "progress", app->progress); | ||
| SCJbSetUint(ctx.js, "sub_state", app->sub_state); |
| const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, | ||
| uint8_t flags, void *_alstate, void *tx, uint64_t tx_id); | ||
|
|
||
| void DetectFileRegisterProto( |
There was a problem hiding this comment.
should not be removed
| { .alproto = ALPROTO_SMTP, .direction = SIG_FLAG_TOSERVER }, { .alproto = ALPROTO_UNKNOWN } | ||
| }; | ||
|
|
||
| void DetectFileRegisterProto( |
b7e0e94 to
d97f799
Compare
|
ERROR: ERROR: QA failed on ASAN_TLPR1_cfg. Pipeline = 32083 |
d97f799 to
34909ea
Compare
|
Information: QA ran without warnings. Pipeline = 32086 |
34909ea to
7f5b89e
Compare
|
Information: QA ran without warnings. Pipeline = 32089 |
6faaedb to
ce0d7af
Compare
|
WARNING:
Pipeline = 32091 |
|
Information: QA ran without warnings. Pipeline = 32101 |
ce0d7af to
7fe8f33
Compare
|
Information: QA ran without warnings. Pipeline = 32105 |
7fe8f33 to
615d387
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #15657 +/- ##
==========================================
- Coverage 82.96% 82.95% -0.02%
==========================================
Files 1003 1003
Lines 275031 275666 +635
==========================================
+ Hits 228192 228669 +477
- Misses 46839 46997 +158
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| && head.ftype != parser::HTTP2FrameType::GoAway as u8 | ||
| { | ||
| self.set_event(HTTP2Event::InvalidFrameHeader); | ||
| input = rem; |
There was a problem hiding this comment.
In all other cases we use &rem[hlsafe..]. Is hlsafe always 0 in these cases?
There was a problem hiding this comment.
Missed this, I've adopted the existing pattern here as well.
Split into 2 sub-states: - stream, which has the "HTTP" requests and responses, including DOH2 - global, which has the settings and other global or control handling Introduce a simpler progress tracking for the global sub state: - HTTP2ProgGlobalStart and HTTP2ProgGlobalComplete. The stream sub state uses the same state machine as before. Ticket: OISF#8386.
Hard coded for now.
Each keyword supporting DOH2 must register explicitly
Now that DNS keywords are no longer registered for DOH2, the keywords need to manually registered for DOH2.
Now that HTTP keywords are no longer automatically registered for HTTP/2, register them manually.
DNS/HTTP2 no longer automatically registers all keywords also for DOH2. Instead, the DNS keywords and HTTP/2 stream keywords are registered for DOH2 explicitly as well. - flow alproto DOH2 + engine DOH2 -> inspect inner DNS - flow alproto DOH2 + engine HTTP2 -> inspect outer HTTP/2 - flow alproto DOH2 + engine UNKNOWN -> inspect outer HTTP/2
For the most part hard coded for HTTP/2 for now.
1c85b5f to
e89fafd
Compare
Register a generic list for each sub state / progress combo.
Otherwise we'd have to re-register the relevant callbacks.
With substate support the fixed table approach for policies was no longer a good fit, so convert to a hash table. The policies are stored per alproto, sub_state, progress and direction.
Now that there is a policy hash, make the alert signature object a member of that to avoid another hash table lookup.
Check that sub state handling is correct.
e89fafd to
4cd96f6
Compare
|
WARNING:
Pipeline = 32263 |
In preparation of being able to log it.
SV_BRANCH=OISF/suricata-verify#3168
Work in progress branch on https://redmine.openinfosecfoundation.org/issues/8386
Defines 2 sub-states for HTTP2:
Each has it's own state machine.
Issues/open questions:
accept:tx http2:stream:request_complete ...is not reliable. Not sure yet how to handle this.http.uri; absent;orhttp.uri; content:!"/index"causes matches on the global txs? I think no, but this is a behavior changes vs main.For review:
TODO