Defending against the Advanced Persistent Threat: An Optimal Control Approach. (27th February 2018)