Explain how a Server-Side Request Forgery (SSRF) attack works and how you would prevent it in a cloud environment.