Sensing and physical layer security are among the key features of sixth-generation wireless networks. New security issues are emerging due to the proliferation of integrated sensing and communication applications, particularly in human activity monitoring and environment imaging. One way to achieve sensing is utilizing the communication signals' channel state information (CSI), namely CSI-based sensing. A malicious node with access to pilot information can obtain CSI and perform sensing to get vital information about a target. Therefore, the pilot information must be secured to prevent the acquisition of CSI by a malicious node for secure sensing and communication. This paper proposes a secure pilot allocation method to conceal the pilot location information from malicious nodes while securing communication and sensing data. Additionally, an adaptive power allocation method is provided to overcome the performance deterioration that occurs during the receiver's pilot location detection. Finally, the proposed algorithms' performance gains are investigated, and insightful conclusions are drawn.