Skip to content

Remove useless 1:1 mappings for ZAP - #367

Open
darkspirit510 wants to merge 1 commit into
OWASP-Benchmark:mainfrom
darkspirit510:zap-new-cwes
Open

darkspirit510 wants to merge 1 commit into
OWASP-Benchmark:mainfrom
darkspirit510:zap-new-cwes

Conversation

@darkspirit510

Copy link
Copy Markdown
Contributor

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.

@davewichers

Copy link
Copy Markdown
Contributor

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.

@darkspirit510

Copy link
Copy Markdown
Contributor Author

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?

@davewichers

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants