GhostManager / Shepherd

A Django application to help red team operators manage a library of domain names
https://medium.com/@cmaddy/being-a-good-domain-shepherd-part-2-5e8597c3fe63
161 stars 37 forks source link

Domain add requires all fields to be filled in #6

Closed g-unit123 closed 1 year ago

g-unit123 commented 5 years ago

When manually creating a domain entry every field must be filled in, even when it makes no sense. IE Why should I have to fill in domain categories, when they can be blank once the domain is created.

Please alter the form to allow Categories, note, and purchase/expiration date fields to be blank/empty or have a default value pre-filled to allow for streamlined entry of new domains.

chrismaddalena commented 5 years ago

Thanks, I'll look into it. It's an easy change in the models.py to make it so those field can be null.

gitcomrade commented 5 years ago

I ran into this too, thanks for the tip Chris. I was able to modify the catalog/models.py file so those fields are no longer required. Adding blank=True to items in the file accomplished this.

Here's a snippet from models.py where I added a comma and that string at the end. Just do this for whatever field you want optional.

    ibm_xforce_cat = models.CharField('IBM X-Force', max_length=100, help_text='Domain category as determined by IBM X-Force', null=True, blank=True)
    bluecoat_cat =models.CharField('Bluecoat', max_length=100, help_text='Domain category as determined by Bluecoat', null=True, blank=True)
    fortiguard_cat = models.CharField('Fortiguard', max_length=100, help_text='Domain category as determined by Fortiguard', null=True, blank=True)
    opendns_cat = models.CharField('OpenDNS', max_length=100, help_text='Domain category as determined by OpenDNS', null=True, blank=True)
    trendmicro_cat = models.CharField('TrendMicro', max_length=100, help_text='Domain category as determined by TrendMicro', null=True, blank=True)
    mx_toolbox_status =  models.CharField('MX Toolbox Status', max_length=100, help_text='Domain spam status as determined by MX Toolbox', null=True, blank=True)
    note = models.TextField('Notes', help_text='Domain-related notes, such as thoughts behind its purchase or how/why it was burned or retired', null=True, blank=True)

I can make a pull request if you want it, just let me know.

chrismaddalena commented 5 years ago

Yep, that is the correct fix. Pull requests are always welcome :)