All members of the enemy military, military civilians, and military contractors are lawful combatants. There is no special protection for IT guys, just like there is no special protection for cooks or personnelists. That's just the way it is and those of us in uniform accept it.
If we are already at war with a nation and one of their civilian population decides to attack us in any way they become an unlawful combatant and give up their protection under the Geneva Convention. The attacked nation has the right to eliminate the threat in any way they see fit, whether that is a counter hack or a guided missile.
If we are not at war and a civilian attacks our network, then it is a criminal matter handled via the state department. Depending on the political tensions, the attacker's nation's response or lack of response may precipitate military actions. This would be true If the crime were murder, theft, or embezzlement, computer crimes are not special.