Skip to content

Commit

Permalink
Python rule improvements #2 (#227)
Browse files Browse the repository at this point in the history
* Python rule improvements #2

* Fix code review comment

---------

Co-authored-by: Dattaprasad Mundada <[email protected]>
  • Loading branch information
dbMundada and Dattaprasad Mundada authored Apr 18, 2023
1 parent b61237f commit b08611a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/sinkSkipList/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ sinkSkipList:
- id: SinkSkipList.ThirdParties
name: Skip Third Party Sinks
patterns:
- "(dict|list|str|tuple|int)\\.__.*"
- "(typing.){0,1}(dict|list|str|tuple|int)\\.__.*"
- "(django.*\\.py|selenium).*"
- "\\/.*[.]py.*"
- "(__builtin|cls|ModelClass|assoc|result)\\..*"
- "(?i)(builtins|stringio|operator|functools|ast|jwt|cookielib|hashlib|urlparse|hmac|six|glob|json|html2text|yaml|re|copy|argparse|datetime|time|decimal|collections|asyncio|subprocess|pytest|logging|traceback|sys|os|oss2|unittest|base64|dateutil|importlib|socket|urllib3|urllib|io|uuid|gzip|math|bson|random|xmltodict|shutil|tempfile).*"
- "(?i)(builtins|stringio|operator|functools|pathlib|ast|jwt|cookielib|hashlib|urlparse|hmac|six|glob|json|html2text|yaml|re|copy|argparse|datetime|time|decimal|collections|asyncio|subprocess|pytest|logging|traceback|sys|os|oss2|unittest|base64|dateutil|importlib|socket|urllib3|urllib|io|uuid|gzip|math|bson|random|xmltodict|shutil|tempfile).*"

- id: SinkSkipList.BuiltInLib
name: Skip built in language libraries
Expand Down
2 changes: 1 addition & 1 deletion config/systemConfig/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ systemConfig:
value: (?i)(?:url(?!(open|encode))|client|get|set|post|put|patch|delete|head|options|request|feed|trigger|init|find|send|receive|redirect|fetch|execute|response|pool|client|http|load|list|trace|remove|write|provider|host|access|info_read|select|perform).*

- key: apiIdentifier
value: (?i).*((hook|base|auth|prov|endp|install|cloud|host|request|service|gateway|route|resource)(.){0,12}url|(slack|web)(.){0,4}hook|(rest|api|host|cloud|request|service)(.){0,4}(endpoint|gateway|route)).*
value: (?i).*((hook|base|auth|prov|endp|install|cloud|host|request|service|gateway|route|resource|upload)(.){0,12}url|(slack|web)(.){0,4}hook|(rest|api|host|cloud|request|service)(.){0,4}(endpoint|gateway|route)).*
1 change: 1 addition & 0 deletions rules/sinks/storages/amazonS3/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sinks:
- s3.amazon.com
patterns:
- "(?i).*(aws_cdk.*(aws_s3|assets)).*"
- "(?i).*(get_s3_bucket).*"
- "(?i).*(aws_helper|s3transfer|templates_s3|s3util|s3url|url_for_s3|s3_parse_url|ctodd_python_lib_aws|awss3lib|s3file|mypy_boto3_s3|s3_encryption|mypy_boto3_s3|pip_services3_aws|bits3).py.*"
- "(?i).*boto.*(?:get|bucket|put|download.{0,1}file|delete|bucket|object|list.{0,1}obj|upload.{0,1}file|download.{0,1}fileobj|presigned.{0,1}url).*"
tags:

0 comments on commit b08611a

Please sign in to comment.