diff --git a/apps/emqx_bridge_http/src/emqx_bridge_http_connector.erl b/apps/emqx_bridge_http/src/emqx_bridge_http_connector.erl index 56f47e684..ae1e727ca 100644 --- a/apps/emqx_bridge_http/src/emqx_bridge_http_connector.erl +++ b/apps/emqx_bridge_http/src/emqx_bridge_http_connector.erl @@ -869,9 +869,9 @@ redact(Data) -> %% and we also can't know the body format and where the sensitive data will be %% so the easy way to keep data security is redacted the whole body redact_request({Path, Headers}) -> - {Path, redact(Headers)}; + {Path, emqx_utils_redact:redact_headers(Headers)}; redact_request({Path, Headers, _Body}) -> - {Path, redact(Headers), <<"******">>}. + {Path, emqx_utils_redact:redact_headers(Headers), <<"******">>}. clientid(Msg) -> maps:get(clientid, Msg, undefined). diff --git a/apps/emqx_utils/src/emqx_utils_redact.erl b/apps/emqx_utils/src/emqx_utils_redact.erl index 698d631e9..4d3cc7f7b 100644 --- a/apps/emqx_utils/src/emqx_utils_redact.erl +++ b/apps/emqx_utils/src/emqx_utils_redact.erl @@ -16,7 +16,7 @@ -module(emqx_utils_redact). --export([redact/1, redact/2, is_redacted/2, is_redacted/3]). +-export([redact/1, redact/2, redact_headers/1, is_redacted/2, is_redacted/3]). -export([deobfuscate/2]). -define(REDACT_VAL, "******"). @@ -62,6 +62,9 @@ redact(Term, Checker) -> is_sensitive_key(V) orelse Checker(V) end). +redact_headers(Term) -> + do_redact_headers(Term). + do_redact(L, Checker) when is_list(L) -> lists:map(fun(E) -> do_redact(E, Checker) end, L); do_redact(M, Checker) when is_map(M) -> @@ -128,7 +131,7 @@ do_redact_headers(Value) -> Value. check_is_sensitive_header(Key) -> - Key1 = emqx_utils_conv:str(Key), + Key1 = string:trim(emqx_utils_conv:str(Key)), is_sensitive_header(string:lowercase(Key1)). is_sensitive_header("authorization") -> diff --git a/changes/e5.5.1.en.md b/changes/e5.5.1.en.md new file mode 100644 index 000000000..a0772bbf1 --- /dev/null +++ b/changes/e5.5.1.en.md @@ -0,0 +1,29 @@ +# 5.5.1 + +## Enhancements + +- [#12497](https://github.com/emqx/emqx/pull/12497) Improved MongoDB connector performance, resulting in more efficient database interactions. This enhancement is supported by improvements in the MongoDB Erlang driver as well ([mongodb-erlang PR](https://github.com/emqx/mongodb-erlang/pull/41)). + +## Bug Fixes + +- [#12471](https://github.com/emqx/emqx/pull/12471) Fixed an issue that data integration configurations failed to load correctly during upgrades from EMQX version 5.0.2 to newer releases. + +- [#12542](https://github.com/emqx/emqx/pull/12542) Redacted authorization headers to exclude basic authorization credentials from debug logs in the HTTP Server connector, mitigating potential security risks. + +- [#12598](https://github.com/emqx/emqx/pull/12598) Fixed an issue that users were unable to subscribe to or unsubscribe from shared topic filters via HTTP API. + + The affected APIs include: + + - `/clients/:clientid/subscribe` + - `/clients/:clientid/subscribe/bulk` + + - `/clients/:clientid/unsubscribe` + - `/clients/:clientid/unsubscribe/bulk` + +- [#12601](https://github.com/emqx/emqx/pull/12601) Fixed an issue where logs of the LDAP driver were not being captured. Now, all logs are recorded at the `info` level. + +- [#12606](https://github.com/emqx/emqx/pull/12606) The Prometheus API experienced crashes when the specified SSL certificate file did not exist in the given path. Now, when an SSL certificate file is missing, the `emqx_cert_expiry_at` metric will report a value of 0, indicating the non-existence of the certificate. + +- [#12608](https://github.com/emqx/emqx/pull/12608) Fixed a `function_clause` error in the IoTDB action caused by the absence of a `payload` field in query data. + +- [#12610](https://github.com/emqx/emqx/pull/12610) Fixed an issue where connections to the LDAP connector could unexpectedly disconnect after a certain period of time. diff --git a/changes/v5.5.1.en.md b/changes/v5.5.1.en.md new file mode 100644 index 000000000..8b5c0716d --- /dev/null +++ b/changes/v5.5.1.en.md @@ -0,0 +1,21 @@ +# 5.5.1 + +## Bug Fixes + +- [#12471](https://github.com/emqx/emqx/pull/12471) Fixed an issue that data integration configurations failed to load correctly during upgrades from EMQX version 5.0.2 to newer releases. + +- [#12542](https://github.com/emqx/emqx/pull/12542) Redacted authorization headers to exclude basic authorization credentials from debug logs in the HTTP Server connector, mitigating potential security risks. + +- [#12598](https://github.com/emqx/emqx/pull/12598) Fixed an issue that users were unable to subscribe to or unsubscribe from shared topic filters via HTTP API. + + The affected APIs include: + + - `/clients/:clientid/subscribe` + - `/clients/:clientid/subscribe/bulk` + + - `/clients/:clientid/unsubscribe` + - `/clients/:clientid/unsubscribe/bulk` + +- [#12601](https://github.com/emqx/emqx/pull/12601) Fixed an issue where logs of the LDAP driver were not being captured. Now, all logs are recorded at the `info` level. + +- [#12606](https://github.com/emqx/emqx/pull/12606) The Prometheus API experienced crashes when the specified SSL certificate file did not exist in the given path. Now, when an SSL certificate file is missing, the `emqx_cert_expiry_at` metric will report a value of 0, indicating the non-existence of the certificate.