Skip to content

Commit

Permalink
feat(python): add cwe-319 cleartext communication rules
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe committed May 27, 2024
1 parent 5190cbf commit 5649746
Show file tree
Hide file tree
Showing 19 changed files with 1,022 additions and 595 deletions.
35 changes: 35 additions & 0 deletions rules/python/django/insecure_smtp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
patterns:
- pattern: EMAIL_USE_TLS = $<FALSE>
filters:
- variable: "FALSE"
detection: python_django_insecure_smtp_false
scope: cursor
auxiliary:
- id: python_django_insecure_smtp_false
patterns:
- "False"
languages:
- python
metadata:
description: "Usage of insecure SMTP connection"
remediation_message: |-
## Description
An insecure SMTP connection can expose transmitted data to unauthorized access. This rule identifies if SMTP settings are configured to enforce secure connections.
## Remediations
- **Do** enable SSL encryption in your SMTP configuration to secure the connection. This prevents unauthorized access to the data being transmitted.
```python
EMAIL_USE_TLS = True
```
## References
- [OWASP insecure transport](https://owasp.org/www-community/vulnerabilities/Insecure_Transport)
cwe_id:
- 319
id: python_django_insecure_smtp
documentation_url: https://docs.bearer.com/reference/rules/python_django_insecure_smtp
cloud_code_suggestions: true
severity: critical
Loading

0 comments on commit 5649746

Please sign in to comment.