Allowing electronic warfare to exist outside of US law and doctrine is not a good idea. That's how things escalate suddenly and unpredictably. Maybe you feel that, because we're being attacked, we must respond offensively. Fine. We should still have rules for how those operations are targeted, conducted and limited.
10 U.S. Code § 394. Authorities concerning military cyber operations
https://www.law.cornell.edu/uscode/text/10/subtitle-A/part-I...
As a "sensitive military cyber operation" this was likely reported to Congress within the required timeframe unless it was defined as a "covert action" which has its own set of laws.
Sensitive military cyber operation: https://www.law.cornell.edu/uscode/text/10/395
Covert actions: https://www.law.cornell.edu/uscode/text/50/3093
Doctrinally, offensive cyber operations have been extensively studied and debated for a number of years and the official joint military doctrine document is publicly available:
Joint Publication 3-12, Cyberspace Operations, 8 June 2018
https://www.jcs.mil/Portals/36/Documents/Doctrine/pubs/jp3_1...