Hugo Grotius, the 17th century jurist and father of public international law, stated in his 1625 magnum opus The Law of War and Peace that "Most Men assign three Just Causes of War, Defence, the Recovery of what's our own, and Punishment."
Article 51 of the UN Charter states the following:
Article 51: Nothing in the present Charter shall impair the inherent right of collective or individual self-defense if an armed attack occurs against a member of the United Nations, until the Security Council has taken the measures necessary to maintain international peace and security. Measures taken by members in exercise of this right of self-defense 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.
International law recognizes a right of self-defence, as the International Court of Justice (ICJ) affirmed in the Nicaragua Case on the use of force. Some commentators believe that the effect of Article 51 is only to preserve this right when an armed attack occurs, and that other acts of self-defence are banned by article 2(4). The more widely held opinion is that article 51 acknowledges this general right, and proceeds to lay down procedures for the specific situation when an armed attack does occur. Under the latter interpretation, the legitimate use of self-defence in situations when an armed attack has not actually occurred is still permitted. It is also to be noted that not every act of violence will constitute an armed attack. The ICJ has tried to clarify, in the Nicaragua case, what level of force is necessary to qualify as an armed attack.
The traditional customary rules on self-defence derive from an early diplomatic incident between the United States and the United Kingdom over the killing of one US citizen engaged in an attack on Canada, then a British colony. The so-called Caroline case established that there had to exist "a necessity of self-defence, instant, overwhelming, leaving no choice of means, and no moment of deliberation,' and furthermore that any action taken must be proportional, "since the act justified by the necessity of self-defence, must be limited by that necessity, and kept clearly within it." These statements by the US Secretary of State to the British authorities are accepted as an accurate description of the customary right of self-defence. (Dan Webster, Yale Law School)