From 9f11d0aa3b10b506d70d1c33b1cc0ab7f71907b2 Mon Sep 17 00:00:00 2001 From: David Roe Date: Wed, 4 Oct 2023 16:43:21 +0100 Subject: [PATCH] feat: add ssl verification rule --- rules/php/lang/ssl_verification.yml | 397 ++++ rules/php/shared/lang/http_url.yml | 2 + rules/php/shared/lang/instance.yml | 2 +- .../__snapshots__/test.js.snap | 2067 +++++++++++++++++ tests/php/lang/ssl_verification/test.js | 106 + .../lang/ssl_verification/testdata/bad.php | 20 + .../ssl_verification/testdata/bad_buzz.php | 13 + .../ssl_verification/testdata/bad_guzzle.php | 30 + .../ssl_verification/testdata/bad_laminas.php | 23 + .../ssl_verification/testdata/bad_laravel.php | 11 + .../testdata/bad_pecl_http.php | 20 + .../testdata/bad_requests.php | 25 + .../testdata/bad_sendgrid.php | 3 + .../ssl_verification/testdata/bad_symfony.php | 21 + .../ssl_verification/testdata/bad_unirest.php | 4 + .../php/lang/ssl_verification/testdata/ok.php | 21 + .../ssl_verification/testdata/ok_buzz.php | 13 + .../ssl_verification/testdata/ok_guzzle.php | 30 + .../ssl_verification/testdata/ok_laminas.php | 20 + .../ssl_verification/testdata/ok_laravel.php | 11 + .../testdata/ok_pecl_http.php | 16 + .../ssl_verification/testdata/ok_requests.php | 20 + .../ssl_verification/testdata/ok_sendgrid.php | 3 + .../ssl_verification/testdata/ok_symfony.php | 21 + .../ssl_verification/testdata/ok_unirest.php | 4 + 25 files changed, 2902 insertions(+), 1 deletion(-) create mode 100644 rules/php/lang/ssl_verification.yml create mode 100644 tests/php/lang/ssl_verification/__snapshots__/test.js.snap create mode 100644 tests/php/lang/ssl_verification/test.js create mode 100644 tests/php/lang/ssl_verification/testdata/bad.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_buzz.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_guzzle.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_laminas.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_laravel.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_pecl_http.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_requests.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_sendgrid.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_symfony.php create mode 100644 tests/php/lang/ssl_verification/testdata/bad_unirest.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_buzz.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_guzzle.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_laminas.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_laravel.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_pecl_http.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_requests.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_sendgrid.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_symfony.php create mode 100644 tests/php/lang/ssl_verification/testdata/ok_unirest.php diff --git a/rules/php/lang/ssl_verification.yml b/rules/php/lang/ssl_verification.yml new file mode 100644 index 000000000..613aac886 --- /dev/null +++ b/rules/php/lang/ssl_verification.yml @@ -0,0 +1,397 @@ +imports: + - php_shared_lang_instance +patterns: + - pattern: curl_setopt($<_>, $