Skip to content

Commit

Permalink
Merge branch 'parser_feature' of github.com:MISP/misp-stix into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisr3d committed Oct 10, 2024
2 parents d3ca8e9 + 6743ad7 commit c34418a
Show file tree
Hide file tree
Showing 36 changed files with 3,205 additions and 874 deletions.
29 changes: 22 additions & 7 deletions misp_stix_converter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
from .misp2stix import stix20_framing, stix21_framing # noqa
# Helpers
from .misp_stix_converter import ( # noqa
_from_misp, misp_attribute_collection_to_stix1, misp_collection_to_stix2,
_is_stix1_from_misp, _is_stix2_from_misp,
misp_attribute_collection_to_stix1, misp_collection_to_stix2,
misp_event_collection_to_stix1, misp_to_stix1, misp_to_stix2,
stix_1_to_misp, stix_2_to_misp, stix2_to_misp_instance)
# STIX 1 special helpers
from .misp_stix_converter import ( # noqa
_get_campaigns, _get_courses_of_action, _get_events, _get_indicators,
_get_observables, _get_threat_actors, _get_ttps, _from_misp)
_get_observables, _get_threat_actors, _get_ttps)
# STIX 1 footers
from .misp_stix_converter import ( # noqa
_get_campaigns_footer, _get_courses_of_action_footer, _get_indicators_footer,
Expand Down Expand Up @@ -110,8 +111,7 @@ def main():

# IMPORT SUBPARSER
import_parser = subparsers.add_parser(
'import', help='Import STIX to MISP - try '
'`misp_stix_converter import -h` for more help.'
'import', help='Import STIX to MISP - try `misp_stix_converter import -h` for more help.'
)
import_parser.add_argument(
'-f', '--file', nargs='+', type=Path, required=True,
Expand All @@ -138,7 +138,14 @@ def main():
)
import_parser.add_argument(
'-d', '--distribution', type=int, default=0, choices=[0, 1, 2, 3, 4],
help='Distribution level for the imported MISP content - default is 0'
help='''
Distribution level for the imported MISP content (default is 0)
- 0: Your organisation only
- 1: This community only
- 2: Connected communities
- 3: All communities
- 4: Sharing Group
'''
)
import_parser.add_argument(
'-sg', '--sharing_group', type=int, default=None,
Expand All @@ -153,15 +160,23 @@ def main():
)
import_parser.add_argument(
'-cd', '--cluster_distribution', type=int, default=0, choices=[0, 1, 2, 3, 4],
help='Galaxy Clusters distribution level in case of External STIX 2 content - default id 0'
help='''
Galaxy Clusters distribution level
in case of External STIX 2 content (default id 0)
- 0: Your organisation only
- 1: This community only
- 2: Connected communities
- 3: All communities
- 4: Sharing Group
'''
)
import_parser.add_argument(
'-cg', '--cluster_sharing_group', type=int, default=None,
help='Galaxy Clusters sharing group ID in case of External STIX 2 content.'
)
import_parser.add_argument(
'-t', '--title', type=str, default=None,
help='Title prefix to add to the MISP Event `info` field.'
help='Title used to set the MISP Event `info` field.'
)
import_parser.add_argument(
'-p', '--producer',
Expand Down
Loading

0 comments on commit c34418a

Please sign in to comment.