Skip to content

Commit

Permalink
Revert dfiq to main version
Browse files Browse the repository at this point in the history
  • Loading branch information
udgover committed Sep 18, 2024
1 parent 1c221ba commit 1169561
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/schemas/dfiq.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from core.config.config import yeti_config
from core.helpers import now
from core.schemas import indicator
from core.schemas.indicators import forensicartifact, query
from core.schemas.model import YetiModel

LATEST_SUPPORTED_DFIQ_VERSION = "1.1.0"
Expand Down Expand Up @@ -99,7 +98,7 @@ def extract_indicators(question: "DFIQQuestion") -> None:
continue

if step.type in ("ForensicArtifact", "artifact"):
artifact = forensicartifact.ForensicArtifact.find(name=step.value)
artifact = indicator.ForensicArtifact.find(name=step.value)
if not artifact:
logging.warning(
"Missing artifact %s in %s", step.value, question.dfiq_id
Expand All @@ -109,9 +108,9 @@ def extract_indicators(question: "DFIQQuestion") -> None:
continue

elif step.type and step.value and "query" in step.type:
query_indicator = query.Query.find(pattern=step.value)
if not query_indicator:
query_indicator = query.Query(
query = indicator.Query.find(pattern=step.value)
if not query:
query = indicator.Query(
name=f"{step.name} ({step.type})",
description=step.description or "",
pattern=step.value,
Expand All @@ -120,7 +119,7 @@ def extract_indicators(question: "DFIQQuestion") -> None:
location=step.type,
diamond=indicator.DiamondModel.victim,
).save()
question.link_to(query_indicator, "query", "Uses query")
question.link_to(query, "query", "Uses query")

else:
logging.warning(
Expand Down

0 comments on commit 1169561

Please sign in to comment.