fix: password leaks from rule engine logs
This commit is contained in:
parent
fd551e92d1
commit
e64587f3da
|
@ -14,6 +14,8 @@
|
|||
%% limitations under the License.
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-define(APP, emqx_rule_engine).
|
||||
|
||||
-define(KV_TAB, '@rule_engine_db').
|
||||
|
@ -186,11 +188,11 @@
|
|||
case lists:filter(fun(ResParttern) -> false; (_) -> true end, ResL) of
|
||||
[] -> ResL;
|
||||
ErrL ->
|
||||
?LOG(error, "cluster_call error found, ResL: ~p", [ResL]),
|
||||
?LOG_SENSITIVE(error, "cluster_call error found, ResL: ~p", [ResL]),
|
||||
throw({Func, ErrL})
|
||||
end;
|
||||
{ResL, BadNodes} ->
|
||||
?LOG(error, "cluster_call bad nodes found: ~p, ResL: ~p", [BadNodes, ResL]),
|
||||
?LOG_SENSITIVE(error, "cluster_call bad nodes found: ~p, ResL: ~p", [BadNodes, ResL]),
|
||||
throw({Func, {failed_on_nodes, BadNodes}})
|
||||
end end()).
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
-include("rule_engine.hrl").
|
||||
-include("rule_actions.hrl").
|
||||
-include_lib("emqx/include/emqx.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-define(BAD_TOPIC_WITH_WILDCARD, wildcard_topic_not_allowed_for_publish).
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
-module(emqx_rule_engine).
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-export([ load_providers/0
|
||||
, unload_providers/0
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
-behaviour(gen_server).
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-logger_header("[RuleEngineAPI]").
|
||||
|
||||
|
@ -329,7 +328,7 @@ do_create_rule(Params) ->
|
|||
error -> do_create_rule2(ParsedParams)
|
||||
end;
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
@ -339,7 +338,7 @@ do_create_rule2(ParsedParams) ->
|
|||
{error, {action_not_found, ActionName}} ->
|
||||
return({error, 400, ?ERR_NO_ACTION(ActionName)});
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
@ -352,11 +351,11 @@ delegate_update_rule(#{id := Id0}, Params) ->
|
|||
{error, {not_found, RuleId}} ->
|
||||
return({error, 400, ?ERR_NO_RULE(RuleId)});
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end;
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
@ -409,7 +408,7 @@ delegate_create_resource(#{}, Params) ->
|
|||
fun() -> do_create_resource(create_resource, ParsedParams) end,
|
||||
Params);
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
@ -434,7 +433,7 @@ do_create_resource2(Create, ParsedParams) ->
|
|||
{error, {init_resource, _}} ->
|
||||
return({error, 500, <<"Init resource failure!">>});
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
@ -483,7 +482,7 @@ delegate_start_resource(#{id := Id0}, _Params) ->
|
|||
{error, {resource_not_found, ResId}} ->
|
||||
return({error, 400, ?ERR_NO_RESOURCE(ResId)});
|
||||
{error, Reason} ->
|
||||
?LOG(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
?LOG_SENSITIVE(error, "~p failed: ~0p", [?FUNCTION_NAME, Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
@ -508,7 +507,7 @@ delegate_update_resource(#{id := Id0}, NewParams) ->
|
|||
{error, {dependent_rules_exists, RuleIds}} ->
|
||||
return({error, 400, ?ERR_DEP_RULES_EXISTS(RuleIds)});
|
||||
{error, Reason} ->
|
||||
?LOG(error, "Resource update failed: ~0p", [Reason]),
|
||||
?LOG_SENSITIVE(error, "Resource update failed: ~0p", [Reason]),
|
||||
return({error, 400, ?ERR_BADARGS(Reason)})
|
||||
end.
|
||||
|
||||
|
|
|
@ -16,11 +16,10 @@
|
|||
|
||||
-module(emqx_rule_events).
|
||||
|
||||
-logger_header("[RuleEvents]").
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/emqx.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-logger_header("[RuleEvents]").
|
||||
|
||||
-export([ load/1
|
||||
, unload/0
|
||||
|
|
|
@ -18,9 +18,8 @@
|
|||
|
||||
-behavior(gen_server).
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
-logger_header("[Rule Monitor]").
|
||||
-include("rule_engine.hrl").
|
||||
|
||||
-export([init/1,
|
||||
handle_call/3,
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
|
||||
-behaviour(gen_server).
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-logger_header("[RuleRegistry]").
|
||||
-include("rule_engine.hrl").
|
||||
|
||||
-export([start_link/0]).
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
-include("rule_engine.hrl").
|
||||
-include("rule_actions.hrl").
|
||||
-include_lib("emqx/include/emqx.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-export([ apply_rule/2
|
||||
, apply_rules/2
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
-module(emqx_rule_sqltester).
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-export([ test/1
|
||||
]).
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
-module(emqx_rule_utils).
|
||||
|
||||
-include("rule_engine.hrl").
|
||||
-include_lib("emqx/include/logger.hrl").
|
||||
|
||||
-export([ replace_var/2
|
||||
]).
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.1.11"}}}
|
||||
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "3.0.1"}}}
|
||||
, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.3.6"}}}
|
||||
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.11"}}}
|
||||
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.12"}}}
|
||||
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.2"}}}
|
||||
, {replayq, {git, "https://github.com/emqx/replayq", {tag, "0.3.5"}}}
|
||||
, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}}
|
||||
|
|
Loading…
Reference in New Issue