Nowadays, security has become an important issue for organizations especially in e-commerce applications. The spreading of networks and increasing of their complexity has complicated the task of security analysis, therefore automatic approaches have received more attention recently. This paper proposes a model-based approach to analyze the overall security of a network, based on the interaction of hosts within the network. A simple language is introduced for modeling security related behaviours of networks and systems. Using the language, a case study is described and its formal model and security properties are presented.