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

update(userspace/engine): cleanup unused alternate-lua-dir option and remove config_falco_engine.h.in, now unused since lua scripts are embedded in Falco. #1872

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions userspace/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,3 @@ else()
endif()

target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${LPEG_LIB}" "${LYAML_LIB}" "${LIBYAML_LIB}" luafiles)

configure_file(config_falco_engine.h.in config_falco_engine.h)

20 changes: 0 additions & 20 deletions userspace/engine/config_falco_engine.h.in

This file was deleted.

1 change: 0 additions & 1 deletion userspace/engine/falco_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.

#include <fstream>

#include "config_falco_engine.h"
#include "falco_common.h"
#include "banned.h" // This raises a compilation error when certain functions are used
#include "falco_engine_lua_files.hh"
Expand Down
3 changes: 1 addition & 2 deletions userspace/engine/falco_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ limitations under the License.
#include "falco_engine.h"
#include "falco_utils.h"
#include "falco_engine_version.h"
#include "config_falco_engine.h"

#include "formats.h"

Expand All @@ -44,7 +43,7 @@ const std::string falco_engine::s_default_ruleset = "falco-default-ruleset";

using namespace std;

falco_engine::falco_engine(bool seed_rng, const std::string& alternate_lua_dir)
falco_engine::falco_engine(bool seed_rng)
: m_next_ruleset_id(0),
m_min_priority(falco_common::PRIORITY_DEBUG),
m_sampling_ratio(1), m_sampling_multiplier(0),
Expand Down
3 changes: 1 addition & 2 deletions userspace/engine/falco_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ limitations under the License.
#include "rules.h"
#include "ruleset.h"

#include "config_falco_engine.h"
#include "falco_common.h"

//
Expand All @@ -44,7 +43,7 @@ limitations under the License.
class falco_engine : public falco_common
{
public:
falco_engine(bool seed_rng=true, const std::string& alternate_lua_dir=FALCO_ENGINE_SOURCE_LUA_DIR);
falco_engine(bool seed_rng=true);
virtual ~falco_engine();

// A given engine has a version which identifies the fields
Expand Down
17 changes: 2 additions & 15 deletions userspace/falco/falco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ static void usage()
" -h, --help Print this page\n"
" -c Configuration file (default " FALCO_SOURCE_CONF_FILE ", " FALCO_INSTALL_CONF_FILE ")\n"
" -A Monitor all events, including those with EF_DROP_SIMPLE_CONS flag.\n"
" --alternate-lua-dir <path> Specify an alternate path for loading Falco lua files\n"
" -b, --print-base64 Print data buffers in base64.\n"
" This is useful for encoding binary data that needs to be used over media designed to.\n"
" --cri <path> Path to CRI socket for container metadata.\n"
Expand Down Expand Up @@ -563,7 +562,6 @@ int falco_init(int argc, char **argv)

static struct option long_options[] =
{
{"alternate-lua-dir", required_argument, 0},
{"cri", required_argument, 0},
{"daemon", no_argument, 0, 'd'},
{"disable-cri-async", no_argument, 0, 0},
Expand Down Expand Up @@ -596,8 +594,7 @@ int falco_init(int argc, char **argv)
{
set<string> disabled_rule_substrings;
string substring;
string all_rules = "";
string alternate_lua_dir = FALCO_ENGINE_SOURCE_LUA_DIR;
string all_rules;
set<string> disabled_rule_tags;
set<string> enabled_rule_tags;

Expand Down Expand Up @@ -790,16 +787,6 @@ int falco_init(int argc, char **argv)
disable_sources.insert(optarg);
}
}
else if (string(long_options[long_index].name)== "alternate-lua-dir")
{
if(optarg != NULL)
{
alternate_lua_dir = optarg;
if (alternate_lua_dir.back() != '/') {
alternate_lua_dir += '/';
}
}
}
break;

default:
Expand Down Expand Up @@ -835,7 +822,7 @@ int falco_init(int argc, char **argv)
return EXIT_SUCCESS;
}

engine = new falco_engine(true, alternate_lua_dir);
engine = new falco_engine(true);
engine->set_extra(output_format, replace_container_info);

// Create "factories" that can create filters/formatters for
Expand Down