## 3 Prototype Description and Implementation
### Security Threat Analysis  
As it has been previously mentioned, security is a feature of critical importance in this proposal, which distinguishes it from the ones studied in the existing literature within the application domain of this manuscript. For this purpose, a security analysis has been carried out, so that not only the main threats for the whole system are known, but also their location and how these threats could disrupt it. The main source of cybersecurity threats and the possibility for attacks comes from the facts that the UAV must receive commands in a remote manner (which implies an interchange of data according with the communication protocols used) and data received from the UAV will have to be stored at some location (even if the location is part of a decentralized subsystem). Consequently, wireless communications between the CGS and the UAV, the infrastructure for data storage itself and any other communication between the infrastructure for data storage and the UAV are locations where cybersecurity-based attacks could take place. These threats can be countered by guaranteeing that any system built based on CPS components will provide a collection of security characteristics that is characterized in the following manner:  
1. Confidentiality. It is expected that the data that has been collected from the UAV will not be accessible by any unwanted party during the transfer procedures, so that they will not become exposed (as described in [5]). However, any party that has a genuine interest in the information (i.e., farm supervisor, foodstuff quality inspectors, consumers that demand it) will be granted access to this information whenever they request to have it. 2. Integrity. Data is expected to be stored in the exact same way that it was collected from the application domain where it was, so that information that can be inferred from those data is legit and not based on false assumptions. While confidentiality is a valuable feature in the system put forward in this manuscript, data integrity is of critical importance, as it will be used by several parties of very significant importance for the farm (supervisors, owners, quality organisms, information verifiers) and the cattle present in it. 3. Authentication. It is a security characteristic aimed to provide some form of valid identification that will be revoked, if needed, if any issue takes place. Failure to provide a proper identification should result in negative consequences for the spurious user. 4. Availability. This feature is related to the capability of a system to keep itself, or its features, accessible for end users without any unexpected issue, such as the ones that would be found whenever a Denial of Service (DOS) or Distributed Denial of Service (DDOS) attack are taking place. For the context of our proposal, it is the capability to keep the collected information available. As far as the works presented in this manuscript are concerned, the most important security features are Integrity (since information will be shared among all the participants of an IPFS-based network, either from accessing the stored files or via the blockchain implementation that has been carried out) and Availability (information collected from the UAV will be displayed for all the participants in the network). In addition to this, hardware agents in the de facto CPS that this proposal consists of must be taken into consideration, so that their role in the system and the vulnerabilities they carry with them can be countered.