Skip to content

Commit

Permalink
Throttle public endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Aug 26, 2024
1 parent f009fc9 commit 46e5ca9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
})
->values();
return new JsonResponse($apps, 200, ['Access-Control-Allow-Origin' => '*']);
});
})->middleware('throttle:30,1');

Route::get('/setup/token', function (\Illuminate\Http\Request $request) {

Expand Down Expand Up @@ -91,7 +91,7 @@
'message' => 'The \'system\' token has been generated.',
'token' => $plainTextToken,
], 200, ['Access-Control-Allow-Origin' => '*']);
})->middleware('auth');
})->middleware(['auth', 'throttle:6,1']);

Route::get('/setup/script', function (\Illuminate\Http\Request $request) {

Expand Down Expand Up @@ -177,7 +177,7 @@

return response($installScript, 200)
->header('Content-Type', 'text/plain');
});
})->middleware(['auth', 'throttle:6,1']);

Route::get('/update/{secret}', function (string $secret, \Illuminate\Http\Request $request) {

Expand All @@ -192,7 +192,7 @@

return response($installScript, 200)
->header('Content-Type', 'text/plain');
});
})->middleware('throttle:6,1');

Route::post('/logalert/{secret}', function (string $secret, \Illuminate\Http\Request $request) {

Expand Down Expand Up @@ -259,7 +259,7 @@

return response($config, 200)
->header('Content-Type', 'text/plain');
});
})->middleware('throttle:6,1');

Route::get('/osquery/{secret}', function (string $secret, \Illuminate\Http\Request $request) {

Expand All @@ -274,7 +274,7 @@

return response($config, 200)
->header('Content-Type', 'text/plain');
});
})->middleware('throttle:6,1');

Route::get('/logparser/{secret}', function (string $secret, \Illuminate\Http\Request $request) {

Expand All @@ -289,7 +289,7 @@

return response($config, 200)
->header('Content-Type', 'text/plain');
});
})->middleware('throttle:6,1');

Route::post('/logparser/{secret}', function (string $secret, \Illuminate\Http\Request $request) {

Expand Down

0 comments on commit 46e5ca9

Please sign in to comment.