Skip to content

Commit

Permalink
Fix false warnings during layer ops (#174)
Browse files Browse the repository at this point in the history
* fix 173

* update changelog
  • Loading branch information
clemiller authored Apr 29, 2024
1 parent b481c2f commit c0f469f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# v3.0.5 - Changes staged

## Features

- Added functionality to `MitreAttackData` to retrieve a list of Procedure Examples by technique. [#172](https://github.com/mitre-attack/mitreattack-python/pull/172)

## Fixes

- Fixed a layer comparison issue causing false warnings to appear during layer operations. [#173](https://github.com/mitre-attack/mitreattack-python/issues/173).

# v3.0.4 - 4/23/2024

## Features
Expand Down
6 changes: 4 additions & 2 deletions mitreattack/navlayers/manipulators/layerops.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ def _merge_to_template(self, data, key=0):
for entry in key_space:
if entry != "techniques":
standard = _raw[entry]
if any(y != standard for y in [getattr(x.layer, entry) for x in collide]):
layer_entries = [getattr(x.layer, entry) for x in collide]
layer_entries = [y.get_dict() if hasattr(y, 'get_dict') else y for y in layer_entries]
if any(y != standard for y in layer_entries):
if entry == "domain":
print("FATAL ERROR! Layer mis-match on domain. " "Exiting.")
print("FATAL ERROR! Layer mis-match on domain. Exiting.")
raise MismatchedDomain
print(f"Warning! Layer mis-match detected for {entry}. Defaulting to {key}'s value")
out[entry] = standard
Expand Down

0 comments on commit c0f469f

Please sign in to comment.