-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API changes pending ADO pipeline agent integration. (#113)
* More API changes pending ADO pipeline agent integration.: * Add new tests * Update generated rules files. * Update release notes. * Remove short secrets filtering.:
- Loading branch information
1 parent
801cae0
commit 034040c
Showing
7 changed files
with
70 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,31 +6,39 @@ | |
|
||
namespace Microsoft.Security.Utilities; | ||
|
||
internal sealed class UrlCredentials : RegexPattern | ||
public sealed class UrlCredentials : RegexPattern | ||
{ | ||
public UrlCredentials() | ||
{ | ||
Id = "SEC101/127"; | ||
|
||
Name = nameof(UrlCredentials); | ||
|
||
Pattern = @"https?:\/\/(?:[^:@]+):(?<refine>[^:@?]+)@"; | ||
Pattern = @"(ftps?|https?):\/\/(?:[^:@]+):(?<refine>[^:@?]+)@"; | ||
|
||
DetectionMetadata = DetectionMetadata.MediumConfidence; | ||
|
||
Signatures = new HashSet<string>(new[] | ||
{ | ||
"ftp", | ||
"http" | ||
}); | ||
} | ||
|
||
public override Tuple<string, string> GetMatchIdAndName(string match) | ||
{ | ||
return base.GetMatchIdAndName(match); | ||
} | ||
|
||
public override IEnumerable<string> GenerateTruePositiveExamples() | ||
{ | ||
// https://tools.ietf.org/html/rfc3986#section-3.2) | ||
return new[] | ||
{ | ||
$"http://{Guid.NewGuid()}:{Guid.NewGuid()}@example.com/", | ||
$"https://user:[email protected]" | ||
$"https://user:[email protected]", | ||
$"ftp://{Guid.NewGuid()}:{Guid.NewGuid()}@example.com/", | ||
$"ftps://user:[email protected]" | ||
}; | ||
} | ||
} |
Oops, something went wrong.