@@ -4,7 +4,7 @@ import { proxyToSandbox } from '@cloudflare/sandbox';
44import { isDispatcherAvailable } from './utils/dispatcherUtils' ;
55import { createApp } from './app' ;
66import * as Sentry from '@sentry/cloudflare' ;
7- import { sentryOptions , captureSecurityEvent } from './observability/sentry' ;
7+ import { sentryOptions } from './observability/sentry' ;
88
99// Durable Object and Service exports
1010export { UserAppSandboxService , DeployerService } from './services/sandbox/sandboxSdkClient' ;
@@ -43,7 +43,6 @@ async function handleUserAppRequest(request: Request, env: Env): Promise<Respons
4343 logger . info ( `Sandbox miss for ${ hostname } , attempting dispatch to permanent worker.` ) ;
4444 if ( ! isDispatcherAvailable ( env ) ) {
4545 logger . warn ( `Dispatcher not available, cannot serve: ${ hostname } ` ) ;
46- captureSecurityEvent ( 'dispatcher_unavailable' , { hostname } , { level : 'error' } ) ;
4746 return new Response ( 'This application is not currently available.' , { status : 404 } ) ;
4847 }
4948
@@ -56,9 +55,7 @@ async function handleUserAppRequest(request: Request, env: Env): Promise<Respons
5655 return await worker . fetch ( request ) ;
5756 } catch ( error : any ) {
5857 // This block catches errors if the binding doesn't exist or if worker.fetch() fails.
59- logger . error ( `Error dispatching to worker '${ appName } ': ${ error . message } ` ) ;
60- captureSecurityEvent ( 'dispatch_error' , { subdomain : appName , hostname } , { level : 'error' , error } ) ;
61- // Return a generic error to the user to avoid leaking implementation details.
58+ logger . warn ( `Error dispatching to worker '${ appName } ': ${ error . message } ` ) ;
6259 return new Response ( 'An error occurred while loading this application.' , { status : 500 } ) ;
6360 }
6461}
@@ -82,7 +79,6 @@ const worker = {
8279 // 2. Security: Immediately reject any requests made via an IP address.
8380 const ipRegex = / ^ \d { 1 , 3 } \. \d { 1 , 3 } \. \d { 1 , 3 } \. \d { 1 , 3 } $ / ;
8481 if ( ipRegex . test ( hostname ) ) {
85- captureSecurityEvent ( 'forbidden_ip_access' , { hostname } , { level : 'warning' } ) ;
8682 return new Response ( 'Access denied. Please use the assigned domain name.' , { status : 403 } ) ;
8783 }
8884
@@ -112,9 +108,6 @@ const worker = {
112108 return handleUserAppRequest ( request , env ) ;
113109 }
114110
115- // Route 3: Catch-all for invalid hostnames.
116- // This is a security measure to prevent unauthorized domains from accessing the worker.
117- captureSecurityEvent ( 'invalid_hostname' , { hostname } , { level : 'warning' } ) ;
118111 return new Response ( 'Not Found' , { status : 404 } ) ;
119112 } ,
120113} satisfies ExportedHandler < Env > ;
0 commit comments