Skip to content

output/http: log invalid status as a string#12128

Closed
catenacyber wants to merge 1 commit intoOISF:masterfrom
catenacyber:http-status-log-7311-v1
Closed

output/http: log invalid status as a string#12128
catenacyber wants to merge 1 commit intoOISF:masterfrom
catenacyber:http-status-log-7311-v1

Conversation

@catenacyber
Copy link
Contributor

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

Describe changes:

  • output/http: log invalid status as a string

Also fix integer warning on the way

SV_BRANCH=OISF/suricata-verify#2085

From #11904 in its own PR

Ticket: 7311

If response_status_number is not a valid poisitive integer,
we should not try to parse it again, and fail again,
but just log the raw string.
@catenacyber catenacyber requested review from a team and victorjulien as code owners November 18, 2024 13:57
@codecov
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.11%. Comparing base (5d766df) to head (391fe9f).
Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #12128       +/-   ##
===========================================
+ Coverage   62.68%   83.11%   +20.43%     
===========================================
  Files         840      909       +69     
  Lines      153669   257879   +104210     
===========================================
+ Hits        96323   214343   +118020     
+ Misses      57346    43536    -13810     
Flag Coverage Δ
fuzzcorpus 60.93% <100.00%> (?)
livemode 19.43% <0.00%> (?)
pcap 44.39% <100.00%> (?)
suricata-verify 62.70% <100.00%> (+0.02%) ⬆️
unittests 59.27% <0.00%> (?)

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 23422

"status": {
"type": "integer"
},
"status_str": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have no occurrences of _str, but do have one as _string, so maybe we should stick with that.

Also, please add a description. I wonder if that description should also include the rule keyword for matching? Or if not applicable, even state that somehow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess a http.stat_code.raw? or http.stat.raw

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I will go with status_string instead of opening a new json object

@catenacyber
Copy link
Contributor Author

Next in #12164

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.

4 participants