Skip to content

Commit bfff24d

Browse files
chargomeantonpirker
authored andcommitted
feat(platform): Add endpoint for serving Sentry ip-ranges (#13819)
This PR adds a new API endpoint that serves Sentry's IP ranges in JSON format. - Added new API endpoint at `api/ip-ranges` - Implemented structured JSON response with IP ranges organized by category: - Dashboard and API IPs - Event Ingestion IPs - Outbound Requests IPs - Email Delivery IPs - Uptime Monitoring IPs - Added security headers and caching (12 hours) cc @bruno-garcia lmk if that works for you
1 parent 4eab792 commit bfff24d

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

app/api/ip-ranges/ip-ranges.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"data": {
3+
"dashboard": {
4+
"sentry_io": [
5+
"35.186.247.156/32"
6+
],
7+
"us_sentry_io": [
8+
"35.186.247.156/32"
9+
],
10+
"de_sentry_io": [
11+
"34.36.122.224/32",
12+
"34.36.87.148/32"
13+
]
14+
},
15+
"event_ingestion": {
16+
"apex_domain": [
17+
"35.186.247.156/32"
18+
],
19+
"organization_subdomains": {
20+
"us": [
21+
"34.120.195.249/32"
22+
],
23+
"eu": [
24+
"34.120.62.213/32",
25+
"130.211.36.74/32"
26+
]
27+
},
28+
"legacy": [
29+
"34.96.102.34/32"
30+
]
31+
},
32+
"outbound_requests": {
33+
"us": [
34+
"35.184.238.160/32",
35+
"104.155.159.182/32",
36+
"104.155.149.19/32",
37+
"130.211.230.102/32"
38+
],
39+
"eu": [
40+
"34.141.31.19/32",
41+
"34.141.4.162/32",
42+
"35.234.78.236/32"
43+
]
44+
},
45+
"email_delivery": [
46+
"167.89.86.73",
47+
"167.89.84.75",
48+
"167.89.84.14"
49+
],
50+
"uptime_monitoring": [
51+
"34.123.33.225",
52+
"34.41.121.171",
53+
"34.169.179.115",
54+
"35.237.134.233",
55+
"34.85.249.57",
56+
"34.159.197.47",
57+
"35.242.231.10",
58+
"34.107.93.3",
59+
"35.204.169.245"
60+
]
61+
}
62+
}

app/api/ip-ranges/route.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// these ranges are a copy of docs/security-legal-pii/security/ip-ranges.mdx
2+
import ipRanges from './ip-ranges.json';
3+
4+
// 12h
5+
const CACHE_DURATION = 12 * 60 * 60;
6+
7+
export function GET() {
8+
const headers = new Headers({
9+
'Content-Type': 'application/json',
10+
'Cache-Control': `public, max-age=${CACHE_DURATION}`,
11+
'X-Content-Type-Options': 'nosniff',
12+
'X-Frame-Options': 'DENY',
13+
'X-XSS-Protection': '1; mode=block',
14+
});
15+
16+
return Response.json(ipRanges, {status: 200, headers});
17+
}

0 commit comments

Comments
 (0)