mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
type: capa.render.result_document
This commit is contained in:
@@ -5,10 +5,14 @@
|
||||
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
import capa.rules
|
||||
import capa.engine
|
||||
import capa.render.utils
|
||||
import capa.features.common
|
||||
from capa.rules import RuleSet
|
||||
from capa.engine import Result
|
||||
|
||||
|
||||
def convert_statement_to_result_document(statement):
|
||||
@@ -209,7 +213,7 @@ def convert_meta_to_result_document(meta):
|
||||
return meta
|
||||
|
||||
|
||||
def parse_canonical_attack(attack):
|
||||
def parse_canonical_attack(attack: str):
|
||||
"""
|
||||
parse capa's canonical ATT&CK representation: `Tactic::Technique::Subtechnique [Identifier]`
|
||||
"""
|
||||
@@ -233,7 +237,7 @@ def parse_canonical_attack(attack):
|
||||
}
|
||||
|
||||
|
||||
def parse_canonical_mbc(mbc):
|
||||
def parse_canonical_mbc(mbc: str):
|
||||
"""
|
||||
parse capa's canonical MBC representation: `Objective::Behavior::Method [Identifier]`
|
||||
"""
|
||||
@@ -257,7 +261,7 @@ def parse_canonical_mbc(mbc):
|
||||
}
|
||||
|
||||
|
||||
def convert_capabilities_to_result_document(meta, rules, capabilities):
|
||||
def convert_capabilities_to_result_document(meta, rules: RuleSet, capabilities: Dict[str, List[Tuple[int, Result]]]):
|
||||
"""
|
||||
convert the given rule set and capabilities result to a common, Python-native data structure.
|
||||
this format can be directly emitted to JSON, or passed to the other `capa.render.*.render()` routines
|
||||
|
||||
Reference in New Issue
Block a user