This paper analyses the security performance of a reconfigurable intelligent surface (RIS)-aided unmanned aerial vehicle (UAV) communication system with integrated sensing and communications (ISAC). We consider a multiple-antenna UAV transmitting ISAC waveforms to simultaneously detect an untrusted target in the surrounding environment and communicate with a ground Internet-of-Things (IoT) device in the presence of an eavesdropper (Eve). Given that the Eve can conceal their channel state information (CSI) in practical scenarios, we assume that the CSI of the eavesdropper channel is imperfect. For this RIS-aided ISAC-UAV system, we aim to maximize the average communication secrecy rate by jointly optimizing UAV trajectory, RIS passive beamforming, transmit beamforming, and receive beamforming. However, this joint optimization problem is non-convex due to multi-variable coupling. As such, we solve the optimization using an efficient and tractable algorithm using a block coordinate descent (BCD) method. Specifically, we develop a successive convex approximation (SCA) algorithm based on semidefinite relaxation (SDR) to optimise the joint optimization as four separate non-convex subproblems. Numerical results show that our proposed algorithm can successfully ensure the accuracy of sensing targets and significantly improve the communication secrecy rate of the IoT communication devices.