Merge pull request #12596 from thalesmg/fix-header-logging-r55-20240226

fix: redact all headers from logs
This commit is contained in:
Thales Macedo Garitezi 2024-02-27 11:19:51 -03:00 committed by GitHub
commit 8a204f2ac1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -88,7 +88,7 @@ t_http_api(_) ->
<<"method">> := <<"put">>,
<<"body">> := #{<<"mqtt">> := #{<<"max_qos_allowed">> := 1}},
<<"bindings">> := _,
<<"headers">> := #{<<"authorization">> := <<"******">>}
<<"headers">> := "******"
},
<<"http_status_code">> := 200,
<<"operation_result">> := <<"success">>,

View File

@ -2,7 +2,7 @@
{application, emqx_utils, [
{description, "Miscellaneous utilities for EMQX apps"},
% strict semver, bump manually!
{vsn, "5.0.15"},
{vsn, "5.0.16"},
{modules, [
emqx_utils,
emqx_utils_api,

View File

@ -717,6 +717,9 @@ is_sensitive_key(<<"jwt">>) -> true;
is_sensitive_key(authorization) -> true;
is_sensitive_key("authorization") -> true;
is_sensitive_key(<<"authorization">>) -> true;
is_sensitive_key(headers) -> true;
is_sensitive_key("headers") -> true;
is_sensitive_key(<<"headers">>) -> true;
is_sensitive_key(bind_password) -> true;
is_sensitive_key("bind_password") -> true;
is_sensitive_key(<<"bind_password">>) -> true;
@ -879,6 +882,7 @@ redact_test_() ->
secret_key,
secret_access_key,
security_token,
headers,
token,
bind_password
],