A logical approach to cyber security