Skip to content

Commit

Permalink
utils: hide passwords/authentication specified in cli parameters as *…
Browse files Browse the repository at this point in the history
…auth=xyz (e.g. --http-auth=abc:xyz)" in html report
  • Loading branch information
janreges committed Dec 20, 2023
1 parent 2d14bd5 commit c8bb88f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Crawler/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ public static function getUrlWithoutSchemeAndHost(string $url, ?string $onlyWhen
public static function getSafeCommand(string $command): string
{
return preg_replace(
['/(pass[a-z]{0,5})=\S+/i', '/(keys?)=\S+/i', '/(secrets?)=\S+/i'],
['$1=***', '$1=***', '$1=***'],
['/(pass[a-z]{0,5})=\S+/i', '/(keys?)=\S+/i', '/(secrets?)=\S+/i', '/(auth)=\S+/i'],
['$1=***', '$1=***', '$1=***', '$1=***'],
$command
);
}
Expand Down

0 comments on commit c8bb88f

Please sign in to comment.