On Stochastic Modeling Applications to Cybersecurity: Loss, Attack, and Detection