As the number of Internet of Things (IoT) subscribers, services, and applications grows, there is a pressing need for a reliable and lightweight security solution that can be used in IoT contexts. Also, due to the open nature of cloud computing, safety concerns are always challenging. One potential solution for this problem is an intrusion detection system (IDS). An ID that utilizes a machine learning method is gaining popularity since it has the benefit of automatically updating to fight against any new form of attack. Due to the importance of IDS in cloud-based IoT, the main articles and essential techniques in this domain are examined systematically. In cloud-based IoT, IDSs are categorized into three major categories, including learning-based, pattern-based, and rule-based mechanisms. The findings illustrate that the biggest challenge in IDS is precision and detection, which many researchers are trying to improve. Also, with the rise of connected objects, the most frequently utilized centralized (cloud-based) IDS struggles with excessive latency and network overhead, leading to delayed detection of unauthorized users and unresponsiveness to assaults. The results will be valuable for academicians, and they can offer visions for future research.