In this study, the authors investigate the physical-layer security in a cognitive radio network where both the secondary user (SU) and the primary user (PU) are facing security threats from the malicious eavesdroppers. To protect the PU, the SU acts as a friendly jammer to interfere with the eavesdroppers by splitting a certain portion of the transmit power for sending the jamming noise. The problem of optimising SU scheduling, power allocation and power splitting ratio to maximise the SU ergodic secrecy rate subject to the PU secrecy outage constraint with imperfect channel state information available at the SU is investigated based on the dual optimisation method. In addition, a greedy algorithm is also proposed for minimising the PU secrecy outage probability. Simulation results indicate that the proposed algorithms are effective in improving the PU secrecy performance in terms of secrecy outage probability as well as providing secure communications for the SU.