Merge pull request #10511 from lafirest/fix/resource_safe_log

fix(resource): make some logging of the resource manager more secure
This commit is contained in:
lafirest 2023-05-19 20:42:21 +08:00 committed by GitHub
commit 264404e180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -387,7 +387,7 @@ handle_event(EventType, EventData, State, Data) ->
event_type => EventType,
event_data => EventData,
state => State,
data => Data
data => emqx_utils:redact(Data)
}
),
keep_state_and_data.
@ -397,15 +397,15 @@ log_state_consistency(State, #data{status = State} = Data) ->
log_state_consistency(State, Data) ->
?tp(warning, "inconsistent_state", #{
state => State,
data => Data
data => emqx_utils:redact(Data)
}).
log_cache_consistency(Data, Data) ->
ok;
log_cache_consistency(DataCached, Data) ->
?tp(warning, "inconsistent_cache", #{
cache => DataCached,
data => Data
cache => emqx_utils:redact(DataCached),
data => emqx_utils:redact(Data)
}).
%%------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
Improve the security and privacy of some resource logs by masking sensitive information in the data.