From c2c6ee3feee66d288954155c7db1d8087aa5cb5a Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Fri, 23 May 2025 11:49:45 +0200 Subject: [PATCH] add endpoint --- app/api/ip-ranges/ip-ranges.json | 62 ++++++++++++++++++++++++++++++++ app/api/ip-ranges/route.ts | 17 +++++++++ 2 files changed, 79 insertions(+) create mode 100644 app/api/ip-ranges/ip-ranges.json create mode 100644 app/api/ip-ranges/route.ts diff --git a/app/api/ip-ranges/ip-ranges.json b/app/api/ip-ranges/ip-ranges.json new file mode 100644 index 0000000000000..cd44739f09bbd --- /dev/null +++ b/app/api/ip-ranges/ip-ranges.json @@ -0,0 +1,62 @@ +{ + "data": { + "dashboard": { + "sentry_io": [ + "35.186.247.156/32" + ], + "us_sentry_io": [ + "35.186.247.156/32" + ], + "de_sentry_io": [ + "34.36.122.224/32", + "34.36.87.148/32" + ] + }, + "event_ingestion": { + "apex_domain": [ + "35.186.247.156/32" + ], + "organization_subdomains": { + "us": [ + "34.120.195.249/32" + ], + "eu": [ + "34.120.62.213/32", + "130.211.36.74/32" + ] + }, + "legacy": [ + "34.96.102.34/32" + ] + }, + "outbound_requests": { + "us": [ + "35.184.238.160/32", + "104.155.159.182/32", + "104.155.149.19/32", + "130.211.230.102/32" + ], + "eu": [ + "34.141.31.19/32", + "34.141.4.162/32", + "35.234.78.236/32" + ] + }, + "email_delivery": [ + "167.89.86.73", + "167.89.84.75", + "167.89.84.14" + ], + "uptime_monitoring": [ + "34.123.33.225", + "34.41.121.171", + "34.169.179.115", + "35.237.134.233", + "34.85.249.57", + "34.159.197.47", + "35.242.231.10", + "34.107.93.3", + "35.204.169.245" + ] + } +} \ No newline at end of file diff --git a/app/api/ip-ranges/route.ts b/app/api/ip-ranges/route.ts new file mode 100644 index 0000000000000..050b9092fbd16 --- /dev/null +++ b/app/api/ip-ranges/route.ts @@ -0,0 +1,17 @@ +// these ranges are a copy of docs/security-legal-pii/security/ip-ranges.mdx +import ipRanges from './ip-ranges.json'; + +// 12h +const CACHE_DURATION = 12 * 60 * 60; + +export function GET() { + const headers = new Headers({ + 'Content-Type': 'application/json', + 'Cache-Control': `public, max-age=${CACHE_DURATION}`, + 'X-Content-Type-Options': 'nosniff', + 'X-Frame-Options': 'DENY', + 'X-XSS-Protection': '1; mode=block', + }); + + return Response.json(ipRanges, {status: 200, headers}); +}