def __init__(self, *args, **kwargs): super(CampaignForm, self).__init__(*args, **kwargs) self.fields['confidence'].choices = [('low', 'low'), ('medium', 'medium'), ('high', 'high')] self.fields['name'].choices = [(c.name, c.name) for c in get_item_names(Campaign, True)]
def __init__(self, username, *args, **kwargs): super(AddDomainForm, self).__init__(username, *args, **kwargs) self.fields['ip_source'].choices = [ (c.name, c.name) for c in get_source_names(True, True, username) ] self.fields['ip_source'].initial = get_user_organization(username) self.fields['ip_tlp'].choices = [ (t, t) for t in ('red', 'amber', 'green', 'white') ] self.fields['ip_tlp'].initial = 'red' 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['ip_type'].choices = ip_choices self.fields['ip_type'].initial = IPTypes.IPV4_ADDRESS 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)
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)
def __init__(self, *args, **kwargs): super(SourceAccessForm, self).__init__(*args, **kwargs) self.fields['roles'].choices = [(c.name, c.name) for c in get_item_names(Role, True)] self.fields['organization'].choices = [ (c.name, c.name) for c in get_source_names(True, False, None) ]
def __init__(self, username, *args, **kwargs): super(AddActorIdentifierForm, self).__init__(username, *args, **kwargs) self.fields['identifier_type'].choices = [ (c.name, c.name) for c in get_item_names(ActorThreatIdentifier, True) ]
def __init__(self, username, *args, **kwargs): super(UploadRawDataForm, 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)
def __init__(self, *args, **kwargs): super(AddLocationForm, self).__init__(*args, **kwargs) self.fields['location_type'].choices = [ ('Originated From', 'Originated From'), ('Destined For', 'Destined For'), ] self.fields['country'].choices = [ (c.name, c.name) for c in get_item_names(Location, True)]
def __init__(self, username, *args, **kwargs): super(AddActorIdentifierForm, self).__init__(*args, **kwargs) self.fields['identifier_type'].choices = [ (c.name, c.name) for c in get_item_names(ActorThreatIdentifier, True)] 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)
def __init__(self, *args, **kwargs): super(AddLocationForm, self).__init__(*args, **kwargs) self.fields['location_type'].choices = [ ('Originated From', 'Originated From'), ('Destined For', 'Destined For'), ] self.fields['country'].choices = [ (c.name, c.name) for c in get_item_names(Location, True) ]
def __init__(self, *args, **kwargs): super(SourceAccessForm, self).__init__(*args, **kwargs) self.fields['roles'].choices = [(c.name, c.name) for c in get_item_names(Role, True)] self.fields['organization'].choices = [(c.name, c.name) for c in get_source_names(True, False, None)]
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)
def __init__(self, username, *args, **kwargs): super(AddActorIdentifierForm, self).__init__(*args, **kwargs) self.fields['identifier_type'].choices = [ (c.name, c.name) for c in get_item_names(ActorThreatIdentifier, True) ] 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)
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)
def __init__(self, username, *args, **kwargs): super(UploadRawDataForm, 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)
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)
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")]
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)
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")]
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)
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['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)
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)
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)
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)
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)
def __init__(self, user, *args, **kwargs): super(EmailYAMLForm, self).__init__(user, *args, **kwargs) self.fields['campaign'].choices = [("", "")] 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['relationship_type'].choices = relationship_choices self.fields['relationship_type'].initial = RelationshipTypes.RELATED_TO add_bucketlist_to_form(self) add_ticket_to_form(self)
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(UploadRawDataForm, 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)] 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)
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")] 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)
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")] 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)
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)
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)
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)
def get_raw_data_type_dropdown(request): """ Generate RawData datetypes dropdown information. Should be an AJAX POST. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :returns: :class:`django.http.HttpResponse` """ if request.method == "POST" and request.is_ajax(): dt_types = get_item_names(RawDataType) dt_final = [] for dt in dt_types: dt_final.append(dt.name) result = {"data": dt_final} return HttpResponse(json.dumps(result), content_type="application/json") else: error = "Expected AJAX POST" return render_to_response("error.html", {"error": error}, RequestContext(request))
def get_signature_dependency_dropdown(request): """ Generate Signature dependency dropdown information. Should be an AJAX POST. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :returns: :class:`django.http.HttpResponse` """ if request.method == 'POST' and request.is_ajax(): dt_deps = get_item_names(SignatureDependency) dt_final = [] for dt in dt_deps: dt_final.append(dt.name) result = {'data': dt_final} return HttpResponse(json.dumps(result), content_type="application/json") else: error = "Expected AJAX POST" return render(request, "error.html", {'error': error})
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)
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 get_raw_data_type_dropdown(request): """ Generate RawData datetypes dropdown information. Should be an AJAX POST. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :returns: :class:`django.http.HttpResponse` """ if request.method == 'POST' and request.is_ajax(): dt_types = get_item_names(RawDataType) dt_final = [] for dt in dt_types: dt_final.append(dt.name) result = {'data': dt_final} return HttpResponse(json.dumps(result), mimetype="application/json") else: error = "Expected AJAX POST" return render_to_response("error.html", {'error': error}, RequestContext(request))
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)
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)
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')] self.fields['ip_type'].choices = ip_choices self.fields['ip_type'].initial = IPTypes.IPV4_ADDRESS 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)
def __init__(self, *args, **kwargs): super(RoleCombinePreview, self).__init__(*args, **kwargs) self.fields['roles'].choices = [(c.name, c.name) for c in get_item_names(Role, True)]
def __init__(self, *args, **kwargs): super(ExploitForm, self).__init__(*args, **kwargs) self.fields['exploit'].choices = [(c.name, c.name ) for c in get_item_names(Exploit, True)]
def get_campaign_names_list(active): listing = get_item_names(Campaign, bool(active)) return [c.name for c in listing]
def __init__(self, *args, **kwargs): super(BackdoorForm, self).__init__(*args, **kwargs) self.fields['backdoor_types'].choices = [ (c.name, c.name) for c in get_item_names(Backdoor, True) ]
def __init__(self, *args, **kwargs): super(ExploitForm, self).__init__(*args, **kwargs) self.fields['exploit'].choices = [ (c.name, c.name) for c in get_item_names(Exploit, True) ]
def __init__(self, *args, **kwargs): super(BackdoorForm, self).__init__(*args, **kwargs) self.fields['backdoor_types'].choices = [(c.name, c.name ) for c in get_item_names(Backdoor, True)]
def __init__(self, *args, **kwargs): super(IndicatorActionsForm, self).__init__(*args, **kwargs) self.fields['action_type'].choices = [ (c.name, c.name) for c in get_item_names(IndicatorAction, True) ]
def get_location_names_list(active): listing = get_item_names(Location, bool(active)) return [c.name for c in listing]
def __init__(self, *args, **kwargs): super(IndicatorActionsForm, self).__init__(*args, **kwargs) self.fields['action_type'].choices = [(c.name, c.name ) for c in get_item_names(IndicatorAction, True)]