Optimal Spending on Cybersecurity Measures (Risk Management)