diff --git a/test/falco_tests.yaml b/test/falco_tests.yaml index c4b37100..f8ca4796 100644 --- a/test/falco_tests.yaml +++ b/test/falco_tests.yaml @@ -356,8 +356,6 @@ trace_files: !mux condition: evt.type=fork priority: INFO --- - 1 warnings: - Rule no output rule: consider adding an exceptions property to define supported exceptions fields validate_rules_file: - rules/invalid_rule_without_output.yaml trace_file: trace_files/cat_write.scap @@ -413,8 +411,6 @@ trace_files: !mux condition: evt.type=open append: true --- - 1 warnings: - Rule my_rule: consider adding an exceptions property to define supported exceptions fields validate_rules_file: - rules/rule_append_failure.yaml trace_file: trace_files/cat_write.scap @@ -542,9 +538,6 @@ trace_files: !mux priority: INFO append: false --- - 2 warnings: - Rule some rule: consider adding an exceptions property to define supported exceptions fields - Rule some rule: consider adding an exceptions property to define supported exceptions fields validate_rules_file: - rules/invalid_overwrite_rule_multiple_docs.yaml trace_file: trace_files/cat_write.scap @@ -567,9 +560,6 @@ trace_files: !mux priority: INFO append: true --- - 2 warnings: - Rule some rule: consider adding an exceptions property to define supported exceptions fields - Rule some rule: consider adding an exceptions property to define supported exceptions fields validate_rules_file: - rules/invalid_append_rule_multiple_docs.yaml trace_file: trace_files/cat_write.scap @@ -627,8 +617,6 @@ trace_files: !mux output: "An open was seen %not_a_real_field" priority: WARNING --- - 1 warnings: - Rule rule_with_invalid_output: consider adding an exceptions property to define supported exceptions fields validate_rules_file: - rules/invalid_rule_output.yaml trace_file: trace_files/cat_write.scap diff --git a/test/falco_tests_exceptions.yaml b/test/falco_tests_exceptions.yaml index 02844c55..5b7d45cb 100644 --- a/test/falco_tests_exceptions.yaml +++ b/test/falco_tests_exceptions.yaml @@ -185,15 +185,6 @@ trace_files: !mux - rules/exceptions/append_item_not_in_rule.yaml trace_file: trace_files/cat_write.scap - rule_without_exception: - exit_status: 0 - stderr_contains: |+ - 1 warnings: - Rule My Rule: consider adding an exceptions property to define supported exceptions fields - validate_rules_file: - - rules/exceptions/rule_without_exception.yaml - trace_file: trace_files/cat_write.scap - rule_exception_no_values: detect: True detect_level: WARNING diff --git a/test/rules/exceptions/rule_without_exception.yaml b/test/rules/exceptions/rule_without_exception.yaml deleted file mode 100644 index a885bed9..00000000 --- a/test/rules/exceptions/rule_without_exception.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (C) 2020 The Falco Authors. -# -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "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. -# -- rule: My Rule - desc: Some desc - condition: evt.type=open and proc.name=cat - output: Some output - priority: error diff --git a/userspace/engine/lua/rule_loader.lua b/userspace/engine/lua/rule_loader.lua index d232457f..bf6c669a 100644 --- a/userspace/engine/lua/rule_loader.lua +++ b/userspace/engine/lua/rule_loader.lua @@ -522,10 +522,8 @@ function load_rules_doc(rules_mgr, doc, load_state) v['source'] = "syscall" end - -- Add an empty exceptions property to the rule if not - -- defined, but add a warning about defining one + -- Add an empty exceptions property to the rule if not defined if v['exceptions'] == nil then - warnings[#warnings + 1] = "Rule "..v['rule']..": consider adding an exceptions property to define supported exceptions fields" v['exceptions'] = {} end