The UK government’s secure network has come under attack from hackers controlled by a foreign state.