Integrated Space-Terrestrial Network (ISTN) can effectively improve the global communication coverage and SDN framework in ISTN has emerged as a promising solution to guarantee the Quality of Service (QoS). At present, the researches on routing algorithm are mainly focused on the QoS parameters about resource availability and do not consider the impact of the network attacks comprehensively, such as DDoS attack. Plenty of available resources will be occupied by network attacks and normal traffic may be blocked incorrectly by attack defense solutions. In this paper, we propose a Trusted Routing (TR) model based on Trusted Resource Matrix (TRM) to protect the normal traffic from network attacks in ISTN. In the process, the SDN controller constructs the characteristic matrices by collecting the state information of each routing node and the entropy estimation method which describes the changes of traffic characteristics is used to determine whether a routing node is suffering from network attacks. Corresponding trust values are allocated to the routing nodes for constructing TRM and trusted transmission paths are discovered by the TR model. Based on the comprehensive consideration of available and trusted resources, a Hybrid Routing (HR) model is proposed, taking into account the traditional QoS parameters and TRM. In the simulation experiments, the TR and HR models-based algorithms are evaluated. The experimental results show that TR and HR algorithms can effectively avoid the routing nodes suffering from network attacks and improve the communication QoS. When considering a scenario of a single attacked node under resource constraints, the average packet pass rate of HR algorithm is about 7.0% higher than that of TR algorithm and about 52.1% higher than that of traditional QoS algorithm.