Search code examples
soapesbmulemasking

Masking of fields in Mule


I want to be able to mask a certain field from the current message payload in Mule, when logging it to a file. The field I want to mask is a sensitive value (say account number, or social security number) in a SOAP payload. This is to eliminate security risks. However, I also need to use the value later, after masking it.

My current approach

I am storing the current #[payload] in a session, and then modifying the current payload to replace the sensitive data by * * * *, using an XSLT transformer. Now, I can add the payload to a log, and the sensitive data will not be shown in its entirety. Then when I need the data, I am reading it back from the session.

Something does not feel right about this method. It feels more like a workaround. Is there a better way to do masking in mule?


Solution

  • Writting to a log doesn't sound like something you have to do synchronously.

    Can't you just "async" the xslt transformer and the logger? That would leave the original message untouched outside the async.