In this paper, we investigate the physical layer security (PLS) of a cognitive radio network (CRN) assisted by a reconfigurable intelligent surface (RIS) based on discrete phase control. Specifically, the phase shifts of the RIS are designed to maximize the received signal-to-noise ratio (SNR) at the secondary receiver. In the presence of passive eavesdropping, we address the secrecy outage performances for the considered system under two different scenarios whether the direct link exists or not. To characterize the performance, novel exact expressions of secrecy outage probability (SOP) are derived leveraging the Gaussian–Chebyshev quadrature. We also conduct the asymptotic analysis to study the influence of the main parameters such as the number of reflect elements of RIS and the number of quantization bits on the secrecy performance of our proposed system. Finally, our analytical results are verified through performing Monte Carlo simulations. Simulation results show that significant security enhancement can be achieved in CRN by employing the RIS.