Example #1
0
    def __init__(self, username, *args, **kwargs):
        super(UploadCertificateForm, self).__init__(username, *args, **kwargs)
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #2
0
    def __init__(self, username, *args, **kwargs):
        super(UploadFileForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [(c.name,
                                          c.name) for c in get_source_names(True,
                                                                            True,
                                                                            username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['confidence'].choices = [('', ''),
                                             ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['backdoor'].choices = [('', '')]

        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        for (name, version) in get_backdoor_names(username):
            display = name
            value = name + '|||' + version
            if version:
                display += ' (Version: ' + version + ')'
            self.fields['backdoor'].choices.append((value, display))

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #3
0
    def __init__(self, username, *args, **kwargs):
        super(UploadPcapForm, self).__init__(*args, **kwargs)
        self.fields["source"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields["source"].initial = get_user_organization(username)

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #4
0
    def __init__(self, *args, **kwargs):
        super(AddCampaignForm, self).__init__(*args, **kwargs)
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #5
0
    def __init__(self, username, *args, **kwargs):
        super(UploadRawDataFileForm, self).__init__(*args, **kwargs)
        self.fields["source"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields["source"].initial = get_user_organization(username)
        self.fields["data_type"].choices = [(c.name, c.name) for c in get_item_names(RawDataType, True)]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #6
0
File: forms.py Project: ckane/crits
    def __init__(self, username, *args, **kwargs):
        super(UploadPcapForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #7
0
    def __init__(self, username, *args, **kwargs):
        super(UploadSignatureForm, self).__init__(username, *args, **kwargs)
        self.fields['data_type'].choices = [(c.name,
                                             c.name
                                             ) for c in get_item_names(SignatureType,
                                                                       True)]
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #8
0
File: forms.py Project: 0x3a/crits
    def __init__(self, username, *args, **kwargs):
        super(EventForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [(c.name,
                                          c.name) for c in get_source_names(True,
                                                                               True,
                                                                               username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['event_type'].choices = [(c.name,
                                              c.name) for c in get_item_names(EventType,
                                                                                 True)]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #9
0
File: forms.py Project: 0x3a/crits
    def __init__(self, *args, **kwargs):
        super(TargetInfoForm, self).__init__(*args, **kwargs)
        campaigns = [('', '')] + [(c.name,
                                   c.name) for c in get_item_names(Campaign,
                                                                   True)]
        self.fields['campaign'].choices = campaigns
        self.fields['camp_conf'].choices = [('',''),
                                            ('low', 'low'),
                                            ('medium', 'medium'),
                                            ('high', 'high')]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #10
0
    def __init__(self, username, *args, **kwargs):
        super(AddDomainForm, self).__init__(*args, **kwargs)
        self.fields['domain_source'].choices = self.fields['ip_source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['domain_source'].initial = get_user_organization(username)
        self.fields['ip_source'].initial = get_user_organization(username)
        self.fields['campaign'].choices = [('', '')] + [(c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['confidence'].choices = [('',''),
                                             ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #11
0
    def __init__(self, username, *args, **kwargs):
        super(EmailAttachForm, self).__init__(*args, **kwargs)
        self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['confidence'].choices = [('', ''),
                                             ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['source_date'].value = datetime.now()

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #12
0
 def __init__(self, username, *args, **kwargs):
     super(EmailYAMLForm, self).__init__(username, *args, **kwargs)
     self.fields['campaign'].choices = [("","")]
     if username.has_access_to(Common.CAMPAIGN_READ):
         self.fields['campaign'].choices = [('', '')] + [
             (c.name, c.name) for c in get_item_names(Campaign, True)]
     self.fields['campaign_confidence'].choices = [("", ""),
                                          ("low", "low"),
                                          ("medium", "medium"),
                                          ("high", "high")]
     self.fields['relationship_type'].choices = relationship_choices
     self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)
Example #13
0
    def __init__(self, username, *args, **kwargs):
        super(TargetInfoForm, self).__init__( *args, **kwargs)
        if username.has_access_to(Common.CAMPAIGN_READ):
            self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['camp_conf'].choices = [('',''),
                                            ('low', 'low'),
                                            ('medium', 'medium'),
                                            ('high', 'high')]
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #14
0
 def __init__(self, username, *args, **kwargs):
     super(EmailYAMLForm, self).__init__(*args, **kwargs)
     self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
     self.fields['source'].initial = get_user_organization(username)
     self.fields['campaign'].choices = [("","")]
     self.fields['campaign'].choices += [(c.name,
                                          c.name
                                          ) for c in get_item_names(Campaign,
                                                                    True)]
     self.fields['campaign_confidence'].choices = [("", ""),
                                          ("low", "low"),
                                          ("medium", "medium"),
                                          ("high", "high")]
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)
Example #15
0
    def __init__(self, username, choices, *args, **kwargs):
        super(AddIPForm, self).__init__(*args, **kwargs)

        if choices is None:
            self.fields["ip_type"].choices = ip_choices
        else:
            self.fields["ip_type"].choices = choices

        self.fields["campaign"].choices = [("", "")] + [(c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields["confidence"].choices = [("", ""), ("low", "low"), ("medium", "medium"), ("high", "high")]
        self.fields["source"].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields["source"].initial = get_user_organization(username)
        self.fields["analyst"].initial = username

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #16
0
    def __init__(self, username, *args, **kwargs):
        super(UploadIndicatorForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['status'].choices = [
            (c,c) for c in Status.values()
        ]
        self.fields['indicator_type'].choices = [
            (c,c) for c in IndicatorTypes.values(sort=True)
        ]
        self.fields['threat_type'].choices = [
            (c,c) for c in IndicatorThreatTypes.values(sort=True)
        ]
        self.fields['threat_type'].initial = IndicatorThreatTypes.UNKNOWN
        self.fields['attack_type'].choices = [
            (c,c) for c in IndicatorAttackTypes.values(sort=True)
        ]
        self.fields['attack_type'].initial = IndicatorAttackTypes.UNKNOWN
        self.fields['indicator_type'].widget.attrs = {'class': 'object-types'}
        self.fields['campaign'].choices = [("", "")]
        self.fields['campaign'].choices += [
            (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['campaign_confidence'].choices = [
            ("", ""),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]
        self.fields['confidence'].choices = [
            ("unknown", "unknown"),
            ("benign", "benign"),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]
        self.fields['impact'].choices = [
            ("unknown", "unknown"),
            ("benign", "benign"),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]

        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #17
0
File: forms.py Project: ckane/crits
    def __init__(self, username, *args, **kwargs):
        super(AddBackdoorForm, self).__init__(*args, **kwargs)

        self.fields['campaign'].choices = [('', '')] + [
            (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['confidence'].choices = [
            ('', ''),
            ('low', 'low'),
            ('medium', 'medium'),
            ('high', 'high')]
        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #18
0
    def __init__(self, username, *args, **kwargs):
        super(AddDomainForm, self).__init__(*args, **kwargs)
        self.fields['domain_source'].choices = self.fields[
            'ip_source'].choices = [
                (c.name, c.name)
                for c in get_source_names(True, True, username)
            ]
        self.fields['domain_source'].initial = get_user_organization(username)
        self.fields['ip_source'].initial = get_user_organization(username)
        self.fields['campaign'].choices = [('', '')] + [
            (c.name, c.name) for c in get_item_names(Campaign, True)
        ]
        self.fields['confidence'].choices = [('', ''), ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #19
0
    def __init__(self, user, *args, **kwargs):
        super(UploadIndicatorForm, self).__init__(user, *args, **kwargs)
        self.fields['status'].choices = [
            (c,c) for c in Status.values()
        ]
        self.fields['indicator_type'].choices = [
            (c,c) for c in IndicatorTypes.values(sort=True)
        ]
        self.fields['threat_type'].choices = [
            (c,c) for c in IndicatorThreatTypes.values(sort=True)
        ]
        self.fields['threat_type'].initial = IndicatorThreatTypes.UNKNOWN
        self.fields['attack_type'].choices = [
            (c,c) for c in IndicatorAttackTypes.values(sort=True)
        ]
        self.fields['attack_type'].initial = IndicatorAttackTypes.UNKNOWN
        self.fields['indicator_type'].widget.attrs = {'class': 'object-types'}
        if user.has_access_to(Common.CAMPAIGN_READ):
            self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]

        self.fields['campaign_confidence'].choices = [
            ("", ""),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]
        self.fields['confidence'].choices = [
            ("unknown", "unknown"),
            ("benign", "benign"),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]
        self.fields['impact'].choices = [
            ("unknown", "unknown"),
            ("benign", "benign"),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]

        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #20
0
    def __init__(self, username, *args, **kwargs):
        super(EmailOutlookForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)
        ]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['campaign'].choices = [("", "")]
        self.fields['campaign'].choices += [
            (c.name, c.name) for c in get_item_names(Campaign, True)
        ]
        self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"),
                                                      ("medium", "medium"),
                                                      ("high", "high")]

        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #21
0
    def __init__(self, username, *args, **kwargs):
        super(AddActorForm, self).__init__(*args, **kwargs)

        self.fields['campaign'].choices = [('', '')] + [
            (c.name, c.name) for c in get_item_names(Campaign, True)
        ]
        self.fields['confidence'].choices = [('', ''), ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)
        ]
        self.fields['source'].initial = get_user_organization(username)

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #22
0
    def __init__(self, username, choices=None, *args, **kwargs):
        super(UploadIndicatorForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)
        ]
        self.fields['source'].initial = get_user_organization(username)
        if not choices:
            #only valid types for indicators are those which don't require file upload
            choices = [(c[0], c[0], {
                'datatype': c[1].keys()[0],
                'datatype_value': c[1].values()[0]
            }) for c in get_object_types(active=True,
                                         query={
                                             'datatype.file': {
                                                 '$exists': 0
                                             },
                                             'datatype.enum': {
                                                 '$exists': 0
                                             }
                                         })]

        self.fields['indicator_type'].choices = choices
        self.fields['indicator_type'].widget.attrs = {'class': 'object-types'}
        self.fields['campaign'].choices = [("", "")]
        self.fields['campaign'].choices += [
            (c.name, c.name) for c in get_item_names(Campaign, True)
        ]
        self.fields['campaign_confidence'].choices = [("", ""), ("low", "low"),
                                                      ("medium", "medium"),
                                                      ("high", "high")]
        self.fields['confidence'].choices = [("unknown", "unknown"),
                                             ("benign", "benign"),
                                             ("low", "low"),
                                             ("medium", "medium"),
                                             ("high", "high")]
        self.fields['impact'].choices = [("unknown", "unknown"),
                                         ("benign", "benign"), ("low", "low"),
                                         ("medium", "medium"),
                                         ("high", "high")]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #23
0
    def __init__(self, username, choices, *args, **kwargs):
        super(AddIPForm, self).__init__(*args, **kwargs)

        if choices is None:
            self.fields['ip_type'].choices = ip_choices
        else:
            self.fields['ip_type'].choices = choices

        self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['confidence'].choices = [('', ''),
                                             ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['analyst'].initial = username

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #24
0
    def __init__(self, username, choices, *args, **kwargs):
        super(AddIPForm, self).__init__(*args, **kwargs)

        if choices is None:
            self.fields['ip_type'].choices = ip_choices
        else:
            self.fields['ip_type'].choices = choices

        self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['confidence'].choices = [('', ''),
                                             ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['analyst'].initial = username

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
    def __init__(self, username, *args, **kwargs):
        super(EventForm, self).__init__(username, *args, **kwargs)

        self.fields['event_type'].choices = [
            (c,c) for c in EventTypes.values(sort=True)
        ]
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO
        self.fields['campaign'].choices = [("", "")]
        if username.has_access_to(Common.CAMPAIGN_READ):
            self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['campaign_confidence'].choices = [
            ("", ""),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #26
0
    def __init__(self, username, choices, *args, **kwargs):
        super(AddIPForm, self).__init__(username, *args, **kwargs)

        if choices is None:
            self.fields['ip_type'].choices = ip_choices
        else:
            self.fields['ip_type'].choices = choices

        if username.has_access_to(Common.CAMPAIGN_READ):
            self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)
            ]
        self.fields['confidence'].choices = [('', ''), ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]

        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #27
0
    def __init__(self, username, *args, **kwargs):
        super(UploadIndicatorForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['indicator_type'].choices = [
            (c,c) for c in IndicatorTypes.values(sort=True)
        ]
        self.fields['threat_type'].choices = [
            (c,c) for c in IndicatorThreatTypes.values(sort=True)
        ]
        self.fields['threat_type'].initial = IndicatorThreatTypes.UNKNOWN
        self.fields['attack_type'].choices = [
            (c,c) for c in IndicatorAttackTypes.values(sort=True)
        ]
        self.fields['attack_type'].initial = IndicatorAttackTypes.UNKNOWN
        self.fields['indicator_type'].widget.attrs = {'class': 'object-types'}
        self.fields['campaign'].choices = [("", "")]
        self.fields['campaign'].choices += [
            (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['campaign_confidence'].choices = [
            ("", ""),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]
        self.fields['confidence'].choices = [
            ("unknown", "unknown"),
            ("benign", "benign"),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]
        self.fields['impact'].choices = [
            ("unknown", "unknown"),
            ("benign", "benign"),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #28
0
    def __init__(self, username, choices=None, *args, **kwargs):
        super(UploadIndicatorForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [(c.name,
                                          c.name) for c in get_source_names(True,
                                                                               True,
                                                                               username)]
        self.fields['source'].initial = get_user_organization(username)
        if not choices:
            #only valid types for indicators are those which don't require file upload
            choices = [(c[0],
                             c[0],
                             {'datatype':c[1].keys()[0],
                              'datatype_value':c[1].values()[0]}
                             ) for c in get_object_types(active=True,
                                                         query={'datatype.file':{'$exists':0}})]

        self.fields['indicator_type'].choices = choices
        self.fields['indicator_type'].widget.attrs = {'class':'object-types'}
        self.fields['campaign'].choices = [("","")]
        self.fields['campaign'].choices += [(c.name,
                                             c.name
                                             ) for c in get_item_names(Campaign,
                                                                       True)]
        self.fields['campaign_confidence'].choices = [("", ""),
                                             ("low", "low"),
                                             ("medium", "medium"),
                                             ("high", "high")]
        self.fields['confidence'].choices = [("unknown", "unknown"),
                                             ("benign", "benign"),
                                             ("low", "low"),
                                             ("medium", "medium"),
                                             ("high", "high")]
        self.fields['impact'].choices = [("unknown", "unknown"),
                                             ("benign", "benign"),
                                             ("low", "low"),
                                             ("medium", "medium"),
                                             ("high", "high")]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #29
0
    def __init__(self, username, *args, **kwargs):
        super(UploadFileForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [
            (c.name, c.name) for c in get_source_names(True, True, username)
        ]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['campaign'].choices = [('', '')] + [
            (c.name, c.name) for c in get_item_names(Campaign, True)
        ]
        self.fields['confidence'].choices = [('', ''), ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['backdoor'].choices = [('', '')]
        for (name, version) in get_backdoor_names(username):
            display = name
            value = name + '|||' + version
            if version:
                display += ' (Version: ' + version + ')'
            self.fields['backdoor'].choices.append((value, display))

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
    def __init__(self, username, *args, **kwargs):
        super(UploadFileForm, self).__init__(username, *args, **kwargs)
        if username.has_access_to(Common.CAMPAIGN_READ):
            self.fields['campaign'].choices = [('', '')] + [
                (c.name, c.name) for c in get_item_names(Campaign, True)
            ]
        self.fields['confidence'].choices = [('', ''), ('low', 'low'),
                                             ('medium', 'medium'),
                                             ('high', 'high')]
        self.fields['backdoor'].choices = [('', '')]

        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO

        for (name, version) in get_backdoor_names(username):
            display = name
            value = name + '|||' + version
            if version:
                display += ' (Version: ' + version + ')'
            self.fields['backdoor'].choices.append((value, display))

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
Example #31
0
    def __init__(self, username, *args, **kwargs):
        super(EventForm, self).__init__(*args, **kwargs)
        self.fields['source'].choices = [(c.name,
                                          c.name) for c in get_source_names(True,
                                                                               True,
                                                                               username)]
        self.fields['source'].initial = get_user_organization(username)
        self.fields['event_type'].choices = [
            (c,c) for c in EventTypes.values(sort=True)
        ]
        self.fields['relationship_type'].choices = relationship_choices
        self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO
        self.fields['campaign'].choices = [("", "")]
        self.fields['campaign'].choices += [
            (c.name, c.name) for c in get_item_names(Campaign, True)]
        self.fields['campaign_confidence'].choices = [
            ("", ""),
            ("low", "low"),
            ("medium", "medium"),
            ("high", "high")]

        add_bucketlist_to_form(self)
        add_ticket_to_form(self)
 def __init__(self, username, *args, **kwargs):
     super(UploadPcapForm, self).__init__(username, *args, **kwargs)
     self.fields['relationship_type'].choices = relationship_choices
     self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)
Example #33
0
 def __init__(self, *args, **kwargs):
     super(TargetInfoForm, self).__init__(*args, **kwargs)
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)
Example #34
0
 def __init__(self, *args, **kwargs):
     super(AddCampaignForm, self).__init__(*args, **kwargs)
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)
Example #35
0
 def __init__(self, *args, **kwargs):
     super(AddCampaignForm, self).__init__(*args, **kwargs)
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)
Example #36
0
 def __init__(self, *args, **kwargs):
     super(TargetInfoForm, self).__init__(*args, **kwargs)
     add_bucketlist_to_form(self)
     add_ticket_to_form(self)