Skip to content

Commit

Permalink
Merge pull request #12 from stmtstk/feature_taxii_community
Browse files Browse the repository at this point in the history
Enable to specify the TAXII 1.1 Server Poll STIX Files via Community.
  • Loading branch information
stmtstk authored Feb 5, 2021
2 parents 1a2c4c8 + 4556c49 commit ba2e046
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
django.setup()

from ctirs.core.mongo.documents_stix import StixFiles
from ctirs.core.mongo.documents import TaxiiServers, InformationSources, Vias, Communities
from ctirs.core.mongo.documents import TaxiiServers, Vias, Communities
import yaml
import datetime
import dateutil.tz
Expand All @@ -28,8 +28,6 @@
from stix.extensions.marking.ais import AISMarkingStructure




class StipTaxiiServerAPI(OpenTAXIIPersistenceAPI):
STIP_SNS_USER_NAME_PREFIX = 'User Name: '

Expand Down Expand Up @@ -152,7 +150,7 @@ def get_stix_files_from_mongo(self, collection_name, start_time, end_time):
ts = TaxiiServers.objects.get(collection_name=collection_name)

# 条件絞り込み
QQ = Q(information_source__in=ts.information_sources)
QQ = Q(input_community__in=ts.communities)
QQ = QQ & Q (version__startswith='1.')
if start_time is not None and end_time is not None:
QQ = QQ & Q(produced__gt=start_time)
Expand Down

0 comments on commit ba2e046

Please sign in to comment.