Files
fotospiel-app/docs/deployment/join-token-analytics.md
Codex Agent 6290a3a448 Fix tenant event form package selector so it no longer renders empty-value options, handles loading/empty
states, and pulls data from the authenticated /api/v1/tenant/packages endpoint.
    (resources/js/admin/pages/EventFormPage.tsx, resources/js/admin/api.ts)
  - Harden tenant-admin auth flow: prevent PKCE state loss, scope out StrictMode double-processing, add SPA
    routes for /event-admin/login and /event-admin/logout, and tighten token/session clearing semantics (resources/js/admin/auth/{context,tokens}.tsx, resources/js/admin/pages/{AuthCallbackPage,LogoutPage}.tsx,
    resources/js/admin/router.tsx, routes/web.php)
2025-10-19 23:00:47 +02:00

2.0 KiB
Raw Blame History

Join Token Analytics & Alerting (SEC-GT-02)

Data Sources

  • Table event_join_token_events captures successes, failures, rate-limit hits, and uploads per join token.

  • Each row records route, device id, IP, HTTP status, and context for post-incident drill downs.

  • Logged automatically from EventPublicController for /api/v1/events/* and /api/v1/gallery/*.

  • Super Admin: Event resource → “Join Link / QR” modal now summarises total successes/failures, rate-limit hits, 24h volume, and last activity timestamp per token.

  • Tenant Admin: identical modal surface so operators can monitor invite health.

Alert Thresholds (initial)

  • Rate limit spike: >25 token_rate_limited entries for a token within 10 minutes → flag in monitoring (Grafana/Prometheus TODO).
  • Failure ratio: failure_count / success_count > 0.5 over rolling hour triggers warning for support follow-up.
  • Inactivity: tokens without access for >30 days should be reviewed; scheduled report TBD.

Rate-limiter knobs (see .env.example):

  • JOIN_TOKEN_FAILURE_LIMIT / JOIN_TOKEN_FAILURE_DECAY — repeated invalid attempts before temporary block (default 10 tries per 5min).
  • JOIN_TOKEN_ACCESS_LIMIT / JOIN_TOKEN_ACCESS_DECAY — successful request ceiling per token/IP (default 120 req per minute).
  • JOIN_TOKEN_DOWNLOAD_LIMIT / JOIN_TOKEN_DOWNLOAD_DECAY — download ceiling per token/IP (default 60 downloads per minute).

Follow-up Tasks

  1. Wire aggregated metrics into Grafana once metrics pipeline is ready (synthetic monitors pending SEC-GT-03).
  2. Implement scheduled command to email tenants a weekly digest of token activity and stale tokens.
  3. Consider anonymising device identifiers before long-term retention (privacy review).

Runbook Notes

  • Analytics table may grow quickly for high-traffic events; plan nightly prune job (keep 90 days).
  • Use php artisan tinker to inspect token activity: EventJoinTokenEvent::where('event_join_token_id', $id)->latest()->limit(20)->get().