suricata icon indicating copy to clipboard operation
suricata copied to clipboard

http: Use libhtp-rs.

Open catenacyber opened this issue 1 year ago • 3 comments

Link to redmine ticket: 2696

Describe changes:

  • Use libhtp-rs.

Rebased from #10764

Draft to see CI feedback with latest libhtp-rs changes, and not have too many conflicts

TODOs :

Still one oss-fuzz report for libhtp-rs to consider

There is still the big question : Where should libhtp-rs live ?

  1. Separate repo, released as a crate.
  2. Separate crate, but inside the suricata rust/ directory.
  3. Separate repo, as today with git clone and bundle

catenacyber avatar Apr 30 '24 19:04 catenacyber

To summarize my thoughts in one place:

  • Separate repo, released as a crate.

Ideal, but this will make it hard to always build against the main branch. Cargo.lock will pin it to a specific hash. If we want the same behavior as now, CI will have to add a step to update that crate in the Cargo.lock before building. And we'll want to make sure we commit that more regularly.

To replace the LIBHTP_REPO and LIBHTP_BRANCH vars will require some on-the-fly patching of Cargo.toml as well.

  • Separate crate, but inside the suricata rust/ directory.

Given our rather tight coupling, being in the same repo solves many of the issues.

  • Separate repo, as today with git clone and bundle

Easiest if we really don't want the libhtp-rs code in the Suricata repo. Keeps the current flexibility of on-the-fly libhtp version selection.

jasonish avatar Apr 30 '24 20:04 jasonish

Information:

ERROR: QA failed on SURI_TLPW2_single_suri_time.

ERROR: QA failed on SURI_TLPW2_single_alerts_cmp.

ERROR: QA failed on SURI_TLPW2_autofp_alerts_cmp.

ERROR: QA failed on SURI_TLPW1_suri_time.

ERROR: QA failed on SURI_TLPW1_files_sha256.

ERROR: QA failed on SURI_TLPR1_alerts_cmp.

field baseline test %
SURI_TLPW2_single_stats_chk
.uptime 772 820 106.22%
SURI_TLPW2_autofp_stats_chk
.flow.end.tcp_state.established 8 9 112.5%
SURI_TLPW1_stats_chk
.uptime 176 183 103.98%
.app_layer.error.http.parser 47 2 4.26%
SURI_TLPR1_stats_chk
.app_layer.error.http.parser 700 369 52.71%

Pipeline 20426

suricata-qa avatar Apr 30 '24 22:04 suricata-qa

TODO: put into suricata repo

catenacyber avatar May 07 '24 13:05 catenacyber

Continued in https://github.com/OISF/suricata/pull/11381

catenacyber avatar Jun 27 '24 20:06 catenacyber