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

UserContactInfo admin improvements #9300

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 11 additions & 1 deletion dojo/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import base64

Check warning on line 1 in dojo/models.py

View check run for this annotation

DryRunSecurity / Configured Sensitive Files Check

Sensitive File Edit

This file edit was detected to be sensitive according to the DryRun Security Configuration for this repository. Any edit to this file by an Author not in the allowedAuthors list will be considered sensitive.
import hashlib
import logging
import os
Expand Down Expand Up @@ -241,7 +241,17 @@
slack_user_id = models.CharField(blank=True, null=True, max_length=25)
block_execution = models.BooleanField(default=False, help_text=_("Instead of async deduping a finding the findings will be deduped synchronously and will 'block' the user until completion."))
force_password_reset = models.BooleanField(default=False, help_text=_('Forces this user to reset their password on next login.'))

def __str__(self):
return f"UserContactInfo<{self.user}>"

Check warning on line 247 in dojo/models.py

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `__str__`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: Potential authentication or authorization function. Contains a reference to 'UserContactInfo' which may be related to user authentication or authorization.

class UserContactInfoAdmin(admin.ModelAdmin):

def get_list_display(self, request):
list_fields = [field.name for field in self.model._meta.fields]
return list_fields

Check warning on line 254 in dojo/models.py

View check run for this annotation

DryRunSecurity / AI-powered Sensitive Function Check

Possible Sensitive Function

Our AI-Powered Sensitive Function checker believes it has discovered a sensitive function being modified in this PR. The name of the function is `get_list_display`. Extra care must be taken when modifying a function that is potentially security-sensitive. The following reason was provided for why this function was flagged as sensitive: Potential authentication or authorization function. Contains a reference to 'UserContactInfoAdmin' which may be related to user authentication or authorization.

class Dojo_Group(models.Model):
AZURE = 'AzureAD'
Expand Down Expand Up @@ -4360,7 +4370,7 @@
admin.site.register(Endpoint)
admin.site.register(Product)
admin.site.register(Product_Type)
admin.site.register(UserContactInfo)
admin.site.register(UserContactInfo, UserContactInfoAdmin)
admin.site.register(Notes)
admin.site.register(Note_Type)
admin.site.register(Alerts)
Expand Down
Loading