-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change class TTPs to no longer be EntityList - fixes #357
- Loading branch information
Showing
3 changed files
with
8 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,28 @@ | ||
# Copyright (c) 2016, The MITRE Corporation. All rights reserved. | ||
# See LICENSE.txt for complete terms. | ||
|
||
# stdlib | ||
from functools import partial | ||
|
||
# mixbox | ||
from mixbox import entities | ||
from mixbox import fields | ||
|
||
# stix | ||
import stix | ||
from stix import utils | ||
from stix.ttp import TTP | ||
from stix.common.kill_chains import KillChains | ||
from stix.bindings import stix_core as core_binding | ||
|
||
|
||
class TTPs(stix.EntityList): | ||
class TTPs(stix.Entity): | ||
_binding = core_binding | ||
_binding_class = _binding.TTPsType | ||
_namespace = 'http://stix.mitre.org/stix-1' | ||
|
||
ttps = fields.TypedField( | ||
name="TTP", | ||
type_=TTP, | ||
multiple=True, | ||
key_name="ttps" | ||
) | ||
|
||
ttp = fields.TypedField("TTP", TTP, multiple=True, key_name="ttps") | ||
kill_chains = fields.TypedField("Kill_Chains", KillChains) | ||
|
||
def __init__(self, ttps=None): | ||
super(TTPs, self).__init__(ttps) | ||
super(TTPs, self).__init__() | ||
self.ttp = ttps | ||
self.kill_chains = KillChains() | ||
|
||
def add_ttp(self, ttp): | ||
self.append(ttp) | ||
self.ttp.append(ttp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters