mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(logs): webhook sanitization (#809)
* feat: sanitize passwords from json payload * add webhook sanitization * update comments Co-authored-by: soup <soup@r4tio.dev> * sanitize RED apikeys from webhook payloads * added an optional whitespace token between field name and data --------- Co-authored-by: soup <soup@r4tio.dev>
This commit is contained in:
parent
69f6acbc4d
commit
169863dded
2 changed files with 18 additions and 2 deletions
|
@ -138,6 +138,18 @@ func TestSanitizeLogFile(t *testing.T) {
|
|||
input: "\"module\":\"irc\" PRIVMSG NickServ IDENTIFY zAPEJEA8ryYnpj3AiE3KJ",
|
||||
expected: "\"module\":\"irc\" PRIVMSG NickServ IDENTIFY REDACTED",
|
||||
},
|
||||
{
|
||||
input: "\"module\":\"action\" \\\"host\\\":\\\"subdomain.domain.com:42069/subfolder\\\", \\n \\\"user\\\":\\\"AUserName\\\", \\n \\\"password\\\":\\\"p4ssw0!rd\\\", \\n",
|
||||
expected: "\"module\":\"action\" \\\"host\\\":\\\"REDACTED\\\", \\n \\\"user\\\":\\\"REDACTED\\\", \\n \\\"password\\\":\\\"REDACTED\\\", \\n",
|
||||
},
|
||||
{
|
||||
input: "\"module\":\"action\" ExternalWebhookHost:http://127.0.0.1:6940/api/upgrade ExternalWebhookData:",
|
||||
expected: "\"module\":\"action\" ExternalWebhookHost:REDACTED ExternalWebhookData:",
|
||||
},
|
||||
{
|
||||
input: "\"module\":\"filter\" \\\"id\\\": 3855,\\n \\\"apikey\\\": \\\"ad789a9s8d.asdpoiasdpojads09sad809\\\",\\n \\\"minratio\\\": 10.0\\n",
|
||||
expected: "\"module\":\"filter\" \\\"id\\\": 3855,\\n \\\"apikey\\\": \\\"REDACTED\\\",\\n \\\"minratio\\\": 10.0\\n",
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue