Computer Fraud and Abuse Act states that it is illegal in accessing a computer without authorization. It was enacted in 1986. It was released due to the fact that cybersecurity crimes were increasing and the government did not want them to go unpunished.
If you are interesting in seeing more of this Act, check out:
https://en.wikipedia.org/wiki/Computer_Fraud_and_Abuse_Act