Unmanned aerial vehicles (UAVs) have recently attracted many researchers' attention because of their extensive applications. Security issues, in particular, are a serious concern in such networks since the top-secret information exchanged between UAVs is susceptible to various attacks such as Sybil, blackhole, and Flooding attacks. To identify such malicious UAVs that threaten the connections between normal UAVs, we introduce an impermeability method called SID-UAV that works at the level of UAV-to-UAV. The SID-UAV method, by employing a self-adaptive system, discovers the most reliable route from origin to destination. This approach deals with finding the malicious UAV and selecting the most reliable routes in several phases, including the route discovery phase, the decision-making phase, the attacker counter phase, and the knowledge database phase by using multi-module methods and applying Human Immune System (HIS). In the SID-UAV method, three main modules are intended: route analysis module, decision module, and defense module. Each of these modules has sub-modules and is distributed in different parts in UAV networks. Each module and its sub-modules have tasks, and all of these modules are connected to the knowledge base to record information in it and use the stored information quickly. The NS-3 simulator tool is exploited to simulate the proposed method. The results gained from simulation indicated that the SID-UAV method in criteria of Average Detection Ratio (ADR), Average Packet Delivery Ratio (APDR), Average Packet Lost Ratio (APLR), Average False Positive (AFP), Average False Negative (AFN) have acceptable performance relative to BRUIDS, SFA, and SUAS-HIS methods.