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

Sensitive data #15

Open
RamezIssac opened this issue May 13, 2024 · 3 comments
Open

Sensitive data #15

RamezIssac opened this issue May 13, 2024 · 3 comments

Comments

@RamezIssac
Copy link

Hello there 👋
I came across Sonar, read through the code, and i like the idea.
Jus noticed that you're saving POST data into the database and wanted to raise the concern that it might contains sensitive data like passwords etc..

Good initiation, keep it up mate !

@metalogico
Copy link
Owner

Hello!
Yes, I know it could contain sensitive data. It's hard to avoid that, but I have few ideas to keep the database clean.
Right now I'm working on extending django-sonar features but after that I will take a look into this matter.
Thanks for the heads up!

@RamezIssac
Copy link
Author

Check django.views.decorators.debug.sensitive_post_parameters decorator
https://docs.djangoproject.com/en/dev/howto/error-reporting/#django.views.decorators.debug.sensitive_post_parameters

Quick example:

from django.views.decorators.debug import sensitive_post_parameters

@sensitive_post_parameters
def login_view(request):
    return HttpsResponse()

# then in your middleware, when writing the log 
for key, val in request.POST:
    if  request.sensitive_post_parameters == "__ALL__" or key in request.sensitive_post_parameters:
        # sensitive
    else:
        # safe
        

:)

@metalogico
Copy link
Owner

Exactly! Something along those lines. Thanks

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

No branches or pull requests

2 participants