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

Mark passwords as sensitive variables #11652 #11653

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Conversation

jacobtylerwalls
Copy link
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Limit occurrences of passwords in error reports (if configured) in production.

Issues Solved

Closes #11652

@jacobtylerwalls
Copy link
Member Author

You can test with the standard django error view but, since DEBUG=True doesn't bother masking, the least realistic but fatest way to configure this to test would be hack this line in your django install to return True:

https://github.com/django/django/blob/857b1048d53ebf5fc5581c110e85c212b81ca83a/django/views/debug.py#L182

Then you should be able to throw errors inside any of these views and see the masking inside the django error view (but again, more realistically, we'd be talking about logs or emails to admins in prod environments, not the django error view):

Screenshot 2024-11-25 at 2 11 17 PM

@jacobtylerwalls jacobtylerwalls marked this pull request as ready for review November 25, 2024 19:30
Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great. Could you make the variables sensitive on the post method in the SignupView in views/auth.py as well?

Comment on lines 225 to 228
@method_decorator(
sensitive_variables(),
sensitive_post_parameters(),
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only seems to work when the methods are within an iterator (as I see you've done elsewhere)

@chiatt chiatt merged commit 8ee9a0a into dev/8.0.x Jan 23, 2025
7 checks passed
@chiatt chiatt deleted the jtw/sensitive-variables branch January 23, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter out passwords from error reports in production
2 participants