izar / pytm

A Pythonic framework for threat modeling
Other
861 stars 161 forks source link

Fix cvss and response override #248

Closed Dakes closed 3 weeks ago

Dakes commented 3 weeks ago

This fixes the problem, that cvss and response by overrides aren't included in Findings.

I think this also, at least partially, fixes #222

izar commented 3 weeks ago

Can you add this case to the tests, before we merge? Thanks!

Dakes commented 3 weeks ago

I now added a test for the private function encode_threat_data, because the alternative would be to test the generated reports. But I couldn't get the threats to show up in the report during the test. And it would also change the results if the threats.json would be updated.

Also during writing the test I noticed another small bug, which I fixed in the last commit. If the inScope property of an Element was set to False, it would not reset the Findings, causing other tests to fail, besides the one, where the Finding was set. With these changes there is no code any more, which requires this fix, but I thought I'd add it anyway.

izar commented 3 weeks ago

Thanks!