It is not a one-time affair; the attack can come everytime.
But you can disable UPnP in the router and your NAS and disable remote access.
Additionally, you can fix the security vulnerability yourself. There are only 2 lines of code (!!) that needs to be fixed. And WD didn’t care about this tiny fix, just because the product is EOL.
Here is my fix: Help! All data in mybook live gone and owner password unknown - #415 by dracenmarx