We know that the key technologies that are involved in the Internet of Things are wireless sensor networks and cloud computing, big data, embedded systems, and the internet. It is a giant network with connected devices. These devices gather and share data. But many IoT devices have poor security and cybercriminals are taking benefit of this. The two techniques cloud and fog computing both combined can be used to transfer secure data in IoT devices as cloud computing provides storage of data on cloud servers and fog computing offers us various services to access data and provides support for cloud servers. This research work presents various techniques to detect an intruder and anomaly detection in IoT-based cloud systems. Also, a comparison of all the techniques used to detect intruders and anomalies are compared on various parameters like accuracy, performance, efficiency, precision, recall, the detection rate.