Securing a software-defined network