center-for-threat-informed-defense / security-stack-mappings

🚨ATTENTION🚨 The Security Stack Mappings have migrated to the Center’s Mappings Explorer project. See README below. This repository is kept here as an archive.
https://center-for-threat-informed-defense.github.io/mappings-explorer/
Apache License 2.0
379 stars 64 forks source link

Minor fix in the visualizer functionality employing tags #150

Closed jorlamd closed 2 years ago

jorlamd commented 3 years ago

While trying the mapping tool on a standard venv I get the following error:

`./mapping_cli.py visualize --visualizer AttackNavigator --output sample_output/ --tag Containers --tag Database --title containers_and_databases

Traceback (most recent call last): File "..../mapping_cli.py", line 279, in args.func(args) File "..../mapping_cli.py", line 79, in visualize mappings = mapping_driver.query_mapping_files(args.tag, args.relationship, None, None) File ".../mapping_driver.py", line 27, in query_mapping_files return self.mapping_db.query_mapping_files(tags, relationship, control_names, platforms) AttributeError: 'MappingDriver' object has no attribute 'mapping_db' `

This appears to be triggered by function query_mapping_files relying on a mappings_db to be set. As a quick fix I added the argument and set the database within the function that triggers when a request for a layer based on tag aggregation is requested. It works on my side.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information