Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何从日志中的xml中筛选敏感数据_Ruby On Rails_Logging_Activemerchant - Fatal编程技术网

Ruby on rails 如何从日志中的xml中筛选敏感数据

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/

我有一个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/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中表单的参数