Simultaneous transmission and reflection reconfigurable intelligent surface (Star-RIS) has been recently introduced as one of the hopeful technologies in future communications. In this work, we investigate a beamforming design for Star-RIS-assisted secure wireless communications with two practical protocols, namely energy splitting (ES) and mode switching (MS). We assume that our transceivers are not ideal and have residual hardware impairments that lead to distortion noise. We aim to maximize the total secrecy rate by optimizing the beamforming in BS and Star-RIS under the limitation of transmission power consumption. The proposed non-convex optimization problem is solved via successive convex approximation and alternating optimization.