We propose a system theoretic approach to the identification and mitigation of vulnerabilities to cyber attacks, in networks of dynamical systems. Using the controllability and observability gramians, we define a network's vulnerability in terms of the impact of an attack input and the degree of difficulty with which this impact can be detected. In this framework, a network is deemed as vulnerable if it is easy for an attacker to steer it to a certain state and yet such a state is hard to observe through the network's sensing mechanisms. We propose strategies for finding the optimal location of a small number of sensors that minimize the network's vulnerability. Such strategies are obtained as the solution of convex optimization problems, formulated so as to strike a balance between maximal reduction of the system's vulnerability and employing a minimal number of sensors. The utility of the developed framework is demonstrated on a standard IEEE nine bus power system network model.