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

Applayer plugin 5053 v7 #12448

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

catenacyber
Copy link
Contributor

@catenacyber catenacyber commented Jan 22, 2025

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/4102 with all 6 subtickets

Describe changes:

  • add app-layer plugin example with template protocol
  • document app-layer plugins

@jufajardini what do you think about the doc ?

@jasonish as you created the tickets, is this what you expected ?

Follows #12441

Draft: Commit POC: suricata-plugin crate is a POC to discuss

I think we want

  • pure rust app-layer plugins, that look like one app-layer code in Suricata
  • plugins can import somehow from Suricata :
    • type definitions like AppProto,
    • constants like ALPROTO_UNKNOWN,
    • enum like AppLayerEventType::APP_LAYER_EVENT_TYPE_TRANSACTION
    • Struct definitions like SCAppLayerPlugin
    • Opaque definitions like Flow (for better code readability of callbacks)
    • Suricata C functions to use like `AppLayerRegisterProtocolDetection

Alternatives are

  • plugin redefines all these in some suricata.rs file : works but not nice
  • plugin has a dependency on Suricata crate : not sure it works, but not nice as well as it makes the plugin compile the 200 dependencies of Suricata
  • plugin has a dependency on a light (0 dependency) Suricata plugin crate, whose code gets somehow generated from Suricata rust code

@jasonish

  • Is the problem well established this way ?
  • Do you see other alternatives ?
  • Is the last alternative looking the best to you as well ? (suricata plugin crate with code that gets generated from Suricata rust code)

and use generic logger callback prototype with later cast
Ticket: 7151
Ticket: 7152
Ticket: 7154
Ticket: 7149
Ticket: 7150
Ticket: 7153
@catenacyber
Copy link
Contributor Author

Maybe I should emphasize that plugin code and Suricata code must be well separated and only communicate through the lingua-franca C API

@catenacyber
Copy link
Contributor Author

Talking with Jason, he thinks the second alternative is better...

I will give it a shot, limiting my time on it...

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

Successfully merging this pull request may close these issues.

1 participant