Skip to content

Socrate v1.16.0

Choose a tag to compare

@github-actions github-actions released this 26 Nov 03:50
· 49 commits to main since this release
6947800

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 if alert_rules is empty, touches no other table and rewrites no data;
    on a fresh install it creates alert_rules.
  • Alert rules: nothing is evaluated until ALERT_RULES_MODE is set. Run observe, 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, then enforce. Email needs SMTP configured.
  • Exact redirect URIs: run REDIRECT_URI_MATCH_MODE=observe and look for
    redirect_uri_inexact_match events (the consoles' callbacks included) before enforce.

Added

  • Alert rules are evaluated (ALERT_RULES_MODE, default off, #258). Rules could be created in
    the monitoring console, but nothing evaluated them, so no alert was ever raised. Under observe,
    every ALERT_RULES_INTERVAL_SECONDS (default 60) each enabled rule counts its event type in its
    window, per group of its group_by; a group that reaches the threshold records a triggered
    alert (alert history, an alert_triggered security event), once per group and window. enforce
    also sends the rule's notifications: email to its recipients (needs SMTP), its alert as JSON to
    its webhook_url, or a Slack message, over https to 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/rules reports the mode as evaluation_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 (default off) and ALERT_RULES_INTERVAL_SECONDS; run observe first and
    read the alert history before enforce.
  • 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 until ALERT_RULES_MODE is set. A server that already has rules keeps only
    its own. docs/ALERT-RULES.md lists them, lists the event types never recorded (a rule on them
    never triggers), and its examples no longer use rate_limit_exceeded or
    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,
    default off). 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. observe audits redirect_uri_inexact_match at code issuance when only
    the normalized form matched (the client and the URI it sent); enforce refuses it as not
    registered, and audits the refusal: on the authorization page (before sign-in), at code issuance
    and for post_logout_redirect_uri. docs/API.md no longer says the match was exact. Deploy
    note: new variable REDIRECT_URI_MATCH_MODE, default off; run observe and fix the
    registrations or clients it names before enforce (#261).