Skip to content

Commit 753b3b0

Browse files
authored
Merge branch 'contentctl_5' into obs_to_rba
2 parents b4848be + d98b493 commit 753b3b0

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

contentctl/objects/abstract_security_content_objects/detection_abstract.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ def ensureProperRBAConfig(self):
811811
"Detection expects an RBA config with at least one risk object."
812812
)
813813

814+
814815
# TODO - Remove old observable code
815816
# @model_validator(mode="after")
816817
# def ensureProperObservablesExist(self):
@@ -885,6 +886,7 @@ def search_rba_fields_exist_validate(self):
885886
)
886887

887888
if len(error_messages) > 0 and self.status == DetectionStatus.production:
889+
888890
msg = (
889891
"Use of fields in rba/messages that do not appear in search:\n\t- "
890892
"\n\t- ".join(error_messages)

contentctl/objects/abstract_security_content_objects/security_content_object_abstract.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232

3333

3434
class SecurityContentObject_Abstract(BaseModel, abc.ABC):
35-
model_config = ConfigDict(validate_default=True)
36-
35+
model_config = ConfigDict(validate_default=True,extra="forbid")
3736
name: str = Field(...,max_length=99)
3837
author: str = Field(...,max_length=255)
3938
date: datetime.date = Field(...)

contentctl/objects/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535

3636
class App_Base(BaseModel,ABC):
37-
model_config = ConfigDict(validate_default=True, arbitrary_types_allowed=True)
37+
38+
model_config = ConfigDict(validate_default=True, arbitrary_types_allowed=True, extra='forbid')
3839
uid: Optional[int] = Field(default=None)
3940
title: str = Field(description="Human-readable name used by the app. This can have special characters.")
4041
appid: Optional[APPID_TYPE]= Field(default=None,description="Internal name used by your app. "

contentctl/objects/detection_tags.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737

3838
class DetectionTags(BaseModel):
3939
# detection spec
40-
model_config = ConfigDict(validate_default=False)
40+
41+
model_config = ConfigDict(validate_default=False, extra='forbid')
4142
analytic_story: list[Story] = Field(...)
4243
asset_type: AssetType = Field(...)
4344
group: list[str] = []

contentctl/objects/mitre_attack_enrichment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def standardize_contributors(cls, contributors:list[str] | None) -> list[str]:
8484
return contributors
8585

8686
class MitreAttackEnrichment(BaseModel):
87+
88+
ConfigDict(extra='forbid')
8789
mitre_attack_id: MITRE_ATTACK_ID_TYPE = Field(...)
8890
mitre_attack_technique: str = Field(...)
8991
mitre_attack_tactics: List[MitreTactics] = Field(...)

0 commit comments

Comments
 (0)