Project

General

Profile

Actions

Task #2693

open
VJ JI

tracking: libsuricata

Task #2693: tracking: libsuricata

Added by Victor Julien over 7 years ago. Updated 5 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Target version:
Effort:
high
Difficulty:
high
Label:

Description

This request came up at Suricon2018, but has come up before. The idea is to turn much of Suricata into a library that can be reused in other tools.

The first step would be to define some of the use cases we'd like to initially support so that an API could be designed for that.

Goals for 8.0:
- Allow a library user to replicate the Suricata application by exposing all functions needed by the current SuricataMain, or refactoring to allow this.
- Given replication of Suricata, allow the library user to register custom capture modes and output callbacks
- Allow the user to bring their own threads

General library challenges given we've been an application for so long:
- Command line parsing should be opt-in
- Loading the configuration file should be opt-in
- Registering signal handlers should be opt-in, but the functionality they provide should be exposed to the library user can easily call them
- A library should never fatal exit outside of extreme conditions, instead error codes must be ripple back to where the library user can decide what to do
- Global state should be non-existent. One could imagine where a user might want to have a "handle" on multiple discrete Suricata instances.

Future goals:
- Remove global state
- Improve developer experience. I imagine an interface where you bootstrap a Suricata "engine" and feed your own packets into
- Refactor modules to make them more usable outside the scope of Suricata? What modules would make sense here? Capture methods, just to get packets. Flow, to defrag, or TCP re-assembly if you already have your own packets.

Scope:
- Initially, the should be limited to code that Suricata uses itself. That is, Suricata the application is a user of the library. If Suricata the application does not use a module, it should be looked at closely if it belongs in the library, mainly for scope, QA, and support reasons.


Subtasks 8 (5 open3 closed)

Task #4682: tracking: clean up globals and thread localsAssignedJason IshActions
Task #4683: detect: remove sigmatch_table in favor of a dynamic storage optionClosedPhilippe AntoineActions
Task #4684: libsuricata: define global context types for instance and per thread storageNewJason IshActions
Task #8078: threading: don't use thread local for packet poolAssignedOISF DevActions
Task #8106: misc: don't use global for SCInstanceIn ProgressJason IshActions
Task #4698: lib: Example program to bootstrap Suricata (an alternate main() for Suricata)ClosedJason IshActions
Task #6814: libsuricata: opt-in signal handlingClosedJason IshActions
Task #6858: libsuricata: hook for flow expectation creationNewOISF DevActions

Related issues 19 (11 open8 closed)

Related to Suricata - Task #2685: SuriCon 2018 brainstormAssignedVictor JulienActions
Related to Suricata - Task #4097: Suricon 2020 brainstormAssignedVictor JulienActions
Related to Suricata - Task #4221: Build Suricata into a static and shared libraryClosedJason IshActions
Related to Suricata - Task #4429: libsuricata: Use cases with examplesNewJason IshActions
Related to Suricata - Task #4101: tracking: pluginsIn ProgressJason IshActions
Related to Suricata - Task #4704: unix-socket: separate functionality from the unix socket interfaceNewOISF DevActions
Related to Suricata - Task #4742: build: make the auto-generated config.h not conflict with other config.hClosedJason IshActions
Related to Suricata - Task #5433: tracking: reduce number of public data structuresAssignedJason IshActions
Related to Suricata - Task #5488: Suricon 2022 brainstormAssignedVictor JulienActions
Related to Suricata - Task #2313: tracking: save & restore state when suricata restartsNewOISF DevActions
Related to Suricata - Optimization #6754: libsuricata: restructure directory and files to allow for include files to be name spacedNewOISF DevActions
Related to Suricata - Task #6752: libsuricata: don't include autoconf.h from other includesNewOISF DevActions
Related to Suricata - Bug #6838: eve/filetypes: move from plugin api to eve apiClosedJason IshActions
Related to Suricata - Feature #7240: libsuricata: use provided threads and packetsClosedJason IshActions
Related to Suricata - Feature #7319: flow: add user registerable flow initialization callbackClosedJason IshActions
Related to Suricata - Feature #7320: flow: add user registerable flow update callbacksClosedJason IshActions
Related to Suricata - Task #7673: libsuricata: rate_filter callbackClosedJason IshActions
Related to Suricata - Task #8095: libsuricata: expose API for reloading rulesetsAssignedJason IshActions
Related to Suricata - Task #8096: libsuricata: add live example usage of the Suricata libraryClosedJason IshActions

VJ Updated by Victor Julien over 7 years ago Actions #1

  • Related to Task #2685: SuriCon 2018 brainstorm added

AH Updated by Andreas Herz almost 7 years ago Actions #2

  • Assignee set to Community Ticket

VJ Updated by Victor Julien almost 6 years ago Actions #3

  • Assignee changed from Community Ticket to OISF Dev

VJ Updated by Victor Julien almost 6 years ago Actions #4

  • Description updated (diff)

VJ Updated by Victor Julien almost 6 years ago Actions #5

One of the use cases that has been brought forward is to be able to integrate the Suricata detection and logging into OVS.

VJ Updated by Victor Julien over 5 years ago Actions #6

  • Related to Task #4097: Suricon 2020 brainstorm added

VJ Updated by Victor Julien over 5 years ago Actions #7

  • Tracker changed from Feature to Task
  • Subject changed from libsuricata to tracking: libsuricata
  • Status changed from New to Assigned
  • Assignee changed from OISF Dev to Jason Ish
  • Target version changed from TBD to 7.0.0-beta1

JI Updated by Jason Ish over 5 years ago Actions #8

  • Related to Task #4221: Build Suricata into a static and shared library added

JI Updated by Jason Ish almost 5 years ago Actions #9

  • Related to Task #4429: libsuricata: Use cases with examples added

JI Updated by Jason Ish over 4 years ago Actions #10

JI Updated by Jason Ish over 4 years ago Actions #11

  • Related to Task #4704: unix-socket: separate functionality from the unix socket interface added

JI Updated by Jason Ish over 4 years ago Actions #12

  • Related to Task #4742: build: make the auto-generated config.h not conflict with other config.h added

JI Updated by Jason Ish over 4 years ago Actions #13

  • Status changed from Assigned to In Progress

VJ Updated by Victor Julien almost 4 years ago Actions #14

  • Related to Task #5433: tracking: reduce number of public data structures added

VJ Updated by Victor Julien over 3 years ago Actions #15

  • Target version changed from 7.0.0-beta1 to 8.0.0-beta1

PA Updated by Philippe Antoine over 3 years ago Actions #16

Use cases :
- Have packets from some other source
- Have some already reassembled stream (SSL proxy)
- Have a very dynamic way to tell which packet which should be handled by this config/ruleset (complexity from global variables), have some way for tenants to remove certain categories, or have a finite set of precompiled rulesets and have a plugin be able to tell which ruleset should be used for each packet
- Have packet returned with metadata like the alerts it has

Idea to persist precompiled ruleset

PA Updated by Philippe Antoine over 3 years ago Actions #17

  • Related to Task #5488: Suricon 2022 brainstorm added

PA Updated by Philippe Antoine over 3 years ago Actions #18

  • Related to Task #2313: tracking: save & restore state when suricata restarts added

JI Updated by Jason Ish about 2 years ago Actions #19

  • Subtask #6752 added

JI Updated by Jason Ish about 2 years ago Actions #20

  • Related to Optimization #6754: libsuricata: restructure directory and files to allow for include files to be name spaced added

JI Updated by Jason Ish about 2 years ago Actions #21

  • Subtask deleted (#6752)

JI Updated by Jason Ish about 2 years ago Actions #22

  • Related to Task #6752: libsuricata: don't include autoconf.h from other includes added

JI Updated by Jason Ish about 2 years ago Actions #23

  • Description updated (diff)

JI Updated by Jason Ish about 2 years ago Actions #24

  • Subtask #6814 added

JI Updated by Jason Ish about 2 years ago Actions #25

  • Related to Bug #6838: eve/filetypes: move from plugin api to eve api added

VJ Updated by Victor Julien about 2 years ago Actions #26

  • Subtask #6858 added

JI Updated by Jason Ish over 1 year ago Actions #27

  • Related to Feature #7240: libsuricata: use provided threads and packets added

JI Updated by Jason Ish over 1 year ago Actions #28

  • Related to Feature #7319: flow: add user registerable flow initialization callback added

JI Updated by Jason Ish over 1 year ago Actions #29

  • Related to Feature #7320: flow: add user registerable flow update callbacks added

VJ Updated by Victor Julien about 1 year ago Actions #30

  • Target version changed from 8.0.0-beta1 to 8.0.0-rc1

JI Updated by Jason Ish 12 months ago Actions #31

  • Related to Task #7673: libsuricata: rate_filter callback added

VJ Updated by Victor Julien 10 months ago Actions #32

  • Target version changed from 8.0.0-rc1 to 8.0.0

VJ Updated by Victor Julien 9 months ago Actions #33

  • Target version changed from 8.0.0 to 9.0.0-beta1

Work will continue towards 9.0.0

JI Updated by Jason Ish 5 months ago Actions #34

  • Related to Task #8095: libsuricata: expose API for reloading rulesets added

JI Updated by Jason Ish 5 months ago Actions #35

  • Related to Task #8096: libsuricata: add live example usage of the Suricata library added
Actions

Also available in: PDF Atom