Skip to content

Commit 9ae5d47

Browse files
oiokipriscilawebdev
authored andcommitted
chore: add good example of SENTRY_DISALLOWED_IPS (#97847)
1 parent 47ca46b commit 9ae5d47

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

src/sentry/conf/server.py

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,54 @@ def env(
114114
INTERNAL_IPS: tuple[str, ...] = ()
115115

116116
# List of IP subnets which should not be accessible
117-
SENTRY_DISALLOWED_IPS: tuple[str, ...] = ()
117+
SENTRY_DISALLOWED_IPS: tuple[str, ...] = (
118+
# # https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv4
119+
# "0.0.0.0/8",
120+
# "10.0.0.0/8",
121+
# "100.64.0.0/10",
122+
# "127.0.0.0/8",
123+
# "169.254.0.0/16",
124+
# "172.16.0.0/12",
125+
# "192.0.0.0/29",
126+
# "192.0.2.0/24",
127+
# "192.88.99.0/24",
128+
# "192.168.0.0/16",
129+
# "198.18.0.0/15",
130+
# "198.51.100.0/24",
131+
# "224.0.0.0/4",
132+
# "240.0.0.0/4",
133+
# "255.255.255.255/32",
134+
# # https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses
135+
# # Subnets match the IPv4 subnets above
136+
# "::ffff:0:0/104",
137+
# "::ffff:a00:0/104",
138+
# "::ffff:6440:0/106",
139+
# "::ffff:7f00:0/104",
140+
# "::ffff:a9fe:0/112",
141+
# "::ffff:ac10:0/108",
142+
# "::ffff:c000:0/125",
143+
# "::ffff:c000:200/120",
144+
# "::ffff:c058:6300/120",
145+
# "::ffff:c0a8:0/112",
146+
# "::ffff:c612:0/111",
147+
# "::ffff:c633:6400/120",
148+
# "::ffff:e000:0/100",
149+
# "::ffff:f000:0/100",
150+
# "::ffff:ffff:ffff/128",
151+
# # https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv6
152+
# "::1/128",
153+
# "::ffff:0:0:0/96",
154+
# "64:ff9b::/96",
155+
# "64:ff9b:1::/48",
156+
# "100::/64",
157+
# "2001:0000::/32",
158+
# "2001:20::/28",
159+
# "2001:db8::/32",
160+
# "2002::/16",
161+
# "fc00::/7",
162+
# "fe80::/10",
163+
# "ff00::/8",
164+
)
118165

119166
# When resolving DNS for external sources (source map fetching, webhooks, etc),
120167
# ensure that domains are fully resolved first to avoid poking internal

0 commit comments

Comments
 (0)