simonec73 / threatsmanager

Threats Manager Platform Core libraries and SDK
MIT License
72 stars 14 forks source link

Duplicate definition for Threats Property Schema #64

Closed rsrinivasanhome closed 7 months ago

rsrinivasanhome commented 8 months ago

High level issue - I have created a threats manager studio template and have 2 versions (lower, higher) of the template defined. I first create a template using the lower version of the template and saved the threat model. (I have customized the structure of Threats to add a custom field in the template) I then open the threat model and apply the second version of the template and save the threat model. When I open the property schema I see a duplicate definition of threats

image

Detailed steps to reproduce the issue

1.Create a new threat model 2.Click import knowledge Base and import v1template.tmt.txt.

  1. Create a diagram . Close the the threat model
  2. Reopen the threat mode again apply v2template.tmt.txt by using import merge - all options .

sample threat model provided - TryAgain2.tm.txt

Expected behavior property schema should have only one definition of threat.

For now I am deleting the newly added -"Threats" schema (via property schema screen) it appears to work so far . Let me know if I will face any issues. Looks like workaround is available for this issue.

simonec73 commented 7 months ago

Addressed with v2.1.4.

rsrinivasanhome commented 7 months ago

@simonec73 I have been able to simulate the issue again. 1.Create a new threat model 2.Click import knowledge Base and import v1template.tmt.txt.

  1. Create a diagram
  2. Add some threat events manually
  3. click Merge Merge Threat model and templates import v2template.tmt.txt
  4. Add another threat manually.
  5. List threat events . View the below screen image
  6. Property schema view image
  7. Merged threat model sample SampleTest .tm.txt
rsrinivasanhome commented 7 months ago

using version 2.1.4.0 the old workaround still works for the newly created threats

rsrinivasanhome commented 7 months ago

The work around is not working when we regenerate threats the duplicates are created again .