The paper shows how the mathematical tools of the theory of controlled Markov fields can be applied to model catastrophic risks caused by natural events or terrorist threats. The examples of problem statements of long-term investment in security are given. A survey of solution methods for stochastic optimal control problems is proposed. It is shown that these problems can be reduced to finite-dimensional stochastic programming problems and can be solved by the stochastic quasigradient method.