Designing virus-resistant networks