Real-life utility networks such as smart grids, pipelines, and water networks can be exposed to safety- and security-related risk. To mitigate the risks that might result in service interruptions for the users of these networks, countermeasures can be applied. In this paper, a decision model is proposed that assumes that all edges (e.g., pipes, cables) and nodes (e.g., switching or connection stations, substations in an electricity network) have a certain probability of failing, which can be reduced by applying appropriate security strategies. An optimization model is developed that determines the optimal security strategy to be applied to each node and each arc so as to minimize the probability for disconnected node pairs to arise in the network, subject to a budget constraint. A metaheuristic approach to solve this problem has been proposed. The metaheuristic is calibrated in a statistical experiment and detailed experiments on realistic instances confirm that it performs well.