Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
[misp] Align all connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Sep 15, 2024
1 parent a4c5214 commit 9d26a16
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 24 deletions.
16 changes: 10 additions & 6 deletions external-import/flashpoint/src/mispfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,15 @@ def _process_attribute(
observable_resolver = resolved_attribute["resolver"]
observable_type = resolved_attribute["type"]
observable_value = resolved_attribute["value"]
name = resolved_attribute["value"]
name = (
resolved_attribute["value"]
if len(resolved_attribute["value"]) > 2
else (
attribute["comment"]
if len(attribute["comment"]) > 2
else observable_type
)
)
pattern_type = "stix"
pattern = None
# observable type is yara or sigma for instance
Expand All @@ -918,11 +926,7 @@ def _process_attribute(
name = (
attribute["comment"]
if len(attribute["comment"]) > 2
else (
observable_value
if len(observable_value) > 2
else observable_type
)
else observable_type
)
# observable type is not in stix 2
elif observable_resolver not in OPENCTISTIX2:
Expand Down
16 changes: 10 additions & 6 deletions external-import/misp-feed/src/misp-feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,15 @@ def _process_attribute(
observable_resolver = resolved_attribute["resolver"]
observable_type = resolved_attribute["type"]
observable_value = resolved_attribute["value"]
name = resolved_attribute["value"]
name = (
resolved_attribute["value"]
if len(resolved_attribute["value"]) > 2
else (
attribute["comment"]
if len(attribute["comment"]) > 2
else observable_type
)
)
pattern_type = "stix"
pattern = None
# observable type is yara or sigma for instance
Expand All @@ -1043,11 +1051,7 @@ def _process_attribute(
name = (
attribute["comment"]
if len(attribute["comment"]) > 2
else (
observable_value
if len(observable_value) > 2
else observable_type
)
else observable_type
)
# observable type is not in stix 2
elif observable_resolver not in OPENCTISTIX2:
Expand Down
16 changes: 10 additions & 6 deletions external-import/misp/src/misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,15 @@ def process_attribute(
observable_resolver = resolved_attribute["resolver"]
observable_type = resolved_attribute["type"]
observable_value = resolved_attribute["value"]
name = resolved_attribute["value"]
name = (
resolved_attribute["value"]
if len(resolved_attribute["value"]) > 2
else (
attribute["comment"]
if len(attribute["comment"]) > 2
else observable_type
)
)
pattern_type = "stix"
pattern = None
# observable type is yara or sigma for instance
Expand All @@ -1098,11 +1106,7 @@ def process_attribute(
name = (
attribute["comment"]
if len(attribute["comment"]) > 2
else (
observable_value
if len(observable_value) > 2
else observable_type
)
else observable_type
)
# observable type is not in stix 2
elif observable_resolver not in OPENCTISTIX2:
Expand Down
16 changes: 10 additions & 6 deletions internal-import-file/import-file-misp/src/import-file-misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,15 @@ def _process_attribute(
observable_resolver = resolved_attribute["resolver"]
observable_type = resolved_attribute["type"]
observable_value = resolved_attribute["value"]
name = resolved_attribute["value"]
name = (
resolved_attribute["value"]
if len(resolved_attribute["value"]) > 2
else (
attribute["comment"]
if len(attribute["comment"]) > 2
else observable_type
)
)
pattern_type = "stix"
pattern = None
# observable type is yara or sigma for instance
Expand All @@ -973,11 +981,7 @@ def _process_attribute(
name = (
attribute["comment"]
if len(attribute["comment"]) > 2
else (
observable_value
if len(observable_value) > 2
else observable_type
)
else observable_type
)
# observable type is not in stix 2
elif observable_resolver not in OPENCTISTIX2:
Expand Down

0 comments on commit 9d26a16

Please sign in to comment.