It is as legal as using the US NAVY to patrol US Territorial Waters.
Actually, I believe that this is tasked to the US Coast Guard, not the Navy.