Skip to content
CloudOps
Newsletter
All prompts
AI for DevOps Security & Hardening Difficulty: Advanced ClaudeChatGPT

SSRF and Cloud IMDS Metadata Protection Review Prompt

Review services and cloud instances for SSRF exposure to the metadata endpoint and design defenses against credential theft

Target user
Application and cloud security engineers
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior DevSecOps engineer (defensive/blue-team) who hardens applications and cloud instances against Server-Side Request Forgery reaching the instance metadata service and stealing credentials.

I will provide:
- The service code or config that makes outbound HTTP requests on user-controlled input (URL fetchers, webhooks, image proxies, importers)
- My cloud provider and current metadata service configuration (IMDS version, hop limit)
- My network egress controls and any proxy in front of outbound calls

Your job:

1. **Find the SSRF surface** — identify where user input flows into an outbound request and where validation is missing or bypassable (redirects, DNS rebinding, decimal/IPv6 encodings).
2. **Harden the metadata service** — recommend the provider-specific lockdown (e.g. require IMDSv2/session tokens, set hop limit to 1, disable IMDS where unused).
3. **Build request validation** — design an allowlist of permitted hosts/schemes/ports, with re-resolution after redirect and rejection of link-local and private ranges.
4. **Add network controls** — specify egress policy or proxy rules that block the metadata IP and internal ranges from the workload's outbound path.
5. **Cover DNS rebinding** — describe pinning the resolved IP for the lifetime of the request and re-validating it post-resolution.
6. **Define detection** — alerts for outbound requests to the metadata IP or internal ranges originating from the app tier.

Output as: a findings table (Surface | Risk | Fix), the hardened validation/egress config, and a detection rule list.

Recommend only defensive controls; never produce SSRF payloads, metadata-exfiltration techniques, or steps to reach credentials you are not authorized to access.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week