mal-toolbox 0.0.27__py3-none-any.whl → 0.1.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mal_toolbox-0.0.27.dist-info → mal_toolbox-0.1.12.dist-info}/METADATA +60 -28
- mal_toolbox-0.1.12.dist-info/RECORD +32 -0
- {mal_toolbox-0.0.27.dist-info → mal_toolbox-0.1.12.dist-info}/WHEEL +1 -1
- maltoolbox/__init__.py +31 -31
- maltoolbox/__main__.py +80 -4
- maltoolbox/attackgraph/__init__.py +8 -0
- maltoolbox/attackgraph/analyzers/__init__.py +0 -0
- maltoolbox/attackgraph/analyzers/apriori.py +173 -27
- maltoolbox/attackgraph/attacker.py +99 -21
- maltoolbox/attackgraph/attackgraph.py +507 -217
- maltoolbox/attackgraph/node.py +143 -21
- maltoolbox/attackgraph/query.py +128 -26
- maltoolbox/default.conf +8 -7
- maltoolbox/exceptions.py +45 -0
- maltoolbox/file_utils.py +66 -0
- maltoolbox/ingestors/__init__.py +0 -0
- maltoolbox/ingestors/neo4j.py +95 -84
- maltoolbox/language/__init__.py +4 -0
- maltoolbox/language/classes_factory.py +145 -64
- maltoolbox/language/{lexer_parser/__main__.py → compiler/__init__.py} +5 -12
- maltoolbox/language/{lexer_parser → compiler}/mal_lexer.py +1 -1
- maltoolbox/language/{lexer_parser → compiler}/mal_parser.py +1 -1
- maltoolbox/language/{lexer_parser → compiler}/mal_visitor.py +4 -5
- maltoolbox/language/languagegraph.py +569 -168
- maltoolbox/model.py +858 -0
- maltoolbox/translators/__init__.py +0 -0
- maltoolbox/translators/securicad.py +76 -52
- maltoolbox/translators/updater.py +132 -0
- maltoolbox/wrappers.py +62 -0
- mal_toolbox-0.0.27.dist-info/RECORD +0 -26
- maltoolbox/cl_parser.py +0 -89
- maltoolbox/language/specification.py +0 -265
- maltoolbox/main.py +0 -84
- maltoolbox/model/model.py +0 -279
- {mal_toolbox-0.0.27.dist-info → mal_toolbox-0.1.12.dist-info}/AUTHORS +0 -0
- {mal_toolbox-0.0.27.dist-info → mal_toolbox-0.1.12.dist-info}/LICENSE +0 -0
- {mal_toolbox-0.0.27.dist-info → mal_toolbox-0.1.12.dist-info}/top_level.txt +0 -0
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# mypy: ignore-errors
|
|
2
|
+
from collections.abc import MutableMapping, MutableSequence
|
|
2
3
|
|
|
4
|
+
from antlr4 import ParseTreeVisitor
|
|
3
5
|
from .mal_parser import malParser
|
|
4
6
|
|
|
5
|
-
from collections.abc import MutableMapping, MutableSequence
|
|
6
|
-
|
|
7
7
|
# In a rule like `rule: one? two* three`:
|
|
8
8
|
# - ctx.one() would be None if the token was not found on a matching line
|
|
9
9
|
# - ctx.two() would be []
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
class malVisitor(ParseTreeVisitor):
|
|
13
12
|
def __init__(self, compiler, *args, **kwargs):
|
|
14
13
|
self.compiler = compiler
|
|
@@ -394,7 +393,7 @@ class malVisitor(ParseTreeVisitor):
|
|
|
394
393
|
key, subkey = mult_key.split(".")
|
|
395
394
|
|
|
396
395
|
# upper limit equals lower limit if not given
|
|
397
|
-
if subkey == "max" and association[key][subkey]
|
|
396
|
+
if subkey == "max" and association[key][subkey] is None:
|
|
398
397
|
association[key][subkey] = association[key]["min"]
|
|
399
398
|
|
|
400
399
|
if association[key][subkey] == "*":
|