Over the past few years, products began to appear, that were capable of detecting divers approaching ships or waterside facilities. Now there are underwater weapons that can disable the swimmers.
One of the more recent of the detection systems is the Cerberus360 swimmer detection system. This is a (large) refrigerator size device that is lowered to the ocean floor in the middle of the area you want to guard. Cerberus360 uses sonar to detect anything, large enough to be a threat, up to 800 meters out. Actually, during tests, it was able to detect an approaching underwater scuba swimmer at 900 meters. Cerberus360 works well in shallow water, and can be tweaked by the operator, once emplaced, to be even more accurate.
Al Qaeda groups are know to have bought scuba gear and trained for attacks like this, but none have been attempted yet. But last year, Raytheon Corporation got a patent for a sonar type device that can disable divers as well. The Raytheon "swimmer denial" uses sound waves that are tuned to cause severe gastric distress in humans. Makes you heave into your scuba mask. This makes further underwater operations difficult, if not impossible. However, Raytheon has not announced any timetable for the delivery of these systems. There may not be a large enough market to justify it. For all the talk about scuba equipped terrorists, there have been very few cases of this sort of thing actually happening. Most have been off Israel, where the Israelis have been able to deal with the problem without using an acoustic swimmer denial system.