Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: use empty allow list for restrict all access (#22023)

divitdba739914546
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx
index bec2b653ee3..6f88f8c5468 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/DisallowAllModal.tsx
@@ -18,8 +18,8 @@ const DisallowAllModal = ({ visible, onClose }: DisallowAllModalProps) => {
if (!ref) return console.error('Project ref is required')
await applyNetworkRestrictions({
projectRef: ref,
- dbAllowedCidrs: ['127.0.0.1/32'],
- dbAllowedCidrsV6: ['::1/128'],
+ dbAllowedCidrs: [],
+ dbAllowedCidrsV6: [],
})
}
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
index e9ca3edfdf1..f6e070acf78 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
@@ -112,10 +112,7 @@ const NetworkRestrictions = () => {
const hasApplyError = restrictionStatus === 'stored'
const isUninitialized = restrictedIps.length === 0 && restrictionStatus.length === 0
const isAllowedAll = restrictedIps.includes('0.0.0.0/0') && restrictedIps.includes('::/0')
- const isDisallowedAll =
- restrictedIps.length === 2 &&
- restrictedIps.includes('127.0.0.1/32') &&
- restrictedIps.includes('::1/128')
+ const isDisallowedAll = restrictedIps.length === 0
if (!hasAccessToRestrictions) return <></>