-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not log sensitive data #2083
Conversation
Identity
content in logs
Identity
content in logs
Hi @kziemianek , do you think it's better to design a local wrapper of crate |
Good idea, i can wrap it with another macro. |
@@ -20,8 +20,8 @@ use crate::sgx_reexport_prelude::*; | |||
|
|||
use crate::{DetermineWatch, RpcConnectionRegistry, RpcHash}; | |||
use itc_tls_websocket_server::{error::WebSocketResult, ConnectionToken, WebSocketMessageHandler}; | |||
use itp_utils::debug as lit_debug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just use debug
, without prefix lit_
? Will it introduce any conflict?
If no conflict, I would suggest only debug
is sufficient.
so we will only change:
use log::*
to use itp_utils::*
We may need to take care of sgx
vs std
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can but I prefer different names from log
crate macros.
What do you think about renaming our macros, example debug
-> lit_debug
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer renaming the macros to lit_
prefixed, to clearly differ from the known log macros.
And it seems we are using alias anyway in most of the cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kziemianek let's renaming our macros directly to lit_***
. And then merge this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove them as they seems to be redundant since we locked log level for production build at INFO
.
I set enclave logger's base filter level to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side, thanks :)
|
||
#[derive(Eq, PartialEq, Clone, MaxEncodedLen, Default)] | ||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] | ||
pub struct IdentityString { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand it correctly that we need such a flattened struct because of prod/non-prod Debug
implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the actual reason is just to not introduce any breaking changes and to not pollute api contract with this implementation detail.
This struct will be serialized/deserialized the same as it was before so for the consumers there would be no change.
@@ -20,8 +20,8 @@ use crate::sgx_reexport_prelude::*; | |||
|
|||
use crate::{DetermineWatch, RpcConnectionRegistry, RpcHash}; | |||
use itc_tls_websocket_server::{error::WebSocketResult, ConnectionToken, WebSocketMessageHandler}; | |||
use itp_utils::debug as lit_debug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer renaming the macros to lit_
prefixed, to clearly differ from the known log macros.
And it seems we are using alias anyway in most of the cases
@BillyWooo , @Kailai-Wang I've removed |
Good idea. Mindset was trapped in before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM
No sensitive data should be present in logs for production mode workers.
Identity
content from the logs forproduction
buildproduction
build anymore as third party libraries might log sensitive data on various levelsproduction
buildExample of hidding
Identity
contentsNon Production
Production
relates: #2040
fixes: #1514