Repository navigation
Socrate v1.16.0
Feature release on the v1.x line. The monitoring alert rules, stored until now but never
evaluated, are evaluated under a new mode, and a fresh install starts with a recommended set of
them; a redirect URI can be required to match its registration exactly. Both controls ship
off (ALERT_RULES_MODE, REDIRECT_URI_MATCH_MODE). One migration, no change of default, no
change to discovery, claims or error codes.
Upgrade notes
- Migration 0037 (
AUTO_MIGRATE=false: run it deliberately, after a backup). It adds the seven
default alert rules only ifalert_rulesis empty, touches no other table and rewrites no data;
on a fresh install it createsalert_rules. - Alert rules: nothing is evaluated until
ALERT_RULES_MODEis set. Runobserve, read the
alert history in the monitoring console (v1.3.0 shows the mode on its Alerts page), add
recipients or a webhook URL to the rules you keep, thenenforce. Email needs SMTP configured. - Exact redirect URIs: run
REDIRECT_URI_MATCH_MODE=observeand look for
redirect_uri_inexact_matchevents (the consoles' callbacks included) beforeenforce.
Added
- Alert rules are evaluated (
ALERT_RULES_MODE, defaultoff, #258). Rules could be created in
the monitoring console, but nothing evaluated them, so no alert was ever raised. Underobserve,
everyALERT_RULES_INTERVAL_SECONDS(default 60) each enabled rule counts its event type in its
window, per group of itsgroup_by; a group that reaches the threshold records a triggered
alert (alert history, analert_triggeredsecurity event), once per group and window.enforce
also sends the rule's notifications: email to its recipients (needs SMTP), its alert as JSON to
itswebhook_url, or a Slack message, overhttpsto a public address through the SSRF guard.
Each alert records the outcome of each notification. With several instances, one evaluates at a
time.GET /api/admin/alerts/rulesreports the mode asevaluation_mode.docs/ALERT-RULES.md
no longer documents actions, severities and a condition field that never existed (log,
block_ip,high/medium/low/info,match_value). Deploy note: new variables
ALERT_RULES_MODE(defaultoff) andALERT_RULES_INTERVAL_SECONDS; runobservefirst and
read the alert history beforeenforce. - Default alert rules (migration 0037). A fresh install, or a server upgraded without any rule,
starts with seven: brute force from one IP, account under attack, account locked, refresh token
reused, revoked token still in use, client secret guessing, audit log tampering. Each watches an
event the server records, is enabled and notifies by email, with no recipient until one is added;
nothing is evaluated untilALERT_RULES_MODEis set. A server that already has rules keeps only
its own.docs/ALERT-RULES.mdlists them, lists the event types never recorded (a rule on them
never triggers), and its examples no longer userate_limit_exceededor
brute_force_detected. Deploy note: migration 0037 runs on start; it adds rows only to an empty
alert_rules, writes fixed SQL, and touches no other table (on a fresh install it creates
alert_rules, whose foreign key AutoMigrate adds).
Security
- A redirect URI can be required to match its registration exactly (
REDIRECT_URI_MATCH_MODE,
defaultoff). Redirect URIs were compared after normalization (case of scheme and host, default
port, trailing slash, query order): safe, but more lenient than the exact string comparison RFC
9700 §2.1 recommends.observeauditsredirect_uri_inexact_matchat code issuance when only
the normalized form matched (the client and the URI it sent);enforcerefuses it as not
registered, and audits the refusal: on the authorization page (before sign-in), at code issuance
and forpost_logout_redirect_uri.docs/API.mdno longer says the match was exact. Deploy
note: new variableREDIRECT_URI_MATCH_MODE, defaultoff; runobserveand fix the
registrations or clients it names beforeenforce(#261).