-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ba21be
commit 9996179
Showing
3 changed files
with
28 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from .cpi import CPI | ||
|
||
from .tree import Tree | ||
from .threat_source import ThreatSource, ThreatSources | ||
from .rail import ThreatSource, ThreatSources, ThreatEvent, ThreatEvents, Control, Controls, Vulnerability, Vulnerabilities, Likelihood, Impact, Risk, Risks | ||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
A class to implement Threat Sources | ||
""" | ||
from collections import UserDict | ||
|
||
class ThreatSource(UserDict): # pylint: disable=too-many-ancestors | ||
""" | ||
A class to implement Threat Sources | ||
""" | ||
def __init__(self, name: str) -> None: | ||
UserDict.__init__(self) | ||
self.data = {} | ||
self.data['name'] = name | ||
|
||
|
||
class ThreatSources(UserDict): # pylint: disable=too-many-ancestors | ||
""" | ||
A class to hold multiple Threat Sources | ||
""" | ||
def new(self, name: str) -> ThreatSource: | ||
""" | ||
A method to add a new threat source to the Threat Sources class | ||
""" | ||
self.data[name] = ThreatSource(name) | ||
return self.data[name] |