apply_tags_to_findings not working as intended
Bug description It appears there's an issue with the apply_tags_to_findings API functionality. During the process of importing results with the following command:
curl --location --request POST 'https://defectdojo.internal/api/v2/import-scan/'
--header 'Authorization: Token 123456'
--form 'engagement=434'
--form 'verified="true"'
--form 'active="true"'
--form 'scan_date=2024-03-13'
--form 'scan_type=MobSF Scan'
--form 'minimum_severity="Info"'
--form 'skip_duplicates="true"'
--form 'close_old_findings="false"'
--form 'environment=GITLAB'
--form 'apply_tags_to_findings="true"'
--form 'tags="test1"'
--form 'file=@mobsf_scan.json;type=application/json'
I get the following result:
The tag gets applied correctly to the test itself, but the findings tags are messed up:
**Sample File mobsf_scan.txt
Deployment method (select with an X)
- [ ] Docker Compose
- [X] Kubernetes
- [ ] GoDojo
Environment information
- DefectDojo version 2.32.2
@enidevops There's a couple of PRs that were merged after 2.32.2 that involve tags - I'd look a those and potentially upgrade. See https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.32.3
There have been a couple of tag-related PRs against the dev branch which will be part of the 2.33.0 release next week (assuming the are approved and merged). So there's a decent chance 2.33.0 will resolve this as well.
@enidevops Just checked and this isn't happening with #9830 which will be in 2.33.0 (Monday, April 1st)
@mtesauro ok great, thank you! then I will wait for the 2.33.0 release
@enidevops Feel free to reopen this if needed but I don't expect it to be needed so I'm closing this now.
@mtesauro I just tried the same command with 2.33.0 and now the tags are only applied to the test and not the findings:
This seems to be happening only with the scan type 'MobSF Scan'. I tested this with the SARIF format and there it is working
@enidevops Perhaps compare the structure of your MobSF Scan file output to what's in the unit tests because I'm not seeing that behavior with those files.