diff --git a/userspace/falco/app_actions/print_version.cpp b/userspace/falco/app_actions/print_version.cpp index 4db1f81e856..5ada34a6c9f 100644 --- a/userspace/falco/app_actions/print_version.cpp +++ b/userspace/falco/app_actions/print_version.cpp @@ -23,8 +23,25 @@ application::run_result application::print_version() { if(m_options.print_version_info) { + auto s = new sinsp(); printf("Falco version: %s\n", FALCO_VERSION); - printf("Driver version: %s\n", DRIVER_VERSION); + printf("Libs version: %s\n", FALCOSECURITY_LIBS_VERSION); + printf("Plugin API: %s\n", s->get_plugin_api_version()); + + // todo(leogr): move string conversion to scap + auto driver_api_version = s->get_scap_api_version(); + unsigned long driver_api_major = PPM_API_VERSION_MAJOR(driver_api_version); + unsigned long driver_api_minor = PPM_API_VERSION_MINOR(driver_api_version); + unsigned long driver_api_patch = PPM_API_VERSION_PATCH(driver_api_version); + auto driver_schema_version = s->get_scap_api_version(); + unsigned long driver_schema_major = PPM_API_VERSION_MAJOR(driver_schema_version); + unsigned long driver_schema_minor = PPM_API_VERSION_MINOR(driver_schema_version); + unsigned long driver_schema_patch = PPM_API_VERSION_PATCH(driver_schema_version); + printf("Driver:\n"); + printf(" API version: %ld.%ld.%ld\n", driver_api_major, driver_api_minor, driver_api_patch); + printf(" Schema version: %ld.%ld.%ld\n", driver_schema_major, driver_schema_minor, driver_schema_patch); + printf(" Default driver: %s\n", DRIVER_VERSION); + return run_result::exit(); } return run_result::ok(); diff --git a/userspace/falco/config_falco.h.in b/userspace/falco/config_falco.h.in index 2d58f7523c1..4b319c24a2b 100644 --- a/userspace/falco/config_falco.h.in +++ b/userspace/falco/config_falco.h.in @@ -30,5 +30,7 @@ limitations under the License. #define FALCO_INSTALL_CONF_FILE "/etc/falco/falco.yaml" #define FALCO_ENGINE_PLUGINS_DIR "${FALCO_ABSOLUTE_SHARE_DIR}/plugins/" +#define FALCOSECURITY_LIBS_VERSION "${FALCOSECURITY_LIBS_VERSION}" + #define DRIVER_NAME "@DRIVER_NAME@" #define DRIVER_VERSION "@DRIVER_VERSION@" \ No newline at end of file