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.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
CSPM Cloud Misconfiguration Remediation Prompt
Turn a noisy Cloud Security Posture Management backlog (Prowler, Steampipe, Security Hub, Scout Suite) into a risk-ranked, remediation-ready plan with IaC fixes and guardrails that stop regressions.
-
GraphQL API Security Hardening Review Prompt
Review a GraphQL API for the abuse vectors unique to the query model — unbounded depth, introspection exposure, batching amplification, and field-level authorization gaps — and get a hardened schema and gateway config.
-
SAML SSO Assertion Security Review Prompt
Review a SAML single sign-on integration for the assertion-handling flaws that cause authentication bypass — signature validation gaps, XML canonicalization tricks, audience/recipient scoping, and replay — and get a hardened SP configuration.
-
Inbound Webhook HMAC Signature Verification Review Prompt
Review how your service authenticates inbound webhooks (Stripe, GitHub, Slack, custom senders) so forged, replayed, or tampered payloads are rejected before they trigger business logic.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.