Securing network from attacks