From a6272b6d1406c95d77f490b3300bf21cdafa9461 Mon Sep 17 00:00:00 2001 From: Adam Polkosnik Date: Wed, 2 Sep 2015 17:08:57 -0400 Subject: [PATCH] Changes to make the services work with django 1.8. --- OPSWAT_Service/forms.py | 1 + chopshop_service/forms.py | 3 +++ clamd_service/forms.py | 1 + cuckoo_service/forms.py | 2 ++ farsight_service/forms.py | 1 + metacap_service/forms.py | 2 ++ opendns_service/forms.py | 1 + passivetotal_service/forms.py | 1 + pyew/forms.py | 1 + shodan_service/forms.py | 1 + taxii_service/forms.py | 3 +++ threatgrid_service/forms.py | 2 ++ threatrecon_service/forms.py | 1 + totalhash_service/forms.py | 1 + upx_service/forms.py | 1 + virustotal_service/forms.py | 2 ++ whois_service/forms.py | 2 ++ yara_service/forms.py | 2 ++ 18 files changed, 28 insertions(+) diff --git a/OPSWAT_Service/forms.py b/OPSWAT_Service/forms.py index 54c323e5..4eac4dc3 100644 --- a/OPSWAT_Service/forms.py +++ b/OPSWAT_Service/forms.py @@ -15,4 +15,5 @@ class OPSWATConfigForm(forms.Form): help_text="Use proxy for connecting to OPSWAT service") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(OPSWATConfigForm, self).__init__(*args, **kwargs) diff --git a/chopshop_service/forms.py b/chopshop_service/forms.py index f219cbe4..338eb4c4 100755 --- a/chopshop_service/forms.py +++ b/chopshop_service/forms.py @@ -22,6 +22,7 @@ class FileCarverForm(forms.Form): help_text="Carve raw TCP (one per side).") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(FileCarverForm, self).__init__(*args, **kwargs) class ChopShopConfigForm(forms.Form): @@ -33,6 +34,7 @@ class ChopShopConfigForm(forms.Form): help_text="The base directory where all the modules and libraries exist.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(ChopShopConfigForm, self).__init__(*args, **kwargs) class ChopShopRunForm(forms.Form): @@ -47,4 +49,5 @@ class ChopShopRunForm(forms.Form): help_text="Generate metadata for these protocols.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(ChopShopRunForm, self).__init__(*args, **kwargs) diff --git a/clamd_service/forms.py b/clamd_service/forms.py index 9563ee37..8f050e3a 100644 --- a/clamd_service/forms.py +++ b/clamd_service/forms.py @@ -23,4 +23,5 @@ class clamdServiceConfigForm(forms.Form): initial=False) def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(clamdServiceConfigForm, self).__init__(*args, **kwargs) diff --git a/cuckoo_service/forms.py b/cuckoo_service/forms.py index 72436693..48e075f0 100644 --- a/cuckoo_service/forms.py +++ b/cuckoo_service/forms.py @@ -55,6 +55,7 @@ class CuckooConfigForm(forms.Form): "period.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(CuckooConfigForm, self).__init__(*args, **kwargs) class CuckooRunForm(forms.Form): @@ -102,6 +103,7 @@ class CuckooRunForm(forms.Form): "automatically resubmitted.") def __init__(self, machines=[], *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(CuckooRunForm, self).__init__(*args, **kwargs) self.fields['machine'].choices = machines diff --git a/farsight_service/forms.py b/farsight_service/forms.py index 6a4c0125..720c1174 100644 --- a/farsight_service/forms.py +++ b/farsight_service/forms.py @@ -15,4 +15,5 @@ class FarsightConfigForm(forms.Form): initial='https://api.dnsdb.info') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(FarsightConfigForm, self).__init__(*args, **kwargs) diff --git a/metacap_service/forms.py b/metacap_service/forms.py index 7ae012db..db129262 100755 --- a/metacap_service/forms.py +++ b/metacap_service/forms.py @@ -27,6 +27,7 @@ class TCPDumpForm(forms.Form): help_text="Save resulting PCAP to the database.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(TCPDumpForm, self).__init__(*args, **kwargs) self.fields['timestamp'].choices = [("", ""), ("-t", "(-t) Don't print"), @@ -65,4 +66,5 @@ class MetaCapConfigForm(forms.Form): initial='') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(MetaCapConfigForm, self).__init__(*args, **kwargs) diff --git a/opendns_service/forms.py b/opendns_service/forms.py index 57768d9b..206f9ab8 100644 --- a/opendns_service/forms.py +++ b/opendns_service/forms.py @@ -14,4 +14,5 @@ class OpenDNSConfigForm(forms.Form): initial='https://investigate.api.opendns.com/') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(OpenDNSConfigForm, self).__init__(*args, **kwargs) diff --git a/passivetotal_service/forms.py b/passivetotal_service/forms.py index 457202fb..7795ac5d 100644 --- a/passivetotal_service/forms.py +++ b/passivetotal_service/forms.py @@ -14,4 +14,5 @@ class PassiveTotalConfigForm(forms.Form): initial='https://www.passivetotal.org/api/v1') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(PassiveTotalConfigForm, self).__init__(*args, **kwargs) diff --git a/pyew/forms.py b/pyew/forms.py index e133485e..e9684f97 100644 --- a/pyew/forms.py +++ b/pyew/forms.py @@ -17,4 +17,5 @@ class pyewConfigForm(forms.Form): help_text="Use secure websockets.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(pyewConfigForm, self).__init__(*args, **kwargs) diff --git a/shodan_service/forms.py b/shodan_service/forms.py index c5ddafdf..6a604b4e 100644 --- a/shodan_service/forms.py +++ b/shodan_service/forms.py @@ -11,4 +11,5 @@ class ShodanConfigForm(forms.Form): initial='') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(ShodanConfigForm, self).__init__(*args, **kwargs) diff --git a/taxii_service/forms.py b/taxii_service/forms.py index 6e61a9ea..01c9ca0e 100755 --- a/taxii_service/forms.py +++ b/taxii_service/forms.py @@ -24,6 +24,7 @@ def __init__(self, username, item, *args, **kwargs): The way the form fields are populated ensures that only STIXifyable / CybOXable options are provided. """ + kwargs.setdefault('label_suffix', ':') super(TAXIIForm, self).__init__(*args, **kwargs) sc = get_config('taxii_service') @@ -140,6 +141,7 @@ class TAXIIServiceConfigForm(forms.Form): " source.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(TAXIIServiceConfigForm, self).__init__(*args, **kwargs) @@ -156,6 +158,7 @@ class UploadStandardsForm(forms.Form): make_event = forms.BooleanField(required=False, label="Create event", initial=True) def __init__(self, username, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(UploadStandardsForm, self).__init__(*args, **kwargs) self.fields['source'].choices = [(c.name, c.name) for c in get_source_names(True, diff --git a/threatgrid_service/forms.py b/threatgrid_service/forms.py index b4cc7066..8df54f2b 100644 --- a/threatgrid_service/forms.py +++ b/threatgrid_service/forms.py @@ -17,6 +17,7 @@ class ThreatGRIDConfigForm(forms.Form): initial=False, help_text="Automatically submit samples during triage.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(ThreatGRIDConfigForm, self).__init__(*args, **kwargs) class ThreatGRIDRunForm(forms.Form): @@ -28,4 +29,5 @@ class ThreatGRIDRunForm(forms.Form): initial=True) def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(ThreatGRIDRunForm, self).__init__(*args, **kwargs) diff --git a/threatrecon_service/forms.py b/threatrecon_service/forms.py index 65d2e9fc..b87c7ae6 100644 --- a/threatrecon_service/forms.py +++ b/threatrecon_service/forms.py @@ -14,4 +14,5 @@ class ThreatreconConfigForm(forms.Form): initial='https://api.threatrecon.co/api/v1/search') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(ThreatreconConfigForm, self).__init__(*args, **kwargs) diff --git a/totalhash_service/forms.py b/totalhash_service/forms.py index fd6c3924..7b74f515 100644 --- a/totalhash_service/forms.py +++ b/totalhash_service/forms.py @@ -18,4 +18,5 @@ class TotalHashConfigForm(forms.Form): initial='https://api.totalhash.com/') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(TotalHashConfigForm, self).__init__(*args, **kwargs) diff --git a/upx_service/forms.py b/upx_service/forms.py index a533247d..9788aa19 100644 --- a/upx_service/forms.py +++ b/upx_service/forms.py @@ -10,4 +10,5 @@ class UPXConfigForm(forms.Form): help_text="Full path to UPX binary.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(UPXConfigForm, self).__init__(*args, **kwargs) diff --git a/virustotal_service/forms.py b/virustotal_service/forms.py index 7e359544..0dbdb7cb 100644 --- a/virustotal_service/forms.py +++ b/virustotal_service/forms.py @@ -31,6 +31,7 @@ class VirusTotalConfigForm(forms.Form): def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(VirusTotalConfigForm, self).__init__(*args, **kwargs) class VirusTotalRunForm(forms.Form): @@ -46,4 +47,5 @@ class VirusTotalRunForm(forms.Form): help_text="Add Domains") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(VirusTotalRunForm, self).__init__(*args, **kwargs) diff --git a/whois_service/forms.py b/whois_service/forms.py index 4bf7b9d2..33b8d103 100644 --- a/whois_service/forms.py +++ b/whois_service/forms.py @@ -20,6 +20,7 @@ class WHOISConfigForm(forms.Form): initial='') def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(WHOISConfigForm, self).__init__(*args, **kwargs) class WHOISRunForm(forms.Form): @@ -30,6 +31,7 @@ class WHOISRunForm(forms.Form): help_text="Perform a live query.") def __init__(self, pydat_url=None, dt_api_key=None, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(WHOISRunForm, self).__init__(*args, **kwargs) # If pyDat or DomainTools are configured, add a checkbox and diff --git a/yara_service/forms.py b/yara_service/forms.py index 4019156b..07a0b7e4 100644 --- a/yara_service/forms.py +++ b/yara_service/forms.py @@ -32,6 +32,7 @@ class YaraConfigForm(forms.Form): help_text="Distribution routing key. Leave blank if not distributed.") def __init__(self, *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(YaraConfigForm, self).__init__(*args, **kwargs) class YaraRunForm(forms.Form): @@ -43,6 +44,7 @@ class YaraRunForm(forms.Form): help_text="Signature files to use.") def __init__(self, sigfiles=[], api_keys=[], *args, **kwargs): + kwargs.setdefault('label_suffix', ':') super(YaraRunForm, self).__init__(*args, **kwargs) self.fields['sigfiles'].choices = sigfiles