Systems of systems (SoS) are large-scale systems composed of complex systems with difficult to predict emergent properties. One of the most significant challenges in the engineering of such systems if how to The Smart Grid, the next generation power grid, comes with promises of widely distributed automated energy delivery, self-monitoring, self-healing, energy efficiency, utility and cost optimization. However, as attacks on the current power grid and similar systems indicate, the Smart Grid will be vulnerable to all kinds of attacks and will even raise new security challenges, due to its complex nature. In this paper we analyze this complexity of the Smart Grid as a System of Systems, and the specific security challenges it raises. To address these challenges we propose a vision/framework based on principles of Software Engineering. This framework structures and brings together the research on Smart Grid security.