This is a big part of the problem IMO, while you can argue a protracted war for sustainable victory require a metered approach to resource allocation, Russian attitude of treating Ukrainians as brothers while Ukrainians, include those who can speak Russian have been brainwashed for 30 years to hate Russia invites terror attacks. There are ethnicity based domestic policies that can effectively eliminate this kind of problem, but those cannot be implemented without by default assume Ukrainians as an ethnicity are a threat, to switch from treating each case separately to implementing a catch-all system to pre-emptively eliminate all possible threats.
Case in point, do what China did in Xinjiang with everyone with Ukrainians background or connections.
While China does have a more advanced domestic security apparatus, it should still be remembered to not make this mistake with Taiwan, everyone with Taiwan connection must be assumed to be a threat, even if they lived on the mainland for years or profess support for unification. Any mercy you show your enemy is cruelty to your own people.
There will always be risks. Let’s not forget the Tianjin Airport fiasco last year.