update(userspace/engine): fixed lua CMakeLists deps, to let it be gracefully rebuilt when lua files are updated.

Moreover, added back warning about performance impact for rules without event types.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro
2022-01-24 15:02:26 +01:00
committed by poiana
parent 1a485c3447
commit a3976463d5
2 changed files with 4 additions and 2 deletions

View File

@@ -10,7 +10,7 @@
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
file(GLOB_RECURSE lua_module_files ${CMAKE_CURRENT_SOURCE_DIR} *.lua)
file(GLOB_RECURSE lua_files ${CMAKE_CURRENT_SOURCE_DIR} *.lua)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/falco_engine_lua_files.cpp
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/lua-to-cpp.sh ${CMAKE_CURRENT_SOURCE_DIR} ${LYAML_LUA_DIR} ${CMAKE_CURRENT_BINARY_DIR}

View File

@@ -1061,7 +1061,9 @@ function load_rules(rules_content,
num_evttypes = falco_rules.add_filter(rules_mgr, lua_parser, v['rule'], v['source'], v['tags'])
if num_evttypes == 0 or num_evttypes > 100 then
if warn_evttypes == true then
msg = "Rule "..v['rule']..": warning (no-evttype):"
msg = "Rule "..v['rule']..": warning (no-evttype):\n"
msg = msg.." did not contain any evt.type restriction, meaning it will run for all event types.\n"
msg = msg.." This has a significant performance penalty. Consider adding an evt.type restriction if possible.\n"
warnings[#warnings + 1] = msg
end
end