# Blockchain-Based Cloud-Enabled Security Monitoring Using Internet of Things in Smart Agriculture
###### Abstract  
The Internet of Things (IoT) has rapidly progressed in recent years and immensely influenced many industries in how they operate. Consequently, IoT technology has improved productivity in many sectors, and smart farming has also hugely benefited from the IoT. Smart farming enables precision agriculture, high crop yield, and the efficient utilization of natural resources to sustain for a longer time. Smart farming includes sensing capabilities, communication technologies to transmit the collected data from the sensors, and data analytics to extract meaningful information from the collected data. These modules will enable farmers to make intelligent decisions and gain profits. However, incorporating new technologies includes inheriting security and privacy consequences if they are not implemented in a secure manner, and smart farming is not an exception. Therefore, security monitoring is an essential component to be implemented for smart farming. In this paper, we propose a cloud-enabled smart-farm security monitoring framework to monitor device status and sensor anomalies effectively and mitigate security attacks using behavioral patterns. Additionally, a blockchain-based smart-contract application was implemented to securely store security-anomaly information and proactively mitigate similar attacks targeting other farms in the community. We implemented the security-monitoring-framework prototype for smart farms using Arduino Sensor Kit, ESP32, AWS cloud, and the smart contract on the Ethereum Rinkeby Test Network and evaluated network latency to monitor and respond to security events. The performance evaluation of the proposed framework showed that our solution could detect security anomalies within real-time processing time and update the other farm nodes to be aware of the situation. s 28 July 20202  
also higher due to the direct impact of sudden natural calamities on agriculture if farmers are not prepared for unexpected situations. The emergence of technologies such as the Internet of Things (IoT) changed the landscape of how farming is performed and enhanced operating capabilities in the agriculture sector [2]. The integration of IoT technology within agriculture and farming is termed smart agriculture and smart farming. The global agriculture robot market is predicted to reach USD 15.93 billion by 2028, with an annual compound growth rate of 20.31% during 2021-2028 [3]. The agriculture sector is becoming a soft target for adversaries to launch cyber attacks, as digital infrastructure integration within agriculture is growing and the agriculture economy market is thriving. For instance, a meat processing company, JBS, in food supply suffered a ransomware attack, which resulted in the halting of 13 meat plant operations. The company had to pay USD 11 million dollars ransom to bring back the operations [4]. Therefore, security is considered a massive problem in sectors such as agriculture, and advancement in agriculture security solutions is highly desired. Smart agriculture and farming may produce high crop yields, and efficient usage of resources to improve productivity [5]. The recent trends in IoT show that smart agriculture is one of the potential applications for IoT for major process improvements [6; 7]. Several IoT applications in smart agriculture include soil-state monitoring, pest-control monitoring, crop-growth monitoring, animal-herd monitoring, water-level control, environmental-condition monitoring, and more. Sensor devices are installed on the farm near the premises and surrounding the agriculture area to sense the operating and environmental conditions and convert the sensed analog data into a digital form. Some of the most prominent sensors in smart agriculture include temperature, humidity, light, and pressure and proximity sensors. These sensing devices are connected to the internet through edge gateways or routers to constantly update the sensing information in the cloud.