INNER CODE UNIT · Python

get_all_techniques

mitre-attack/attack-scripts · scripts/technique_mappings_to_csv.py:26

def get_all_techniques(src, source_name, tactic=None):
    """Filters data source by attack-pattern which extracts all ATT&CK Techniques"""
    filters = [
        Filter("type", "=", "attack-pattern"),
        Filter("external_references.source_name", "=", source_name),
    ]
    if tactic:
        filters.append(Filter('kill_chain_phases.phase_name', '=', tactic))

    results = src.query(filters)
    return remove_deprecated(results)


def filter_for_term_relationships(src, relationship_type, object_id, target=True):
    """Filters data source by type, relationship_type and source or target"""
    filters = [
        Filter("type", "=", "relationship"),
        Filter("relationship_type", "=", relationship_type),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…