API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Redaction on API Connect v10 for SOAP/XML payload

    Posted 12/05/23 12:10 PM

    Hi all,

    I am trying to find out the solution how to redact sensitive data from SOAP/XML payload. We are using off-load system (Splunk) for viewing api events and we can't show sensitive data there.

    I have tried use the following syntax in Redaction transformation

    root: log

    path: $xpath(request_body, "//*[local-name()='field_name']")

    or

    root:

    path: $xpath(log.request_body, "//*[local-name()='field_name']")

    but no success result, sensitive data is still visible on api event log.

    Any ideas how to solve this issue, with API Connect v5 I have solve this problem and migration from API Connect v5 -> API Connect v10 didn't help 



    ------------------------------
    Juha Mikkonen
    ------------------------------


  • 2.  RE: Redaction on API Connect v10 for SOAP/XML payload

    Posted 12/31/23 10:29 AM

    Hi @Juha Mikkonen,

    To solve redaction problem, I can think of two options for your case:

    1. If you are using DataPower Gateway, you can use a redaction policy as documented here.
    2. Set up Field redaction rule in Splunk to not index sensitive fields. Read more here.

    Please let me know if these options do not work for you. I can dig in with more context.



    ------------------------------
    Ruchi Yadav
    ------------------------------



  • 3.  RE: Redaction on API Connect v10 for SOAP/XML payload

    Posted 01/04/24 03:57 PM

    Hi Juha,
    Since you're redact path is using the JSONata $xpath function, you are using a redact 2.0.0 or later version policy.  The XPath's specified look fine to me.
    A couple questions and comments:
    1. Do you proceed your redact policy with a log policy with a type of gather-only?  When doing a redact 2.x policy, the logs.request|response_body are added to the API context when the log policy with gather-only is executed.  If you are not doing that, then the log data doesn't exist at the time of your redact policy execution so nothing is redacted, but the log data will be added implicitly with the un-redacted bodies after the assembly completes and a log policy has not been executed.
    2. What version of DataPower do you have deployed? Hopefully you're using 10.5.x.y as this version supports the finally clause.  Version 10.0.1.x does not have the finally clause which makes the use of the redact 2.0.0 policy difficult.  That is because any failure in the API that causes the assembly to fail before the redact policy will mean there will be no redaction.  You could of course then duplicate the log and redact policies at the end of every catch you have, and if you don't have a catch or do have a catch but not a default catch, you'd need to add a default catch that would do the log and redact policies and then rethrow the error.  Needless to say it was somewhat cumbersome in that version which is why the finally clause was added.  If using 10.5.x.y then the log and redact policy should be specified in the finally clause.  This way they're specified only in one place and will be guaranteed to execute regardless of an error in the assembly rule or a catch rule.
    Best Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 4.  RE: Redaction on API Connect v10 for SOAP/XML payload

    Posted 02/02/24 03:39 AM

    Hello Steve,

    The simililar xpath works fine in API Connect v5.

    1. Yes, I am using in log policy gather-only mode
    2. We have deployed API Connect version 10.0.5.3 and Gateway version is 10.5.0.9 and Log policy and redact transformation is added to finally clause.

    I need to investigate this more.

    Juha



    ------------------------------
    Juha Mikkonen
    ------------------------------



  • 5.  RE: Redaction on API Connect v10 for SOAP/XML payload

    Posted 02/05/24 07:28 AM

    Hi Juha,
    The only question I can think of adding at this point is are you doing an initial parse in the API?   If not and your request is streamed, I'm thinking your request.body is not in context so the log action with gather only has no request to gather and your redact has nothing to work on, then the request_body is added when the gateway sees no request_body in the analytics record.  Is your issue only with redaction of request_body and not with redaction of response_body? If you are doing the parse up front, I'd suggest you open a PMR to have this investigated further.
    Best Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------