A data-driven strategy for cybersecurity