Offloading security services to the cloud infrastructure