Hi all,

I am working on implementing the $subject.

*Requirement*.

The initial requirement was to add masking capability as an improvement for
the log mediator so that the users can configure the masking parameters
(for EI and APIM). But due to the fact that this can be applied globally
(wire logs, debug logs etc), it was decided to implement this as new log
appenders, which can be used by any product.

*Configuration*

For this feature, the following configuration should be done.
1. Log appender should be added to log4j.properties
2. A new properties file which contains the masking parameters (regex)
should be configured.

Example:
log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.MaskedCarbonConsoleAppender
log4j.appender.CARBON_CONSOLE.maskingPatternFile=[carbon_home]/repository/conf/wso2-log-masking.properties
.
.
.

log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.MaskedCarbonDailyRollingFileAppender
log4j.appender.CARBON_LOGFILE.maskingPatternFile=[carbon_home]/repository/conf/wso2-log-masking.properties


*wso2-log-masking.properties file configs:*
wso2.masking.pattern.AccountNo=/^(?:[0-9]{11}|[0-9]{2}-[0-9]{3}-[0-9]{6})$/
wso2.masking.pattern.CardNumber=^5[1-5][0-9]{0,14}|
^(222[1-9]|2[3-6]\\d{2}|27[0-1]\\d|2720)[0-9]{0,12}
.
.
.

The maskingPatternFile can be configured as required. If not, as the
default wso2-log-masking.properties file will be used. (which will be an
added file.)

Any ideas comments are highly appreciated.

Thanks and Regards,
Menaka
-- 

*Menaka Jayawardena*
Senior Software Engineer
WSO2 Inc.

Phone    : +94 71 350 5470
LinkedIn : https://lk.linkedin.com/in/menakajayawardena
Blog       : https://menakamadushanka.wordpress.com/
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to