A secret legal review on the use of America’s growing arsenal of cyber weapons has concluded that President Obama has the power to order a pre-emptive strike if the United States detects credible evidence of a major digital attack looming from abroad, according to officials involved in the review. That decision is among several reached in recent months as the administration moves, in the next few weeks, to approve the nation’s first rules for how to defend, or retaliate, against a major cyber attack. New policies will also govern how the intelligence agencies can carry out searches of faraway computer networks for signs of potential attacks on the nation and, if the president approves, strike adversaries by injecting them with destructive code — even if there is no declared war.