From 1d0f8b46c15d150f363848afc5878ccdb6ee6ede Mon Sep 17 00:00:00 2001 From: clavedeluna Date: Fri, 13 Oct 2023 09:48:09 -0300 Subject: [PATCH] update all codemod summary fields --- src/core_codemods/django_debug_flag_on.py | 4 ++-- src/core_codemods/django_session_cookie_secure_off.py | 2 +- src/core_codemods/enable_jinja2_autoescape.py | 4 ++-- src/core_codemods/harden_pyyaml.py | 2 +- src/core_codemods/harden_ruamel.py | 2 +- src/core_codemods/https_connection.py | 4 ++-- src/core_codemods/jwt_decode_verify.py | 4 ++-- src/core_codemods/limit_readline.py | 2 +- src/core_codemods/lxml_safe_parser_defaults.py | 4 ++-- src/core_codemods/lxml_safe_parsing.py | 2 +- src/core_codemods/order_imports.py | 4 ++-- src/core_codemods/process_creation_sandbox.py | 2 +- src/core_codemods/remove_unnecessary_f_str.py | 2 +- src/core_codemods/remove_unused_imports.py | 2 +- src/core_codemods/requests_verify.py | 2 +- src/core_codemods/secure_random.py | 2 +- src/core_codemods/tempfile_mktemp.py | 2 +- src/core_codemods/upgrade_sslcontext_minimum_version.py | 2 +- src/core_codemods/upgrade_sslcontext_tls.py | 2 +- src/core_codemods/url_sandbox.py | 2 +- src/core_codemods/use_walrus_if.py | 2 +- src/core_codemods/with_threading_lock.py | 4 ++-- 22 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/core_codemods/django_debug_flag_on.py b/src/core_codemods/django_debug_flag_on.py index 626ffe01b..a0cbdc1bd 100644 --- a/src/core_codemods/django_debug_flag_on.py +++ b/src/core_codemods/django_debug_flag_on.py @@ -15,7 +15,7 @@ class DjangoDebugFlagOn(SemgrepCodemod, Codemod): METADATA = CodemodMetadata( - DESCRIPTION=("Flips django's debug flag if on."), + DESCRIPTION="Flip Django Debug Flag to Off", NAME="django-debug-flag-on", REVIEW_GUIDANCE=ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW, REFERENCES=[ @@ -29,7 +29,7 @@ class DjangoDebugFlagOn(SemgrepCodemod, Codemod): }, ], ) - SUMMARY = CHANGE_DESCRIPTION = "Flip Django debug flag to off" + SUMMARY = CHANGE_DESCRIPTION = METADATA. DESCRIPTION YAML_FILES = [ "django-debug-flag-on.yaml", ] diff --git a/src/core_codemods/django_session_cookie_secure_off.py b/src/core_codemods/django_session_cookie_secure_off.py index fa54e7dd6..86382edde 100644 --- a/src/core_codemods/django_session_cookie_secure_off.py +++ b/src/core_codemods/django_session_cookie_secure_off.py @@ -15,7 +15,7 @@ class DjangoSessionCookieSecureOff(SemgrepCodemod, Codemod): METADATA = CodemodMetadata( - DESCRIPTION=("Sets Django's `SESSION_COOKIE_SECURE` flag if off or missing."), + DESCRIPTION=("Sets Django's `SESSION_COOKIE_SECURE` Flag if Off or Missing."), NAME="django-session-cookie-secure-off", REVIEW_GUIDANCE=ReviewGuidance.MERGE_AFTER_REVIEW, REFERENCES=[ diff --git a/src/core_codemods/enable_jinja2_autoescape.py b/src/core_codemods/enable_jinja2_autoescape.py index 8000b257d..66a89d0d9 100644 --- a/src/core_codemods/enable_jinja2_autoescape.py +++ b/src/core_codemods/enable_jinja2_autoescape.py @@ -6,8 +6,8 @@ class EnableJinja2Autoescape(SemgrepCodemod): NAME = "enable-jinja2-autoescape" REVIEW_GUIDANCE = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW - SUMMARY = "Enable jinja2 autoescape" - DESCRIPTION = "Makes the `autoescape` parameter to jinja2.Environment be `True`." + SUMMARY = "Enable Jinja2 Autoescape" + DESCRIPTION = "Sets the `autoescape` parameter in jinja2.Environment to `True`." REFERENCES = [ {"url": "https://owasp.org/www-community/attacks/xss/", "description": ""}, { diff --git a/src/core_codemods/harden_pyyaml.py b/src/core_codemods/harden_pyyaml.py index 2eed37a8a..3e0991900 100644 --- a/src/core_codemods/harden_pyyaml.py +++ b/src/core_codemods/harden_pyyaml.py @@ -5,7 +5,7 @@ class HardenPyyaml(SemgrepCodemod): NAME = "harden-pyyaml" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Use SafeLoader when loading YAML" + SUMMARY = "Use SafeLoader in `yaml.load()` Calls" DESCRIPTION = "Ensures all calls to yaml.load use `SafeLoader`." REFERENCES = [ { diff --git a/src/core_codemods/harden_ruamel.py b/src/core_codemods/harden_ruamel.py index e7e6d373b..8eb0a12b1 100644 --- a/src/core_codemods/harden_ruamel.py +++ b/src/core_codemods/harden_ruamel.py @@ -6,7 +6,7 @@ class HardenRuamel(SemgrepCodemod): NAME = "harden-ruamel" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Use safe YAML loading in ruamel.yaml" + SUMMARY = "Use `typ='safe'` in ruamel.yaml() Calls" DESCRIPTION = "Ensures all unsafe calls to ruamel.yaml.YAML use `typ='safe'`." REFERENCES = [ { diff --git a/src/core_codemods/https_connection.py b/src/core_codemods/https_connection.py index bec1f4f7b..d4d0daa1c 100644 --- a/src/core_codemods/https_connection.py +++ b/src/core_codemods/https_connection.py @@ -22,7 +22,7 @@ class HTTPSConnection(BaseCodemod, Codemod): METADATA = CodemodMetadata( - DESCRIPTION=("Enforce HTTPS connection"), + DESCRIPTION="Enforce HTTPS Connection for urllib3", NAME="https-connection", REVIEW_GUIDANCE=ReviewGuidance.MERGE_WITHOUT_REVIEW, REFERENCES=[ @@ -36,7 +36,7 @@ class HTTPSConnection(BaseCodemod, Codemod): }, ], ) - CHANGE_DESCRIPTION = "Enforce HTTPS connection" + CHANGE_DESCRIPTION = METADATA.DESCRIPTION SUMMARY = "Changes HTTPConnectionPool to HTTPSConnectionPool to enforce secure connection." METADATA_DEPENDENCIES = (PositionProvider,) diff --git a/src/core_codemods/jwt_decode_verify.py b/src/core_codemods/jwt_decode_verify.py index 44c0198c4..343ac94a9 100644 --- a/src/core_codemods/jwt_decode_verify.py +++ b/src/core_codemods/jwt_decode_verify.py @@ -8,8 +8,8 @@ class JwtDecodeVerify(SemgrepCodemod): NAME = "jwt-decode-verify" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Enable all verifications in `jwt.decode` call." - DESCRIPTION = "Makes any of the multiple `verify` parameters to a `jwt.decode` call be `True`." + SUMMARY = "Verify JWT Decode" + DESCRIPTION = "Enable all verifications in `jwt.decode` call." REFERENCES = [ {"url": "https://pyjwt.readthedocs.io/en/stable/api.html", "description": ""}, { diff --git a/src/core_codemods/limit_readline.py b/src/core_codemods/limit_readline.py index 158787e7d..694780b04 100644 --- a/src/core_codemods/limit_readline.py +++ b/src/core_codemods/limit_readline.py @@ -9,7 +9,7 @@ class LimitReadline(SemgrepCodemod): NAME = "limit-readline" REVIEW_GUIDANCE = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW - SUMMARY = "Limit the size of readline() calls" + SUMMARY = "Limit readline()" DESCRIPTION = "Adds a size limit argument to readline() calls." REFERENCES = [ {"url": "https://cwe.mitre.org/data/definitions/400.html", "description": ""} diff --git a/src/core_codemods/lxml_safe_parser_defaults.py b/src/core_codemods/lxml_safe_parser_defaults.py index 4479d9cc7..2f9ff05d4 100644 --- a/src/core_codemods/lxml_safe_parser_defaults.py +++ b/src/core_codemods/lxml_safe_parser_defaults.py @@ -6,8 +6,8 @@ class LxmlSafeParserDefaults(SemgrepCodemod): NAME = "safe-lxml-parser-defaults" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Use Safe Defaults for lxml Parsers" - DESCRIPTION = "Replace lxml parser parameters with safe defaults" + SUMMARY = "Use Safe Defaults for `lxml` Parsers" + DESCRIPTION = "Replace `lxml` parser parameters with safe defaults" REFERENCES = [ { "url": "https://lxml.de/apidoc/lxml.etree.html#lxml.etree.XMLParser", diff --git a/src/core_codemods/lxml_safe_parsing.py b/src/core_codemods/lxml_safe_parsing.py index dc5ead322..82fc993ab 100644 --- a/src/core_codemods/lxml_safe_parsing.py +++ b/src/core_codemods/lxml_safe_parsing.py @@ -6,7 +6,7 @@ class LxmlSafeParsing(SemgrepCodemod): NAME = "safe-lxml-parsing" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Use safe parsers in lxml parsing functions" + SUMMARY = "Use Safe Parsers in `lxml` Parsing Functions" DESCRIPTION = ( "Call `lxml.etree.parse` and `lxml.etree.fromstring` with a safe parser" ) diff --git a/src/core_codemods/order_imports.py b/src/core_codemods/order_imports.py index 4382d17d2..4995d0e5d 100644 --- a/src/core_codemods/order_imports.py +++ b/src/core_codemods/order_imports.py @@ -15,12 +15,12 @@ class OrderImports(BaseCodemod, Codemod): METADATA = CodemodMetadata( - DESCRIPTION=("Formats and order imports by categories"), + DESCRIPTION=("Formats and orders imports by categories"), NAME="order-imports", REVIEW_GUIDANCE=ReviewGuidance.MERGE_WITHOUT_REVIEW, REFERENCES=[], ) - SUMMARY = "Order imports by categories" + SUMMARY = "Order Imports" CHANGE_DESCRIPTION = "Ordered and formatted import block below this line" METADATA_DEPENDENCIES = (PositionProvider,) diff --git a/src/core_codemods/process_creation_sandbox.py b/src/core_codemods/process_creation_sandbox.py index b5a88281d..11d99e57d 100644 --- a/src/core_codemods/process_creation_sandbox.py +++ b/src/core_codemods/process_creation_sandbox.py @@ -6,7 +6,7 @@ class ProcessSandbox(SemgrepCodemod): NAME = "sandbox-process-creation" REVIEW_GUIDANCE = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW - SUMMARY = "Sandbox process creation" + SUMMARY = "Sandbox Process Creation" DESCRIPTION = ( "Replaces subprocess.{func} with more secure safe_command library functions." ) diff --git a/src/core_codemods/remove_unnecessary_f_str.py b/src/core_codemods/remove_unnecessary_f_str.py index c85c49946..d45d3f04a 100644 --- a/src/core_codemods/remove_unnecessary_f_str.py +++ b/src/core_codemods/remove_unnecessary_f_str.py @@ -11,7 +11,7 @@ class RemoveUnnecessaryFStr(BaseCodemod, UnnecessaryFormatString): NAME = "remove-unnecessary-f-str" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Remove unnecessary f-strings" + SUMMARY = "Remove Unnecessary F-strings" DESCRIPTION = UnnecessaryFormatString.DESCRIPTION REFERENCES = [ { diff --git a/src/core_codemods/remove_unused_imports.py b/src/core_codemods/remove_unused_imports.py index 93b33e5d2..614148369 100644 --- a/src/core_codemods/remove_unused_imports.py +++ b/src/core_codemods/remove_unused_imports.py @@ -30,7 +30,7 @@ class RemoveUnusedImports(BaseCodemod, Codemod): REVIEW_GUIDANCE=ReviewGuidance.MERGE_WITHOUT_REVIEW, REFERENCES=[], ) - SUMMARY = "Remove unused imports from a module" + SUMMARY = "Remove Unused Imports" CHANGE_DESCRIPTION = "Unused import." METADATA_DEPENDENCIES = ( diff --git a/src/core_codemods/requests_verify.py b/src/core_codemods/requests_verify.py index 89b4af3b0..4cb5ee283 100644 --- a/src/core_codemods/requests_verify.py +++ b/src/core_codemods/requests_verify.py @@ -6,7 +6,7 @@ class RequestsVerify(SemgrepCodemod): NAME = "requests-verify" REVIEW_GUIDANCE = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW - SUMMARY = "Verify SSL certificates when making requests." + SUMMARY = "Verify SSL Certificates for Requests." DESCRIPTION = ( "Makes any calls to requests.{func} with `verify=False` to `verify=True`" ) diff --git a/src/core_codemods/secure_random.py b/src/core_codemods/secure_random.py index c76747dda..2a7908c9c 100644 --- a/src/core_codemods/secure_random.py +++ b/src/core_codemods/secure_random.py @@ -5,7 +5,7 @@ class SecureRandom(SemgrepCodemod): NAME = "secure-random" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Use secrets.SystemRandom() instead of random" + SUMMARY = "Secure Source of Randomness" DESCRIPTION = "Replaces random.{func} with more secure secrets library functions." REFERENCES = [ { diff --git a/src/core_codemods/tempfile_mktemp.py b/src/core_codemods/tempfile_mktemp.py index 563ce016b..cb8ea15d8 100644 --- a/src/core_codemods/tempfile_mktemp.py +++ b/src/core_codemods/tempfile_mktemp.py @@ -5,7 +5,7 @@ class TempfileMktemp(SemgrepCodemod): NAME = "secure-tempfile" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Use `tempfile.mkstemp` instead of `tempfile.mktemp`" + SUMMARY = "Upgrade and Secure Temp File Creation" DESCRIPTION = "Replaces `tempfile.mktemp` with `tempfile.mkstemp`." REFERENCES = [ { diff --git a/src/core_codemods/upgrade_sslcontext_minimum_version.py b/src/core_codemods/upgrade_sslcontext_minimum_version.py index 52a006a41..bd4068743 100644 --- a/src/core_codemods/upgrade_sslcontext_minimum_version.py +++ b/src/core_codemods/upgrade_sslcontext_minimum_version.py @@ -5,7 +5,7 @@ class UpgradeSSLContextMinimumVersion(SemgrepCodemod): NAME = "upgrade-sslcontext-minimum-version" REVIEW_GUIDANCE = ReviewGuidance.MERGE_WITHOUT_REVIEW - SUMMARY = "Upgrade minimum SSL/TLS version for SSLContext" + SUMMARY = "Upgrade SSLContext Minimum Version" DESCRIPTION = "Replaces minimum SSL/TLS version for SSLContext" REFERENCES = [ { diff --git a/src/core_codemods/upgrade_sslcontext_tls.py b/src/core_codemods/upgrade_sslcontext_tls.py index 333eb0f1c..d72af4eaa 100644 --- a/src/core_codemods/upgrade_sslcontext_tls.py +++ b/src/core_codemods/upgrade_sslcontext_tls.py @@ -28,7 +28,7 @@ class UpgradeSSLContextTLS(SemgrepCodemod, BaseTransformer): }, ], ) - SUMMARY = "Replace known insecure TLS/SSL protocol versions in SSLContext with secure ones" + SUMMARY = "Upgrade TLS Version In SSLContext" CHANGE_DESCRIPTION = "Upgrade to use a safe version of TLS in SSLContext" YAML_FILES = [ "upgrade_sslcontext_tls.yaml", diff --git a/src/core_codemods/url_sandbox.py b/src/core_codemods/url_sandbox.py index 3a4b60cd6..e068200e5 100644 --- a/src/core_codemods/url_sandbox.py +++ b/src/core_codemods/url_sandbox.py @@ -49,7 +49,7 @@ class UrlSandbox(SemgrepCodemod, Codemod): }, ], ) - SUMMARY = "Ensure that requests are made safely." + SUMMARY = "Sandbox URL Creation" CHANGE_DESCRIPTION = "Switch use of requests for security.safe_requests" YAML_FILES = [ "sandbox_url_creation.yaml", diff --git a/src/core_codemods/use_walrus_if.py b/src/core_codemods/use_walrus_if.py index 28b15fe3f..6a1e9c971 100644 --- a/src/core_codemods/use_walrus_if.py +++ b/src/core_codemods/use_walrus_if.py @@ -15,7 +15,7 @@ class UseWalrusIf(SemgrepCodemod): ScopeProvider, ) NAME = "use-walrus-if" - SUMMARY = "Use Assignment Expression in Conditional" + SUMMARY = "Use Assignment Expression (Walrus) In Conditional" REVIEW_GUIDANCE = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW DESCRIPTION = ( "Replaces multiple expressions involving `if` operator with 'walrus' operator" diff --git a/src/core_codemods/with_threading_lock.py b/src/core_codemods/with_threading_lock.py index 00e6365ee..2f002e68e 100644 --- a/src/core_codemods/with_threading_lock.py +++ b/src/core_codemods/with_threading_lock.py @@ -5,9 +5,9 @@ class WithThreadingLock(SemgrepCodemod): NAME = "bad-lock-with-statement" - SUMMARY = "Replace deprecated usage of threading lock classes as context managers" + SUMMARY = "Separate Lock Instantiation from `with` Call" + DESCRIPTION = "Replace deprecated usage of threading lock classes as context managers." REVIEW_GUIDANCE = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW - DESCRIPTION = "Separates threading lock instantiation and call with `with` statement into two steps." REFERENCES = [ { "url": "https://pylint.pycqa.org/en/latest/user_guide/messages/warning/useless-with-lock.",