fix: throttle denied-authentication audit rows per source, never turn a denial into a 500, prune old audit events

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 21:04:46 +07:00
parent d356c313ce
commit 2931032ab7
6 changed files with 250 additions and 42 deletions

View File

@@ -30,6 +30,7 @@ async fn main() -> Result<()> {
let addr: SocketAddr = listen.parse()?;
let admin = admin::AdminGate::from_env()?;
admin.validate_listener(addr)?;
let audit_retention = scheduler::audit_retention_from_env()?;
let wormhole = mtls::from_env()?;
if let Some(config) = &wormhole {
admin.validate_listener(config.listen)?;
@@ -81,6 +82,7 @@ async fn main() -> Result<()> {
state.configure_offsite()?;
state.reconcile_capture_catalog().await?;
state.start_offsite_worker();
scheduler::start_audit_retention(state.db.clone(), audit_retention);
scheduler::start_orbit_scheduler(state.clone()).await?;
refresh::start(state.clone());
if state.sessions.enabled() {