The post you are reporting:
United Nations Convention on the Law of the Sea (UNCLOS)
Passage is innocent so long as it is not prejudicial to the peace, good order or security of the coastal State. Such passage shall take place in conformity with this Convention and with other rules of international law.
Passage of a foreign ship shall be considered to be prejudicial to the peace, good order or security of the coastal State if in the territorial sea it engages in any of the following activities
(a) any threat or use of force against the sovereignty, territorial integrity or political independence of the coastal State, or in any other manner in violation of the principles of international law embodied in the Charter of the United Nations;
(b) any exercise or practice with weapons of any kind;
(c) any act aimed at collecting information to the prejudice of the defence or security of the coastal State;
(d) any act of propaganda aimed at affecting the defence or security of the coastal State;
(e) the launching, landing or taking on board of any aircraft;
(f) the launching, landing or taking on board of any military device;
(g) the loading or unloading of any commodity, currency or person contrary to the customs, fiscal, immigration or sanitary laws and regulations of the coastal State
Article 25. Rights of protection of the coastal State
1. The coastal State may take the necessary steps in its territorial sea to prevent passage which is not innocent.
2. In the case of ships proceeding to internal waters or a call at a port facility outside internal waters, the coastal State also has the right to take the necessary steps to prevent any breach of the conditions to which admission of those ships to internal waters or such a call is subject.
3. The coastal State may, without discrimination in form or in fact among foreign ships, suspend temporarily in specified areas of its territorial sea the innocent passage of foreign ships if such suspension is essential for the protection of its security, including weapons exercises. Such suspension shall take effect only after having been duly published.