With the growing interest that is being shown in marine resources, the concept of the internet of things (IoT) has been extended to underwater scenarios, which has given rise to the internet of underwater things (IoUT). The IoUT encompasses a network of interconnected intelligent underwater devices that can be used to monitor underwater environments and support various applications, such as underwater exploration, disaster prevention, and environmental monitoring. Advances in underwater wireless communication and sensor technologies have propelled the IoUT concept forward. However, the IoUT faces significant challenges. The harsh and vast underwater environment make information sensing particularly difficult and lead to insufficient or inaccurate data being collected. Additionally, underwater conditions like pressure variation, hydrological characteristics, temperature changes, water currents, and topography hinder conventional communication models and make data transmission difficult and inefficient. Security in IoUT networks is a critical concern due to hardware limitations and seawater channel imperfections. Constrained sensor nodes and spatial-temporal uncertainty introduced by node mobility further complicate security provisioning. This survey paper addresses these challenges by offering a comprehensive overview of IoUT security. The investigation thoroughly examines both traditional and classic machine learning techniques, and focuses on deploying advanced technologies such as federated learning and digital twin. The study effectively addresses integration challenges and open issues, and provides a roadmap for future directions to play a pivotal role in formulating robust security mechanisms for IoUT networks.