International law in this area largely comes from three sources: First, nations can create law by the adoption and ratification of treaties. In the context of the legality of military action, the key treaty is the U.N. Charter. Second, nations can create "customary international law" by practice. If a large number of countries declare a principle and actively act in compliance with that practice, the principle is recognized as a settled principle of international law. Third, international tribunals such as the International Court of Justice provide decisions on these issues.
In the modern era, the critical legal document is the U.N. Charter. Adopted after the horrific experience of World War II, the Charter is imposes a very restrictive view of when a nation can engage in the use of force. It provides that "All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations." The only exceptions are the use of force authorized by the Security Council and the right of individual and collective self defense. The self-defense provision, however, makes clear that this right of self-defense only applies until the Security Council has taken action:
Nothing in the present Charter shall impair the inherent right of individual or collective self-defence if an armed attack occurs against a Member of the United Nations, until the Security Council has taken measures necessary to maintain international peace and security. Measures taken by Members in the exercise of this right of self-defence shall be immediately reported to the Security Council and shall not in any way affect the authority and responsibility of the Security Council under the present Charter to take at any time such action as it deems necessary in order to maintain or restore international peace and security.The text of the U.N. Charter leaves lots of open questions such as What is the use of force? Must a nation wait for an attack or can it take preemptive action? Practice over the years, however, has resulted in some consensus on many of the open issues, and the International Court of Justice has offered some guidance as well. For example, it is largely accepted that a nation need not wait for an an attack, but can take steps to defend itself from an attack that is imminent. A merely preventive attack, however,--such as to take out a weapon--is not permitted unless an actually attack is imminent.
Some recent examples of military action illustrate these principles. While the Vietnam War was deeply controversial, the U.S. intervention in defense of South Vietnam was a lawful exercise of collective self defense in support of South Vietnam. Both the Gulf War and our more recent intervention in Libya were authorized by the Security Council. The legality of the invasion of Iraq in 2003 is deeply controversial, but it is worth noting that the U.S. at the time justified the war as authorized by Security Council resolutions, and in particular as the resumption of the previously authorized use of force against Iraq (to defend Kuwait) after violations of the cease fire. Finally, our current fight against ISIS has the express consent of Iraq and at least the implied consent of Syria, and both are also instances of our own self-defense.
This is not to say, however, that every military action taken by the U.S. has had even a plausible legal basis under the U.N. Charter. In recent years, the most challenging situations have been circumstances of serious humanitarian crisis in which the Security Council could not come to agreement. The best example here is our air war against Serbia to stop human rights abuses in Kosovo. The Security Council could reach no resolution, but NATO decided to act nonetheless. I would put Trump's missile attack against Syria in this same category. Vietnam's intervention in Cambodia to dislodge the Khmer Rouge is yet another example. Some legal scholars have used the odd phrase "illegal, but justified" to describe these cases.
So what about Korea? Clearly, if there is an imminent legal attack on the U.S. or its allies by North Korea, we could act to defend ourselves with out waiting for North Korea to launch its attack. I am doubtful, however, that current legal principles would allow us to use preventive war to take out a missile silo or nuclear facility absent such an imminent attack. Israel attacked a Syrian nuclear facility in 2007 with little international reaction, suggesting that the international community might accept an "anticipatory self-defense" justification, at least when weapons impose an existential threat.
What about Syria? Could we take military action to create a no fly zone or even support regime change? In my view, the answer is a clear no under the U.N. Charter unless an exception is developed for humanitarian intervention.
Some important observations before I leave this primer. First, the Cambodia, Kosovo and Syrian examples, have lead many to question the continued Security Council control over humanitarian intervention. If China and Russia will veto any humanitarian intervention, no matter how justified, perhaps a new framework will be required.
Second, it is important to note that the United States was the leading power in developing the U.N. Charter framework. It was not imposed on the U.S.; to the contrary, in large measure we (and our Allies) imposed this framework on the rest of the world. And while it has constrained our action, it appears to have restrained other aggressive action as well, and has not restrained us when our vital rights of defense were at stake--such as in the current wars against terrorist groups. The result has been a far more stable world than before the Charter.
Finally, while it is often easy for a good lawyer to concoct an exception to these rules (as we did in Kosovo), we need to be cautious. An exception we come up with to suit our national interests can just as easily be used by future adversaries. Indeed, Russia has used the Kosovo example to justify its aggression in Georgia and Ukraine. Put more plainly, we need to always remember that one person's "humanitarian intervention" is another's aggression. Our examples matter.