The Coast Guard port captain can and does put restrictions on how close you can get to large vessels. A security zone is done with large passenger vessels frequently. There is also a security zone set up with large petroleum vessels on the SF Bay.
For San Francisco, Monterey and Humboldt Bays there are security zones in effect for all tankers, cruise ships and "High Interest Vessels." The security zones do not apply to ferries.