Ruby on rails 如何从日志中的xml中筛选敏感数据
我有一个Rails应用程序,它使用ActiveMerchant gem 当ActiveMerchant gem发布ssl请求(例如处理信用卡)时,它将主体记录为调试行66 此调试包含敏感信息,如密码、用户名等Ruby on rails 如何从日志中的xml中筛选敏感数据,ruby-on-rails,logging,activemerchant,Ruby On Rails,Logging,Activemerchant,我有一个Rails应用程序,它使用ActiveMerchant gem 当ActiveMerchant gem发布ssl请求(例如处理信用卡)时,它将主体记录为调试行66 此调试包含敏感信息,如密码、用户名等 <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://tempuri.org/">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>usernamehere</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">passwordhere</wsse:Password>
....
用户名在这里
密码
....
如何从日志中筛选出这些敏感字段?为什么不在生产中禁用调试日志?当出现问题时,调试非常有用,因此我真的希望筛选出Rails中表单的参数