Based in the US, which law prevents you from committing cyber attacks in Russia? Genuinely curious how you would be prosecuted and how this would cause you to risk your entire career.
read up on "unlawful combatant" and "irregular combatant"
Now if look more specifically at cyber, then there are laws such as
The Computer Fraud and Abuse Act (CFAA)
The Stored Communications Act (SCA)
The Electronic Communications Privacy Act (ECPA)
The Defend Trade Secrets Act (DTSA)
which define certain activities as criminal. If a person is on US soil and engaging in activities described in these laws, they may be in violation of criminal law. The location of the victim has little to do with it, it is location of the actor.By analogy, if A does crime to B, it isn't B who prosecutes, it is the appropriate governmental organization.