Absolutely it is. Always has been. The LAWS for the high seas have been established for centuries.
Try and educate yourself on the subject.
Are you banned by google?
The exact wording of Article 101 of the United Nations Convention on the Law of the Sea (UNCLOS) reads as follows:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Article 101
Definition of piracy
Piracy consists of any of the following acts:
(a) Any illegal acts of violence or detention, or any act of depredation, committed for private ends by the crew or the passengers of a private ship or a private aircraft, and directed:
(i) On the high seas, against another ship or aircraft, or against persons or property on board such ship or aircraft;
(ii) Against a ship, aircraft, persons or property in a place outside the jurisdiction of any State;
(b) Any act of voluntary participation in the operation of a ship or of an aircraft with knowledge of facts making it a pirate ship or aircraft;
(c) Any act inciting or of intentionally facilitating an act described in subparagraph (a) or (b).
⎯⎯⎯⎯⎯⎯⎯⎯⎯
And even if a military ship has a reason to suspect a civilian ship in piracy, it doesn't mean that it has right just to sink it at sight.
Here is the text of Article 110 from the United Nations Convention on the Law of the Sea (UNCLOS):
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Article 110
Right of visit
1. A warship which has reasonable grounds for suspecting that a foreign ship (other than a ship entitled to complete immunity in accordance with articles 95 and 96) is engaged in any of the acts referred to in article 111 may proceed to verify the ship's right to fly its flag. To this end, verification may be effected by hailing the ship in question and inspecting its documents.
2. If after inspection it is clear that the suspicion was unjustified, the ship shall be compensated for any loss or damage that may have been sustained.
3. The right of visit may be exercised only if there are reasonable grounds for suspecting one of the following:
(a) That the ship is engaged in piracy;
(b) That the ship is engaged in the slave trade;
(c) That although flying a foreign flag or refusing to show its flag, the ship is, in reality, of the same nationality as the warship.
4. In cases where the nationality of the ship cannot be determined beyond doubt, it may also be visited.
5. In all cases, the exercise of the right of visit must be carried out with due regard for the safety of persons, ships and cargo and without causing undue delay.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
The USA has bilateral treaties, allowing inspections of civilian ships, suspected in drug trafficking in high seas, with following countries: Colombia, Mexico, Peru, Guatemala, Ecuador. The USA has no right even to inspect civilian ships belonging to other countries.