Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python): add cwe-319 cleartext communication rules #422

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading