mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 19:26:48 +00:00
fix: the views that take a password or a key keep it out of error reports
No view used sensitive_post_parameters, so once ADMINS is set the error mail of a failing POST would carry the password or key in plain text. The user create, edit and password views, the password change, the compute forms, the host secrets, the VM's root password and its console settings now mark their POST data sensitive.
This commit is contained in:
parent
d3178154c3
commit
2cbcb8ab2c
6 changed files with 44 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ from django.utils import timezone
|
|||
from django.utils.http import url_has_allowed_host_and_scheme, urlencode
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.decorators.http import require_POST
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
from instances.models import InstanceTombstone
|
||||
from instances.report import workbook
|
||||
from logs.audit import audit, changed_fields, snapshot
|
||||
|
|
@ -124,6 +125,7 @@ def user_list(request):
|
|||
)
|
||||
|
||||
|
||||
@sensitive_post_parameters()
|
||||
@superuser_only
|
||||
def user_create(request):
|
||||
user_form = forms.UserCreateForm(request.POST or None)
|
||||
|
|
@ -149,6 +151,7 @@ def user_create(request):
|
|||
)
|
||||
|
||||
|
||||
@sensitive_post_parameters()
|
||||
@superuser_only
|
||||
def user_update(request, pk):
|
||||
user = get_object_or_404(User, pk=pk)
|
||||
|
|
@ -190,6 +193,7 @@ def user_update(request, pk):
|
|||
)
|
||||
|
||||
|
||||
@sensitive_post_parameters()
|
||||
@superuser_only
|
||||
def user_update_password(request, pk):
|
||||
user = get_object_or_404(User, pk=pk)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue