diff --git a/app/objects/c_ability.py b/app/objects/c_ability.py index 1a90daff3..a26da0dad 100644 --- a/app/objects/c_ability.py +++ b/app/objects/c_ability.py @@ -13,21 +13,21 @@ class AbilitySchema(ma.Schema): ability_id = ma.fields.String() - tactic = ma.fields.String(missing=None) - technique_name = ma.fields.String(missing=None) - technique_id = ma.fields.String(missing=None) - name = ma.fields.String(missing=None) - description = ma.fields.String(missing=None) + tactic = ma.fields.String(load_default=None) + technique_name = ma.fields.String(load_default=None) + technique_id = ma.fields.String(load_default=None) + name = ma.fields.String(load_default=None) + description = ma.fields.String(load_default=None) executors = ma.fields.List(ma.fields.Nested(ExecutorSchema)) - requirements = ma.fields.List(ma.fields.Nested(RequirementSchema), missing=None) - privilege = ma.fields.String(missing=None) - repeatable = ma.fields.Bool(missing=None) - buckets = ma.fields.List(ma.fields.String(), missing=None) + requirements = ma.fields.List(ma.fields.Nested(RequirementSchema), load_default=None) + privilege = ma.fields.String(load_default=None) + repeatable = ma.fields.Bool(load_default=None) + buckets = ma.fields.List(ma.fields.String(), load_default=None) additional_info = ma.fields.Dict(keys=ma.fields.String(), values=ma.fields.String()) - access = ma.fields.Nested(AccessSchema, missing=None) - singleton = ma.fields.Bool(missing=None) - plugin = ma.fields.String(missing=None) - delete_payload = ma.fields.Bool(missing=None) + access = ma.fields.Nested(AccessSchema, load_default=None) + singleton = ma.fields.Bool(load_default=None) + plugin = ma.fields.String(load_default=None) + delete_payload = ma.fields.Bool(load_default=None) @ma.pre_load def fix_id(self, data, **_): diff --git a/app/objects/c_adversary.py b/app/objects/c_adversary.py index 32c5114b5..e2c4ccd6f 100644 --- a/app/objects/c_adversary.py +++ b/app/objects/c_adversary.py @@ -18,7 +18,7 @@ class AdversarySchema(ma.Schema): objective = ma.fields.String() tags = ma.fields.List(ma.fields.String(), allow_none=True) has_repeatable_abilities = ma.fields.Boolean(dump_only=True) - plugin = ma.fields.String(missing=None) + plugin = ma.fields.String(load_default=None) @ma.pre_load def fix_id(self, adversary, **_): diff --git a/app/objects/c_operation.py b/app/objects/c_operation.py index 647a3437e..99e981164 100644 --- a/app/objects/c_operation.py +++ b/app/objects/c_operation.py @@ -50,7 +50,7 @@ class OperationSchema(ma.Schema): visibility = ma.fields.Integer() objective = ma.fields.Nested(ObjectiveSchema()) use_learning_parsers = ma.fields.Boolean() - group = ma.fields.String(missing='') + group = ma.fields.String(load_default='') source = ma.fields.Nested(SourceSchema()) @ma.pre_load() diff --git a/app/objects/c_planner.py b/app/objects/c_planner.py index 15d6e062f..010c08752 100644 --- a/app/objects/c_planner.py +++ b/app/objects/c_planner.py @@ -16,7 +16,7 @@ class PlannerSchema(ma.Schema): stopping_conditions = ma.fields.List(ma.fields.Nested(FactSchema())) ignore_enforcement_modules = ma.fields.List(ma.fields.String()) allow_repeatable_abilities = ma.fields.Boolean() - plugin = ma.fields.String(missing=None) + plugin = ma.fields.String(load_default=None) @ma.post_load() def build_planner(self, data, **kwargs): diff --git a/app/objects/c_source.py b/app/objects/c_source.py index f0df44a0e..bcbcb451d 100644 --- a/app/objects/c_source.py +++ b/app/objects/c_source.py @@ -33,7 +33,7 @@ class SourceSchema(ma.Schema): rules = ma.fields.List(ma.fields.Nested(RuleSchema)) adjustments = ma.fields.List(ma.fields.Nested(AdjustmentSchema)) relationships = ma.fields.List(ma.fields.Nested(RelationshipSchema)) - plugin = ma.fields.String(missing=None) + plugin = ma.fields.String(load_default=None) @ma.pre_load def fix_adjustments(self, in_data, **_): diff --git a/app/objects/secondclass/c_executor.py b/app/objects/secondclass/c_executor.py index f31d3d289..870a921d2 100644 --- a/app/objects/secondclass/c_executor.py +++ b/app/objects/secondclass/c_executor.py @@ -7,15 +7,15 @@ class ExecutorSchema(ma.Schema): - name = ma.fields.String(missing=None) - platform = ma.fields.String(missing=None) - command = ma.fields.String(missing=None) - code = ma.fields.String(missing=None) - language = ma.fields.String(missing=None) - build_target = ma.fields.String(missing=None) + name = ma.fields.String(load_default=None) + platform = ma.fields.String(load_default=None) + command = ma.fields.String(load_default=None) + code = ma.fields.String(load_default=None) + language = ma.fields.String(load_default=None) + build_target = ma.fields.String(load_default=None) payloads = ma.fields.List(ma.fields.String()) uploads = ma.fields.List(ma.fields.String()) - timeout = ma.fields.Int(missing=60) + timeout = ma.fields.Int(load_default=60) parsers = ma.fields.List(ma.fields.Nested(ParserSchema())) cleanup = ma.fields.List(ma.fields.String()) variations = ma.fields.List(ma.fields.Nested(VariationSchema())) diff --git a/app/objects/secondclass/c_instruction.py b/app/objects/secondclass/c_instruction.py index 342d618a5..c2121b48d 100644 --- a/app/objects/secondclass/c_instruction.py +++ b/app/objects/secondclass/c_instruction.py @@ -12,7 +12,7 @@ class InstructionSchema(ma.Schema): payloads = ma.fields.List(ma.fields.String()) deadman = ma.fields.Boolean() uploads = ma.fields.List(ma.fields.Dict(keys=ma.fields.String(), values=ma.fields.String())) - delete_payload = ma.fields.Bool(missing=None) + delete_payload = ma.fields.Bool(load_default=None) @ma.post_load def build_instruction(self, data, **_): diff --git a/app/objects/secondclass/c_link.py b/app/objects/secondclass/c_link.py index 6b8218241..793dc34a0 100644 --- a/app/objects/secondclass/c_link.py +++ b/app/objects/secondclass/c_link.py @@ -25,15 +25,15 @@ class LinkSchema(ma.Schema): class Meta: unknown = ma.EXCLUDE - id = ma.fields.String(missing='') + id = ma.fields.String(load_default='') paw = ma.fields.String() command = ma.fields.String() plaintext_command = ma.fields.String() - status = ma.fields.Integer(missing=-3) - score = ma.fields.Integer(missing=0) - jitter = ma.fields.Integer(missing=0) + status = ma.fields.Integer(load_default=-3) + score = ma.fields.Integer(load_default=0) + jitter = ma.fields.Integer(load_default=0) decide = ma.fields.DateTime(format=BaseObject.TIME_FORMAT) - pin = ma.fields.Integer(missing=0) + pin = ma.fields.Integer(load_default=0) pid = ma.fields.String() facts = ma.fields.List(ma.fields.Nested(FactSchema())) relationships = ma.fields.List(ma.fields.Nested(RelationshipSchema())) @@ -43,12 +43,12 @@ class Meta: finish = ma.fields.String() ability = ma.fields.Nested(AbilitySchema()) executor = ma.fields.Nested(ExecutorSchema()) - cleanup = ma.fields.Integer(missing=0) + cleanup = ma.fields.Integer(load_default=0) visibility = ma.fields.Nested(VisibilitySchema()) - host = ma.fields.String(missing=None) + host = ma.fields.String(load_default=None) output = ma.fields.String() deadman = ma.fields.Boolean() - agent_reported_time = ma.fields.DateTime(format=BaseObject.TIME_FORMAT, missing=None) + agent_reported_time = ma.fields.DateTime(format=BaseObject.TIME_FORMAT, load_default=None) @ma.pre_load() def fix_ability(self, link, **_): diff --git a/app/objects/secondclass/c_parserconfig.py b/app/objects/secondclass/c_parserconfig.py index b67c5086e..030948b03 100644 --- a/app/objects/secondclass/c_parserconfig.py +++ b/app/objects/secondclass/c_parserconfig.py @@ -9,8 +9,8 @@ class Meta: unknown = ma.INCLUDE source = ma.fields.String() - edge = ma.fields.String(missing=None) - target = ma.fields.String(missing=None) + edge = ma.fields.String(load_default=None) + target = ma.fields.String(load_default=None) custom_parser_vals = ma.fields.Dict(keys=ma.fields.String(), values=ma.fields.String()) @ma.pre_load diff --git a/app/objects/secondclass/c_result.py b/app/objects/secondclass/c_result.py index b0790e42b..fa5b73bd3 100644 --- a/app/objects/secondclass/c_result.py +++ b/app/objects/secondclass/c_result.py @@ -10,7 +10,7 @@ class ResultSchema(ma.Schema): exit_code = ma.fields.String() pid = ma.fields.String() status = ma.fields.String() - agent_reported_time = ma.fields.DateTime(format=BaseObject.TIME_FORMAT, missing=None) + agent_reported_time = ma.fields.DateTime(format=BaseObject.TIME_FORMAT, load_default=None) @ma.post_load def build_result(self, data, **_):