Skip to content

Commit bc30784

Browse files
committed
Obfuscate Nonce and Authorization token
1 parent b8493e4 commit bc30784

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

ProcessMaker/WebServices/NativeSoapClient.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,24 @@ private function logSoap($label, $log)
9292
if ($credentials->length) {
9393
$doc->getElementsByTagName('Username')->item(0)->nodeValue = '************';
9494
$doc->getElementsByTagName('Password')->item(0)->nodeValue = '************';
95+
96+
if ($doc->getElementsByTagName('Nonce')->item(0) && $doc->getElementsByTagName('Nonce')->item(0)->nodeValue) {
97+
$doc->getElementsByTagName('Nonce')->item(0)->nodeValue = '************';
98+
}
9599
}
96100

97101
Log::channel('data-source')->info($label . $doc->saveXML());
98102
} catch (\Throwable $th) {
103+
if ($label === 'Request Headers: ') {
104+
$newLog = '';
105+
foreach (preg_split("/((\r?\n)|(\r\n?))/", $log) as $line) {
106+
if (str_contains($line, 'Authorization:')) {
107+
$line = 'Authorization: ************';
108+
}
109+
$newLog .= $line . PHP_EOL;
110+
}
111+
$log = $newLog;
112+
}
99113
Log::channel('data-source')->info($label . $log);
100114
}
101115
}

0 commit comments

Comments
 (0)