Add OpenCRE mapping script with safe fallback handling#1382
Add OpenCRE mapping script with safe fallback handling#1382Nik-ui wants to merge 3 commits intoOWASP:masterfrom
Conversation
|
Hi @kingthorin This PR introduces OpenCRE mapping enrichment with fallback handling for missing mappings. |
|
Could you remove the unrelated commits? If you're not comfortable with that it's okay, I can tiddy it up. Just let me know. |
@kingthorin Okay, i will work on this. |
13d3476 to
77f59f7
Compare
|
Thanks @kingthorin, I have cleaned up the branch and removed the unrelated commits. Let me know if anything else should be adjusted. |
|
Need to ensure the two workflows that work with the checklist are using the same indenting rule(s). So that it isn't always the entire file that's updated. Also this should probably be a step in the other workflow, so that the CRE IDs are updated whenever the checklist(s) are. |
77f59f7 to
5702ea9
Compare
Thanks @kingthorin , that makes sense. I’ll update the script to follow the same indentation rules to avoid rewriting the entire file, and look into integrating it as part of the existing workflow so CRE IDs stay in sync with checklist updates. |
10c6597 to
ab8d27b
Compare
|
Re-duplicates see these issues and the associated PR on 640: |
|
@Nik-ui It seems like you still have some changes that were already merged. You might need to reset the branch to a clean up-to-date state and re-implement your changes. Then force push to the PR. 🤷♂️ |
8c5ed80 to
0e81e55
Compare
Thanks @kingthorin , I have now rebased the branch onto the latest upstream master and removed previously merged or unrelated changes. The PR now only contains the OpenCRE mapping script and workflow integration. I also verified that it does not introduce any direct checklist modifications; the existing WSTG-INPV-13 duplication is already present in upstream and is not added by this branch. Please let me know if anything else should be adjusted. |
0e81e55 to
b49af20
Compare
|
Thanks, I'll review/test tomorrow. |
| - name: Generate JSON Checklist | ||
| run: | | ||
| npm run-script jsongen | ||
| npm run-script opencregen |
There was a problem hiding this comment.
I think a npm i puppeteer-core is needed first.
There was a problem hiding this comment.
Still needs to be addressed
b5eb8e7 to
2b7489a
Compare
|
Thanks @kingthorin for the guidance, this was really helpful. I have updated the implementation to use the This aligns better with the intended API usage and avoids regex-style lookups. I have tested the endpoint across multiple WSTG IDs and confirmed that it returns consistent CRE mappings. Please let me know if this approach looks correct or if there is anything else you would like adjusted. |
|
Thanks for collaborating with the OpenCRE team, that should help ensure this is more stable and reliable going forward. Have you tested locally or on a VM? (It's okay if you haven't, I just want to set my own expectations 😉). |
|
Yes, I tested this locally. I verified the mapping logic by calling the endpoint directly for multiple WSTG IDs (e.g. WSTG-INPV-04, WSTG-CONF-02) and confirmed that the expected CRE IDs are returned. I also ran the full checklist generation script to ensure it integrates correctly and only updates the file when mappings change. |
There was a problem hiding this comment.
This doesn't seem to be maintaining format.
|
Thanks @kingthorin, I have now addressed the remaining feedback. What changed
ValidationI tested locally and confirmed:
I also removed the sorting of existing One note on schema: I kept Please let me know if you would like me to make any further adjustments. |
|
Doing the existing vs the new as a secondary step seems unnecessary. Should be able to read the JSON and compare/update in a single pass. (Also seems weird to have a script for js but then also inline a ton of js.) I still don't see puppeteer being installed. |
|
Hold off on further changes for now. I'm going to look at adjusting the current generation/handling. Then we can come back around to this. |
7725dec to
b479b1c
Compare
Okay. |
|
After a bunch of debate and testing I decided to move away from the shell handling to python since that was already in use for the Excel and Google Drive handling. Do you want:
|
Hi @kingthorin, I will definitely give this a try and get back to you once I am done. |
|
Do you plan to clean this up and finish it? |
93bb741 to
95f6fa3
Compare
This comment has been minimized.
This comment has been minimized.
currently on it. |
This comment has been minimized.
This comment has been minimized.
dc3c166 to
95f6fa3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
159a2be to
46653bf
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a696d90 to
0187adc
Compare
This comment has been minimized.
This comment has been minimized.
1ea467a to
2d43dae
Compare
|
If you need help I can probably get it back on track and provide instructions to update your local branch. Just let me know. |
Quick update: I have now fixed the markdown and link-check issues, and all checks are passing. The PR is currently down to 3 commits and appears ready for review on my side. I’d still appreciate your guidance on the best next step for getting this fully aligned with the intended Python-based approach, if that’s still the preferred direction. |
This comment has been minimized.
This comment has been minimized.
|
The files currently in the PR are completely irrelevant to the OpenCRE work. They seem to be something that you added during a merge or rebase. The shell script was removed from the repo during the period in which you've been working with this PR. (So that was probably either from a merge or conflict.) I'll go through the history tomorrow and try to find the python you had submitted at one point. Then I'll try to put some instructions together to get you back on track. |

This PR covers issue #623.
What did this PR accomplish?