You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by adondoni <an...@gmail.com> on 2017/02/22 22:24:06 UTC
Mask password using log component
Hello,
I've implemented a route that receive JSON-RPC request from cxfrs.
Before processing message, trace body request as:
<log message="request body: ${body}" />
My problem is that request could be contains password value.
Question is how can I mask password value when log body message.
Thank in advance
--
View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mask password using log component
Posted by souciance <so...@gmail.com>.
I think you can write the invokation something like this:
${bean:orderService?method=getOrderType}
where orderService is the name of your bean and the method name is the
method of your masking.
so perhaps something like .log("${bean:orderService?method=getOrderType}")
On Thu, Feb 23, 2017 at 10:28 AM, adondoni [via Camel] <
ml-node+s465427n5794331h24@n5.nabble.com> wrote:
> Could you give me an example how can invoke a bean inside a log component?
>
> Thank Claus.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Mask-password-using-log-
> component-tp5794301p5794331.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794333.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mask password using log component
Posted by adondoni <an...@gmail.com>.
Could you give me an example how can invoke a bean inside a log component?
Thank Claus.
--
View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794331.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mask password using log component
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
I logged a ticket to see if we in the future can get such
functionality out of the box
https://issues.apache.org/jira/browse/CAMEL-10885
On Thu, Feb 23, 2017 at 10:12 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Thu, Feb 23, 2017 at 10:05 AM, adondoni <an...@gmail.com> wrote:
>> Hi,
>> I've already thinks this solution.
>> But if mask a password into a bean before log, I modify a message that
>> continue in a route a lost password value.
>>
>
> You dont call the bean before, but call the bean from within the <log>
> so it does NOT change your message.
>
>
>> My blueprint xml is:
>>
>> ...
>> <log message="request body: ${body}" />
>> <to uri="direct:xxxx-Route" />
>> ...
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794322.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Mask password using log component
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 23, 2017 at 10:05 AM, adondoni <an...@gmail.com> wrote:
> Hi,
> I've already thinks this solution.
> But if mask a password into a bean before log, I modify a message that
> continue in a route a lost password value.
>
You dont call the bean before, but call the bean from within the <log>
so it does NOT change your message.
> My blueprint xml is:
>
> ...
> <log message="request body: ${body}" />
> <to uri="direct:xxxx-Route" />
> ...
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794322.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Mask password using log component
Posted by adondoni <an...@gmail.com>.
Hi,
I've already thinks this solution.
But if mask a password into a bean before log, I modify a message that
continue in a route a lost password value.
My blueprint xml is:
...
<log message="request body: ${body}" />
<to uri="direct:xxxx-Route" />
...
--
View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794322.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mask password using log component
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Okay so its in json format.
Masking password from the message body depends on what format is it in
json, xml, text, pojo (toString) etc.
There is no out of the box mask function you can use.
Camel does mask passwords in endpoint uris, but that is easier because
its uri parameters with key=value.
So what you can do is to have a java bean with a log method where you
mask the password and then call your bean from the <log>. The log
message uses the simple language so you can check that doc how to call
beans
You can maybe use some regular exp to find / replace that password in your json
On Thu, Feb 23, 2017 at 9:44 AM, adondoni <an...@gmail.com> wrote:
> Hello Claus,
> thanks for your reply.
>
> My message body is a jsor RPC request like this
>
> {
> "method": "login",
> "id": "341182007",
> "params": {
> "username": "xxxxx",
> "password": "yyyy"
> },
> "jsonrpc": "2.0"
> }
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794308.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Mask password using log component
Posted by adondoni <an...@gmail.com>.
Hello Claus,
thanks for your reply.
My message body is a jsor RPC request like this
{
"method": "login",
"id": "341182007",
"params": {
"username": "xxxxx",
"password": "yyyy"
},
"jsonrpc": "2.0"
}
--
View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301p5794308.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Mask password using log component
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
How is your password represented in the message body that is logged?
On Wed, Feb 22, 2017 at 11:24 PM, adondoni <an...@gmail.com> wrote:
> Hello,
> I've implemented a route that receive JSON-RPC request from cxfrs.
>
> Before processing message, trace body request as:
>
> <log message="request body: ${body}" />
>
> My problem is that request could be contains password value.
>
> Question is how can I mask password value when log body message.
>
> Thank in advance
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Mask-password-using-log-component-tp5794301.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2