Repository navigation
Remove useless 1:1 mappings for ZAP - #367
darkspirit510 wants to merge 1 commit into
Conversation
|
I prefer to keep those mappings in there so that it flags new CWEs, so we can deliberately decide if we want to leave them 'as is' or map them to an expected CWE in Benchmark. You can automatically map 'unmapped' CWEs to the same CWE but also issue a warning that there is a new 'unmapped' CWE we haven't seen before that needs to be added to the mapping. |
|
But right now there are dozens of CWE numbers mapped that Benchmark is not aware of and don't care in the final result. Do you really want to keep those? |
|
I do want to keep those, because that means they were specifically looked at, and the mappings left as-is because they don't map to any of the 'expected' CWEs for Benchmark for Java. Any 'new' unmapped CWEs should warn that they are unmapped, so we can go in a examine them, and either add them 'as-is' or map them to an expected CWE if a mapping makes sense. That way when new CWEs show up we know to look at/map them to make sure ZAP is given proper credit for things it finds. |
ZAP Reader has a big switch-case that basically only had two real mappings (264 -> 284, -1 -> don't care). The rest was just useless 1:1 mapping (123 -> 123, 456 -> 456 and so on). This would require adding a mapping from one ID to the same ID every time ZAP adds a new CWE. I changed the code that it will just return any CWE number except it is one of the listed ones.