This paper presents a security-aware topology control scheme for wireless ad-hoc networks. The proposed topology algorithm builds a connected network based on the security level of each node, in the presence of a security threat such as the denial of service attack. The existing topology control schemes are primarily concentrated on optimizing parameters such as the energy consumption, while maintaining a satisfying connectivity level. Security issues are usually addressed on higher layers. This approach demands significant amount of energy and processing power from the participating entities and increases the complexity. Our work extends the topology control schemes by making security the primary concern. First we detect the nodes that participate in a DoS attack. Then we introduce the reputation metric that quantifies the results of this detection. Finally, we use this metric as the edge weight in the local minimum spanning tree algorithm that builds a connected topology. Hence we can isolate the malicious nodes and exclude them if they are already part of the topology and thus create a secure wireless network. The proposed scheme can also be integrated in any of the existing topology control algorithms. Our main contributions are: ldr a probabilistic model for detecting and isolating the malicious nodes that participate in a denial of service attack ldr a lightweight reputation metric that quantifies the results of the detection phase ldr a modified local minimum spanning tree algorithm, that performs topology formation and creates a connected and secure network. We also provide the convergence analysis for the detection scheme.