Closed jasperla closed 1 year ago
FWIW looks like mwdb-core supports it: https://github.com/CERT-Polska/mwdb-core/blob/504ad2f7d4c3c96fbf3fdf6b0fd7e88639ce33c2/mwdb/resources/comment.py#L143
Also just checked: this can be easily achieved with mwdblib low-level facilities already:
>>> m
<mwdblib.core.MWDB object at 0x7fad48dd6f40>
>>> m.api
<mwdblib.api.api.APIClient object at 0x7fad48da00d0>
>>> o.id
'95541fdb28429005ded498da8314f343ad592e1c4e5ecdfa71023533738764bb'
>>> o.comments[0].id
1
>>> m.api.delete(f"object/{o.id}/comment/{o.comments[0].id}")
Hell, since I've already reproduced it and all, I've created a PR for this: https://github.com/CERT-Polska/mwdblib/pull/87
Currently it's not possible to remove comments from samples, even though it's possible to add them with
add_comment()
. There are functions to remove tags and attributes, and it would be helpful if it's also possible to remove comments.Comments already have a unique ID associated with them which could be used as the parameter to a new
remove_comment()
function.I have not checked if mwdb-core needs support for this or if a DELETE request is already handled.