As for defense, the EU can't do much, sorry. Most interesting things are done at the hardware level. As for software, maybe they could sponsor security code reviews of some critical elements of open source ecosystem and encourage users to use them, but it would work only if these users used these components exclusively which is never going to happen, even in government.
If vulnerabilities are dense and there will always be more than we can patch.. well computers are a strange beast.
Uhh, what?
The US isn't waging aggressive offensive hacking wars against other countries beyond targeting weapons r&d. The same can't be said of Russia, China, etc.
The US does have such capabilities but has been far more restrained in the use of them than its enemies.
The issue then is that we thought China was on our side, then we discovered that not really they had their own ambitions which do not coincide with ours. And so we're slowing trying to take away as much power as we can from them so we can bring them under control. These pronouncements then are an attack on China's soft power as everyone is doing it anyway all the time.
It seems at the same time China is attempting to establish its own power structure while trying to negotiate with the West, look for instance at the moves it is making with Iran.