diff --git a/config/exclusions/csharp.yaml b/config/exclusions/csharp.yaml new file mode 100644 index 00000000..c71a4430 --- /dev/null +++ b/config/exclusions/csharp.yaml @@ -0,0 +1,5 @@ +exclusions: + - id: Exclusions.Test + name: Exclude test source code + patterns: + - "(.*(?i)(Tests|UnitTest(s)?)/.*)|/.*Test(s)?[.]cs$" \ No newline at end of file diff --git a/config/systemConfig/csharp.yaml b/config/systemConfig/csharp.yaml new file mode 100644 index 00000000..f5a65ef6 --- /dev/null +++ b/config/systemConfig/csharp.yaml @@ -0,0 +1,9 @@ +systemConfig: + - key: apiHttpLibraries + value: ^(?i)(System[.]Net[.]Http|RestSharp|EasyHttp|Flurl[.]Http|Refit|Restease|Nancy[.]HttpClient|FluentHttp|Polly|EasyHttp|Windows[.]Web[.]Http|FluentRest|Restup|FiddlerCore|NHttp).* + + - key: apiSinks + value: (?i)(?:url|client|open|request|execute|newCall|load|host|access|list|set|put|post|proceed|trace|patch|Path|send|remove|delete|write|read|postForEntity|call|createCall|createEndpoint|dispatch|invoke|getInput|getOutput|getResponse|do) + + - key: apiIdentifier + value: (?i).*((hook|base|auth|prov|endp|install|request|service|gateway|route|resource)(.){0,12}url|(slack|web)(.){0,4}hook|(rest|api|request|service)(.){0,4}(endpoint|gateway|route)).* \ No newline at end of file diff --git a/rules/sinks/internal_apis/api/csharp.yaml b/rules/sinks/internal_apis/api/csharp.yaml new file mode 100644 index 00000000..29306516 --- /dev/null +++ b/rules/sinks/internal_apis/api/csharp.yaml @@ -0,0 +1,6 @@ +sinks: + - id: Sinks.API.InternalAPI + name: Internal APIs + patterns: + - "((http|https|ftp|ssh):\\/\\/){0,1}(((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}|(localhost))(:[0-9]{2,4}){0,1}(\\/([a-z]){0,1}){0,1}.*" + tags: diff --git a/rules/sinks/third_parties/api/csharp.yaml b/rules/sinks/third_parties/api/csharp.yaml new file mode 100644 index 00000000..3e98e6ce --- /dev/null +++ b/rules/sinks/third_parties/api/csharp.yaml @@ -0,0 +1,7 @@ +sinks: + + - id: Sinks.ThirdParties.API + name: Third Party API + patterns: + - "(?i)((?:http:|https:|ftp:|ssh:|udp:|wss:|ws:){0,1}(\\/){0,2}[a-zA-Z0-9_-][^)\\/(#|,!>\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?\\s@]{1,50}\\.\\b(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)\\b).*(?." - -sinks: - - - id: ThirdParties.SDK.Allure - name: Allure - domains: - - "allure.com" - patterns: - - "(?i)(io[.]qameta[.]allure).*" - tags: diff --git a/rules/sinks/third_parties/sdk/auth0/java.yaml b/rules/sinks/third_parties/sdk/auth0/java.yaml index b4be9cbe..b078f4f3 100644 --- a/rules/sinks/third_parties/sdk/auth0/java.yaml +++ b/rules/sinks/third_parties/sdk/auth0/java.yaml @@ -9,5 +9,6 @@ sinks: domains: - "auth0.com" patterns: - - "(?i)(auth0-clojure|auth0-ring|com[.]auth0[.]android[.]gradle-credentials|com[.]auth0[.]android|com[.]auth0[.]gradle[.]java-oss-library|com[.]auth0[.]gradle[.]oss-library[.]android|com[.]auth0[.]gradle[.]oss-library[.]java|com[.]auth0[.]gradle[.]oss-library|com[.]auth0[.]gradle|com[.]auth0|gradle[.]plugin[.]com[.]auth0[.]android|gradle[.]plugin[.]com[.]auth0[.]gradle|org[.]webjars[.]bowergithub[.]auth0|org[.]wso2[.]km[.]ext[.]auth0).*" + - "(?i)(auth0-clojure|auth0-ring|com[.]auth0[.]android[.]gradle-credentials|com[.]auth0[.]android|com[.]auth0[.]gradle|gradle[.]plugin[.]com[.]auth0[.]android|gradle[.]plugin[.]com[.]auth0[.]gradle|org[.]webjars[.]bowergithub[.]auth0|org[.]wso2[.]km[.]ext[.]auth0).*" + - "(?i)(com[.]auth0[.](?!jwt\b|jwt[.]|utils?\b|utils?[.]|helpers?\b|helpers?[.]|common\b|common[.]|core\b|core[.]).+)" tags: diff --git a/rules/sinks/third_parties/sdk/micrometer/java.yaml b/rules/sinks/third_parties/sdk/micrometer/java.yaml deleted file mode 100644 index 367890c2..00000000 --- a/rules/sinks/third_parties/sdk/micrometer/java.yaml +++ /dev/null @@ -1,13 +0,0 @@ - -# Sink rule for ThirdParty SDK -# The id follows a format : "ThirdParties.SDK.." - -sinks: - - - id: ThirdParties.SDK.Micrometer - name: Micrometer - domains: - - "micrometer.io" - patterns: - - "(io.micrometer(?!.*(util|internal)).*)" - tags: