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

mqtt: enable limiting of logged message length - v2 #11054

Closed
wants to merge 4 commits into from

Conversation

satta
Copy link
Contributor

@satta satta commented May 12, 2024

Previous PR: #11053

Changes to previous PR:

  • Add new suricata.yaml options to EVE Output documentation page.
  • Update example outputs section in documentation.

Ticket

Redmine ticket: https://redmine.openinfosecfoundation.org/issues/6984

SV_BRANCH=OISF/suricata-verify#1826

Copy link

codecov bot commented May 12, 2024

Codecov Report

Attention: Patch coverage is 81.94444% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 83.65%. Comparing base (abb7424) to head (aa47dca).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11054      +/-   ##
==========================================
+ Coverage   80.63%   83.65%   +3.01%     
==========================================
  Files         922      922              
  Lines      250137   250338     +201     
==========================================
+ Hits       201699   209417    +7718     
+ Misses      48438    40921    -7517     
Flag Coverage Δ
fuzzcorpus 64.33% <33.33%> (+0.06%) ⬆️
livemode 18.42% <13.33%> (-0.14%) ⬇️
suricata-verify 62.75% <56.66%> (?)
unittests 62.26% <62.50%> (-0.01%) ⬇️

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

@catenacyber
Copy link
Contributor

Are there other MQTT fields that should go into this limitation ? Like topics...

Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Thanks for the work :-)

I guess the first thing to do is to determine the scope : are there other fields than msg that can be logged unbounded ?
But there is already a limit on the parsed PDU size, which in turn limits the log length, right ?

@@ -112,6 +115,15 @@ static void JsonMQTTLogParseConfig(ConfNode *conf, LogMQTTFileCtx *mqttlog_ctx)
} else {
mqttlog_ctx->flags |= MQTT_LOG_PASSWORDS;
}
uint32_t max_msg_log_len = 0;
query = ConfNodeLookupChildValue(conf, "msg-log-limit");
Copy link
Contributor

Choose a reason for hiding this comment

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

@jasonish what do you think about doing this in rust ? and setting a global variable with this field

Copy link
Member

Choose a reason for hiding this comment

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

Probably only worth it if the whole Config function can be moved to Rust.

Copy link
Contributor

Choose a reason for hiding this comment

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

the whole Config function can be moved to Rust.

Yes, we can, but the way I see it means using a global variable, so unsafe static mut...

@jufajardini
Copy link
Contributor

  • Doc update : @jufajardini what do you think about the commit doc: update example outputs section ? How should we make sure we do not lag behind again, as I did not add websocket-payload for instance

For our devguide, we use the literalinclude sphinx directive, which allows one to quote from an existing file, passing some parameters to define what should be included. (cf https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-literalinclude). Example: https://docs.suricata.io/en/latest/devguide/extending/app-layer/app-layer-frames.html#id2

I wonder if something like that could be used with our suricata.yaml file, and then we'd reference that, instead of the partials file.

satta added 4 commits May 19, 2024 16:02
This commit adds config items for features that have
been introduced in the meantime but not added to the
example configuration in the documentation.
@satta satta closed this May 27, 2024
@satta
Copy link
Contributor Author

satta commented May 27, 2024

Never mind the push, will send new MR soon

@satta
Copy link
Contributor Author

satta commented May 31, 2024

Next PR: #11194

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