As opposed to say weapons systems or targeting systems, which are really only for military use.
The military needs a lot of things that other people need, and some things that only the military needs. If you don't work on the things only the military needs, I think you're in the clear.
In essence I agree with that, it's just that cyber-security has particularly been the focus of recent military discourse.
Just yesterday I was reading an article here in the Romanian mainstream media about how Constanta Port's (our biggest port at the Black Sea) IT infrastructure has been under constant cyber attacks (presumably by the Russians) so as to hinder the export of Ukrainian grains through it. And this is just one of the many such (relatively) recent examples.
However, reducing (or rather limiting the increase of) PII leakage and impact of ransomware activities is much closer to day-to-day mainstreet of most people.
Anyone committed to advancing science should care about this regardless of its potential contributions to defense.