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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + tags: diff --git a/rules/sinks/third_parties/api/go.yaml b/rules/sinks/third_parties/api/go.yaml index cccf25ec..268bfd46 100644 --- a/rules/sinks/third_parties/api/go.yaml +++ b/rules/sinks/third_parties/api/go.yaml @@ -3,6 +3,6 @@ sinks: - id: Sinks.ThirdParties.API name: Third Party API patterns: - - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" - "(?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)).*" tags: diff --git a/rules/sinks/third_parties/api/java.yaml b/rules/sinks/third_parties/api/java.yaml index cccf25ec..268bfd46 100644 --- a/rules/sinks/third_parties/api/java.yaml +++ b/rules/sinks/third_parties/api/java.yaml @@ -3,6 +3,6 @@ sinks: - id: Sinks.ThirdParties.API name: Third Party API patterns: - - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" - "(?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)).*" tags: diff --git a/rules/sinks/third_parties/api/javascript.yaml b/rules/sinks/third_parties/api/javascript.yaml index 5a432d70..f67cc547 100644 --- a/rules/sinks/third_parties/api/javascript.yaml +++ b/rules/sinks/third_parties/api/javascript.yaml @@ -3,5 +3,5 @@ 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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + - "(?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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" tags: diff --git a/rules/sinks/third_parties/api/php.yaml b/rules/sinks/third_parties/api/php.yaml index 5a432d70..f67cc547 100644 --- a/rules/sinks/third_parties/api/php.yaml +++ b/rules/sinks/third_parties/api/php.yaml @@ -3,5 +3,5 @@ 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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + - "(?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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" tags: diff --git a/rules/sinks/third_parties/api/python.yaml b/rules/sinks/third_parties/api/python.yaml index 4cc37e23..b61fa151 100644 --- a/rules/sinks/third_parties/api/python.yaml +++ b/rules/sinks/third_parties/api/python.yaml @@ -3,5 +3,5 @@ sinks: - id: Sinks.ThirdParties.API name: Third Party API patterns: - - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" tags: diff --git a/rules/sinks/third_parties/api/ruby.yaml b/rules/sinks/third_parties/api/ruby.yaml index cccf25ec..268bfd46 100644 --- a/rules/sinks/third_parties/api/ruby.yaml +++ b/rules/sinks/third_parties/api/ruby.yaml @@ -3,6 +3,6 @@ sinks: - id: Sinks.ThirdParties.API name: Third Party API patterns: - - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" + - "(?i)((?:http|https):\\/\\/[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).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)" - "(?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)).*" tags: