sysflow-telemetry / sysflow

SysFlow documentation and issues tracker
Other
45 stars 10 forks source link

libsysflow #91

Closed araujof closed 2 years ago

araujof commented 2 years ago

Indicate project Collector

Is your feature request related to a problem? Please describe. Implement libsysflow, a library for creating SysFlow consumers. This library will define a concise API and export first-class SysFlow data types for consumers to transparently process SysFlow records and manage access to the underlying Falco libs and driver.

Describe the feature you'd like libsysflow will be packaged and distributed by a CI workflow in sf-collector.

// consumer-defined callback function
void process_sysflow(sysflow::SFHeader* header, sysflow::Container* cont, sysflow::Process* proc, sysflow::File* f1, sysflow::File* f2, sysflow::SysFlow* rec) {
    // your switch block here
}

// example consumer
int main(int argc, char **argv) {
    SysFlowConfig* config = sysflowlibscpp::InitializeSysFlowConfig();
    config->callback = process_sysflow;
    sysflowlibscpp::SysFlowDriver *driver = new sysflowlibscpp::SysFlowDriver(config);
    driver->run();
}

Additionally, libsysflow will perform the checks to verify that the Falco probe is loaded, and output an exception otherwise. Consumers will load the Falco libs driver prior to running their main entrypoint, following the typical entrypoint recipe/script used by Falco and SysFlow.

Additional context libsysflow branch: https://github.com/sysflow-telemetry/sf-collector/tree/libsysflow

araujof commented 2 years ago

Merged into dev branch. Preparing release candidate. https://github.com/sysflow-telemetry/sf-collector/pull/44