Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DetectionTestingManagerOutputDto:
start_time: Union[datetime.datetime, None] = None
replay_index: str = "contentctl_testing_index"
replay_host: str = "CONTENTCTL_HOST"
timeout_seconds: int = 60
timeout_seconds: int = 120
terminate: bool = False


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,30 @@ def get_summary(
# Return the summary

return summary_dict

@model_validator(mode="after")
def validate_data_source_output_fields(self):
# Skip validation for Hunting and Correlation types, or non-production detections
if self.status != DetectionStatus.production or self.type in {
AnalyticsType.Hunting,
AnalyticsType.Correlation,
}:
return self

# Validate that all required output fields are present in the search
for data_source in self.data_source_objects:
if not data_source.output_fields:
continue

missing_fields = [
field for field in data_source.output_fields if field not in self.search
]

if missing_fields:
raise ValueError(
f"Data source '{data_source.name}' has output fields "
f"{missing_fields} that are not present in the search "
f"for detection '{self.name}'"
)

return self
Loading