From 6da45094b934361e378812fed6d93fea050a37d7 Mon Sep 17 00:00:00 2001 From: geeknik <466878+geeknik@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:35:13 +0000 Subject: [PATCH] Update avoid-http-usage.yaml Changes: - Use `matchers-condition: and` to require both an HTTP match and no HTTPS match - Update the HTTP regex to exclude http:// in comments or strings - Add a negative HTTPS matcher to check HTTP is used without HTTPS This makes the template more targeted by requiring HTTP usage without HTTPS to avoid false positives. The extractors stay the same. --- avoid-http-usage.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/avoid-http-usage.yaml b/avoid-http-usage.yaml index 6f67e70..927eb87 100644 --- a/avoid-http-usage.yaml +++ b/avoid-http-usage.yaml @@ -11,10 +11,15 @@ file: - json - js + matchers-condition: and matchers: - type: regex regex: - - "http://" + - "http://[^s]" + - type: regex + regex: + - "https://" + negative: true extractors: - type: regex @@ -22,4 +27,3 @@ file: name: extracted_http_url regex: - "http://[^\\s'\"]+" -