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

[Request] tacticBackground support for SVGConfig #92

Open
xg5-simon opened this issue Oct 17, 2022 · 2 comments
Open

[Request] tacticBackground support for SVGConfig #92

xg5-simon opened this issue Oct 17, 2022 · 2 comments

Comments

@xg5-simon
Copy link

Is your feature request related to a problem?

Add tacticBackground and showTacticBackground as parameter options when using SVGConfig

Describe the solution you'd like

Add tacticBackground and showTacticBackground as a supported parameter options when using SVGConfig to export a layer as an SVG.

@CyberDefend3r
Copy link

CyberDefend3r commented Jun 28, 2023

These values are defined in the layer json. Though they seem to be ignored / not implemented in the SVG conversion. Defining these in the layer json and using the ATT&CK Nav to export to SVG works as expected.

"showTacticRowBackground": true,
"tacticRowBackground": "#205b8f"

Example export using the script:
export_from_script

Example export using ATT&CK Nav:
export_from_navigator

Adding code and JSON layer file to recreate the issue.

lay = Layer()
lay.from_file("example_layer.json")
svgconf = SVGConfig(width=12, height=12, headerHeight=1, unit="in", showSubtechniques="expanded",
                    font="sans-serif", tableBorderColor="#6B7279", showHeader=False, legendDocked=True,
                    legendX=0, legendY=0, legendWidth=2, legendHeight=1, showLegend=False, showFilters=False,
                    showAbout=False, showDomain=False, border=0.104)
t = ToSvg(domain=lay.layer.domain, source='taxii', config=svgconf)
t.to_svg(layerInit=lay, filepath="../reports/mitreheatmap.svg")

JSON Layer: example_layer.zip

@CyberDefend3r
Copy link

Looks like the reason is that there are no cells created under the Tactic text.

text = Text(ctype="TacticName", font_size=font_size, text=displayStr, position="middle")

Could implement another method similar to _block to create the necessary objects for the tactic row... maybe?

def _block(technique, height, width, tBC):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants