Fun fact, there is a long standing exemption to the unreasonable search and seizure protection laws if you're out on a boat (it may only be on the open ocean and Great Lakes, though IANAL). One of the earliest Supreme Court rulings essentially said that without it, it would be impossible for the US to enforce tariffs, which were the main source of revenue at the time. Anybody who boats often enough has been boarded by the coast guard for various safety checks that allows them to poke around and there's little you can do about it.

Any “navigable waters” fall under this jurisdiction which at a minimum includes all salt water and the Great Lakes, plus a few other odds and ends rivers and so forth. Indeed, almost all state and landside federal law goes out the window on a boat - a frequently bumped into example by boaters here in Washington is getting a civil penalty flavored reminder from USCG that cannabis is still (for whatever reasons) federally an illegal substance, and having it on a boat at all is an offense (with larger amounts or future violations escalating as far as seizure of the vessel).

Marine laws are nuts.