Optimal Policy For Dynamically Changing System Controls In Moving Target Defense