Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Technique/tactic seems malformed #186

Open
Yellowwaves opened this issue Mar 24, 2025 · 0 comments
Open

[Bug] Technique/tactic seems malformed #186

Yellowwaves opened this issue Mar 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Yellowwaves
Copy link

Expected Behavior

Using the exporters such as Excel or SVG using a local json file like https://github.com/mitre-attack/attack-stix-data/blob/master/enterprise-attack/enterprise-attack.json source should retrieve the proper data and produce the expected exported output with an output layer.

Actual Behavior

Every technique and subtechnique I was testing worked perfectly expect for this one : T1078.004

The error message is :
WARNING! Technique/Tactic T1078.004/(none) seems malformed. Skipping...

Steps to Reproduce the Problem

from mitreattack.navlayers.core import Layer
from mitreattack.navlayers.exporters.to_excel import ToExcel

lay = Layer()
lay.from_file("C:path_to_layer.json")

t2 = ToExcel(domain='enterprise', source='local', resource='path_to_enterprise-attack.json')
t2.to_xlsx(layerInit=lay, filepath="demo.xlsx")

The layer i'm using is

{
    "name": "example layer",
    "domain": "enterprise-attack",
    "description": "demo xlsx",
    "versions": {
        "layer": "4.5",
        "attack": "16.1",
        "navigator": "5.1.0"
    },
    "filters": {
        "platforms": [
            "Windows",
            "macOS"
        ]
    },
    "sorting": 2,
    "layout": {
        "layout": "side",
        "showID": true,
        "showName": true,
        "showAggregateScores": true,
        "countUnscored": true,
        "aggregateFunction": "average",
        "expandedSubtechniques": "annotated"
    },
    "hideDisabled": false,
    "techniques": [
        {
            "techniqueID": "T1078",
            "color": "#00FF00",
            "showSubtechniques": true
        },
        {
            "techniqueID": "T1078.004",
            "comment": "https://attack.mitre.org/techniques/T1078/004/",
            "color": "#00FF00"
        }
    ],
    "gradient": {
        "colors": [
            "#ff6666",
            "#ffe766",
            "#8ec843"
        ],
        "minValue": 0,
        "maxValue": 100
    },
    "legendItems": [
        {
            "label": "Legend Item Label",
            "color": "#FF00FF"
        }
    ],
    "showTacticRowBackground": true,
    "tacticRowBackground": "#dddddd",
    "selectTechniquesAcrossTactics": false,
    "selectSubtechniquesWithParent": false,
    "selectVisibleTechniques": false,
    "metadata": [
        {
            "name": "layer metadata 1",
            "value": "layer metadata 1 value"
        },
        {
            "name": "layer metadata 2",
            "value": "layer metadata 2 value"
        }
    ]
}

Possible Solution

The problem is appearing here

                else:
                    parents = [x for x in layer.layer.techniques if x.techniqueID == tech.techniqueID.split(".")[0]]
                    if tech.tactic:
                        parents = [x for x in parents if x.tactic == tech.tactic]
                    if all([True if not x.showSubtechniques else False for x in parents]):
                        print(
                            "NOTE! Technique/Tactic " + tech.techniqueID + "/" + tac + " does not appear "
                            "to be visible in the matrix. Its parent appears to be hiding it."
                        )
                    else:
                        print(
                            "WARNING! Technique/Tactic " + tech.techniqueID + "/" + tac + " seems malformed. "
                            "Skipping..."
                        )
@Yellowwaves Yellowwaves added the bug Something isn't working label Mar 24, 2025
@Yellowwaves Yellowwaves changed the title [Bug] Technique/tartic seems malformed [Bug] Technique/tactic seems malformed Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant