strapi-plugin-magic-sessionmanager 4.16.0 → 4.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +84 -36
  3. package/dist/admin/{Analytics-D4gsVwL0.mjs → Analytics-B-p2Q7th.mjs} +1 -1
  4. package/dist/admin/{Analytics-me4qzS0I.js → Analytics-BTIByTUY.js} +1 -1
  5. package/dist/admin/{App-BTG-2Q26.js → App-CH6635JB.js} +112 -184
  6. package/dist/admin/{App-BJwtFWxl.mjs → App-DmesuM2g.mjs} +82 -154
  7. package/dist/admin/{OnlineUsersWidget-Yd283YDy.mjs → OnlineUsersWidget-CuqeQ0tb.mjs} +1 -1
  8. package/dist/admin/{OnlineUsersWidget-DYS3Vy1Q.js → OnlineUsersWidget-TlOp8nie.js} +1 -1
  9. package/dist/admin/{Settings-DIlvfdjZ.mjs → Settings-C4IgGBjQ.mjs} +1347 -109
  10. package/dist/admin/{Settings-TPZ9_75s.js → Settings-DtP_H4JS.js} +1351 -113
  11. package/dist/admin/dashboardModel-0ROcWcB1.mjs +189 -0
  12. package/dist/admin/dashboardModel-BSJhZdXI.js +188 -0
  13. package/dist/admin/{de-DB9ldYwN.mjs → de-BoahnYIP.mjs} +126 -11
  14. package/dist/admin/{de-BuMw1gBJ.js → de-C_ooq6EF.js} +126 -11
  15. package/dist/admin/{en-BqGhOJDy.js → en-CuUVE2K0.js} +126 -11
  16. package/dist/admin/{en-BbLMPQB3.mjs → en-DHme92L-.mjs} +126 -11
  17. package/dist/admin/{es-C5iaiE9G.mjs → es-CjcTgS9Z.mjs} +126 -11
  18. package/dist/admin/{es-BaIeckl9.js → es-lbDNXcQi.js} +126 -11
  19. package/dist/admin/{fr-BEvBUCwI.mjs → fr-BPwnrSaC.mjs} +126 -11
  20. package/dist/admin/{fr-D1YKyTex.js → fr-RtypjgGp.js} +126 -11
  21. package/dist/admin/{index-DUESEUaO.mjs → index-B102RF2H.mjs} +45 -38
  22. package/dist/admin/{index-CgZiLcJ1.js → index-w0OuPYFm.js} +17 -10
  23. package/dist/admin/index.js +1 -1
  24. package/dist/admin/index.mjs +1 -1
  25. package/dist/admin/{pt-DtnW-s0V.js → pt-BMCAKRQ4.js} +126 -11
  26. package/dist/admin/{pt-DeDih9cR.mjs → pt-D5FHSP2y.mjs} +126 -11
  27. package/dist/server/index.js +3577 -1293
  28. package/dist/server/index.mjs +3577 -1293
  29. package/package.json +1 -1
  30. package/dist/admin/riskData-BVs9GpgD.js +0 -26
  31. package/dist/admin/riskData-CI1gm2yI.mjs +0 -27
package/CHANGELOG.md CHANGED
@@ -1,3 +1,82 @@
1
+ # [4.17.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.16.1...v4.17.0) (2026-11-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * account and IP lockout with unlock, session limits, sign-out on password change and per-role rules ([#35](https://github.com/Schero94/Magic-Sessionmanager/issues/35)) ([faeac7c](https://github.com/Schero94/Magic-Sessionmanager/commit/faeac7cc1a299043c3b9d6c03c54cfec96f9fa43))
7
+
8
+
9
+ Release type: minor (`feat`). Additive: three new admin routes, one new permission and new settings keys; no existing route, response or setting changes meaning. One default differs between new and existing installations (see Migration).
10
+
11
+ ### Added
12
+
13
+ * **Account lockout** next to the IP lockout (Configuration › Login protection › Failed sign-ins): **Lock an account after** N failed sign-ins for one account from any address (0 = off, the default). Counted by a SHA-256 hash of the lower-cased identifier; the typed identifier is never stored. An unknown account is locked and answered exactly like an existing one.
14
+ * **Configurable window and lock duration** (`lockoutWindowMinutes` 1-1440, `lockoutDurationMinutes` 1-10080; both default 15, as before). `Retry-After` follows the lock. When a lock ends, the failures that caused it no longer count.
15
+ * **Trusted addresses** (`lockoutTrustedAddresses`, up to 100 IPs or CIDR ranges, IPv4 and IPv6): never locked by IP; their accounts can still be locked.
16
+ * **Locked now** card with **Unlock**: lists locked IP addresses (as the security log stores IPs: full, shortened or hidden) and locked accounts with their user. Seeing it needs plugin access; **Unlock** needs the new permission **Unlock locked sign-ins** (`plugin::magic-sessionmanager.lockouts.unlock`, Super Admin only at first). Every unlock is recorded with the admin who did it. Admin routes `GET /lockouts`, `POST /lockouts/unlock` (`{ id }`, write rate limit) and `GET /roles`.
17
+ * **Lockout email** (`lockoutNotifyUser`, off by default): the account owner gets the new **Account locked** template (editable under Alerts › Email templates) through Strapi's email plugin, so Magic Mail delivers it when installed.
18
+ * **Security log events for app users** (switch **Record failed and refused sign-ins**, `recordUserSignInEvents`, on by default): `user.sign-in.failed`, `user.sign-in.refused` (`meta.reason`: lockout, too-many-attempts, session-limit, country, risk, location-unavailable), `user.lockout`, plus `user.lockout.lifted` (actor = admin), `user.session.limit` and `user.password-change.ended-others`. A client that keeps hitting a lock is logged once per minute; sign-ins naming an account that does not exist are aggregated to one event per anonymised address per 5 minutes (`meta.unknownAccount`), and no typed identifier or title is stored. Deleting a user deletes their events.
19
+ * The new policy settings are **protected settings**: changing them needs **Change protected settings** (`settings.update`, from 4.16.1) as well as plugin access; roles without it see them read-only and can still save the rest of the form.
20
+ * **Concurrent session limit** (Sessions › Concurrent sessions, `maxSessionsPerUser`, 0 = off by default): **End the oldest session** (default) or **Refuse the new sign-in**. A refused sign-in answers `403` with `error.details.code: "SESSION_LIMIT_REACHED"` and `details.limit`; no token or refresh cookie leaves the server and the new session is ended. Idle and over-age sessions do not count. Applied in one cluster-wide critical section per user.
21
+ * **End other sessions after a password change** (`endOtherSessionsOnPasswordChange`) for `POST /auth/change-password` in both JWT modes; the session that made the change stays. A failure fails closed (503) like the password reset.
22
+ * **Different rules for some roles** (Sessions › Roles, collapsed): per Users & Permissions role an own session limit, inactivity timeout and account lockout threshold (`roleRules`, up to 50). The token check and the idle check apply the role's timeout; the overview still classifies "idle" by the general timeout.
23
+
24
+ ### Changed
25
+
26
+ * The IP lockout settings are labelled "Lock an IP address after" and the Login protection intro no longer says refused sign-ins are not recorded.
27
+ * With a role rule for the inactivity timeout, the idle check uses the Document Service path even when "Direct SQL" is selected (it needs each session's role).
28
+
29
+ ### Migration
30
+
31
+ * **Existing installations keep their behaviour.** On the first start of this version, an installation that ran an earlier version gets `endOtherSessionsOnPasswordChange: false` stored once, so a password change keeps the other sessions as before. New installations end them by default. Turn it on under Sessions › Password change.
32
+ * Every other new setting is off or keeps the earlier value: IP lockout 5 failures / 15 minutes / 15 minutes, no account lockout, no session limit, no role rules. Failed and refused app-user sign-ins are now written to the security log; turn off **Record failed and refused sign-ins** to keep the previous behaviour.
33
+ * A custom `coordination.counterStore` receives a third `block(key, untilMs, { windowStart })` argument; a store that ignores it keeps working, but a client may get "Too many login attempts at once" until the counting window ends after a lock.
34
+ * `X-Session-Terminated-Reason` keeps its five values: sessions ended by the session limit report `manual`, by a password change `logout`.
35
+
36
+ ### Tests
37
+
38
+ * `tests/isolated-policies-http.test.js` boots Strapi from this checkout and covers IP and account lockout across addresses, trusted addresses, Retry-After, the lock email (fake email plugin), Locked now with RBAC (401/403/200), Unlock with the actor in the log, the recording switch, session limit (end oldest, refuse with 403 and no tokens), per-role limit and idle timeout, ending other sessions after a password change and the switch, and event deletion with the user. CI runs it on SQLite and PostgreSQL in legacy and refresh mode, and on the Strapi 5.50 floor.
39
+ * The multi-process check (8 processes, SQLite and PostgreSQL) now drives the real lockout engine: exact per-IP and per-account limits across processes, one shared lock list and a cluster-wide unlock.
40
+ * Unit tests for the policy settings, the lockout engine, upgrade defaults, the session limit and the lock email; StrictMode tests for the Locked now card (states, RBAC, keyboard, unlock round trip) and the role rules editor.
41
+
42
+ ## [4.16.1](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.16.0...v4.16.1) (2026-11-25)
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * harden admin tracking (geo opt-in, failed sign-in flood, title and email exposure, protected settings, webhook secrets, proxy IP, hidden types) ([#38](https://github.com/Schero94/Magic-Sessionmanager/issues/38)) ([22b6705](https://github.com/Schero94/Magic-Sessionmanager/commit/22b670531a77bdefcbf1654c137d112e8eb3dd98))
48
+
49
+
50
+ Release type: minor (`fix` commits for the security review of admin tracking, one `feat` for the new permission **Change protected settings**). Routes, paths and request bodies stay the same; the response and permission changes below close the review findings and are listed with what to do.
51
+
52
+ ### Security
53
+
54
+ * **F1, location lookup of admin addresses.** With the default settings, 4.15 and 4.16 sent the full IP address of every admin sign-in, failed attempt and lockout to ipapi.co. The security log now looks up locations only when **Look up the location of security events** (`securityLogGeoLookup`, new, **off** by default) is on, then only the anonymised address (/24, /48), and only in the local GeoIP database unless `ipapi` is chosen explicitly as provider (no fallback from `auto` to ipapi.co). Special-purpose addresses are recognised with `net.BlockList` against the IANA registries (IPv4 and IPv6: private, loopback, link-local, CGNAT, documentation including `2001:db8::/32` and `3fff::/20`, benchmarking, multicast, reserved), so they are never looked up for sessions either. Changing the location lookup settings needs the new permission.
55
+ * **F2, failed sign-in floods.** Failed sign-ins of unknown accounts are counted per anonymised address and 5 minutes into one row (`meta.count`; the API adds `attempts` to sign-in rows). Each address stores at most 30 failed-sign-in and lockout rows per hour, further attempts are counted. When the queue is full, failed sign-ins are dropped first, then Content Manager views, then other activity, with a log line per family. User agents are cut to 256 characters (was 500).
56
+ * **F3, entry titles.** Content Manager activity no longer stores the entry title (nor keeps the entry in the queue: only type, document id and locale). Lists and exports resolve titles when they are read, with the reader's own Content Manager permissions (type, conditions, field-level for the main field); deleted entries have none. A one-time, idempotent start-up migration removes `meta.title` from stored events.
57
+ * **F4, admin identities.** `GET /admin-sessions/admins` and `…/admins/:adminId/sessions` return names and emails only to callers who also hold `admin::users.read`, and role names only with `admin::users.read` or `admin::roles.read`; otherwise they are empty and `search` matches the admin id only. The same applies to admin names in the sign-in history and activity. `meta.identity` says what was visible. Your own row is always complete.
58
+ * **F5, settings changes.** New permission `plugin::magic-sessionmanager.settings.update` ("Change protected settings", Super Admin by default) for location lookup, webhooks and the security log settings. Every settings change records an always-on `settings.updated` event with the admin and the changed key names (never values); every retention run that deletes events records `security-log.retention.purged` with the counts. The security log retention is at least 7 days.
59
+ * **F6, webhook URLs.** `GET /settings` and the `PUT` response no longer contain `discordWebhookUrl` / `slackWebhookUrl`, but `hasDiscordWebhook`, `hasSlackWebhook` and a hint without the secret part (`https://discord.com/…`). A `PUT` without the URL keeps it, an empty string removes it. The Configuration page shows **Saved** with **Replace** and **Remove**.
60
+ * **F7, spoofable client IP.** Start-up warns when `server.proxy.koa` is on and `server.proxy.maxIpsCount` is unset or 0. When the client IP and the TCP peer differ, the log also keeps the anonymised peer in `meta.socketIp`.
61
+ * **F8, internal tables.** The Content Manager admin API answers 404 for the plugin's content types (also for roles granted `explorer.*` on them), and GraphQL Shadow CRUD is turned off for them when `@strapi/plugin-graphql` is installed.
62
+ * **Hardening.** A sign-out deletes the browser's Strapi session records once more about a second later (a racing token renewal cannot leave a record behind). The admin session list returns an opaque handle as `id` instead of Strapi's `sessionId` (a claim of the admin access token); sign-out accepts the handle and still a raw session id. CSV exports also neutralise formulas after leading zero-width or other invisible characters and full-width `= + - @`. Reads of the sign-in history and activity with an admin API token record `security-log.read` (once per token and list per 5 minutes).
63
+
64
+ ### Migration
65
+
66
+ * **Roles that changed settings with `access` only** keep saving the Configuration page and every unprotected setting. To let such a role change location lookup, webhooks or (with **View admin activity**) the security log settings, grant **Change protected settings** in Settings › Administration Panel › Roles › Plugins › Session Manager › Settings. API clients get 403 with `error.details.reason: "settings-update-permission"` until then. This keeps every unprotected setting API-stable; requiring the new permission for every key would have locked existing roles out of the whole page.
67
+ * **Roles with "View admin activity" that changed the security log settings** also need **Change protected settings** now.
68
+ * **Roles with "Read admin panel sessions" or "View admin activity"** that should keep seeing admin names, emails and roles need Strapi's **Read** on Users (`admin::users.read`), or **Read** on Roles for role names only.
69
+ * **Scripts reading webhook URLs from `GET /settings`** must keep them elsewhere; use `hasDiscordWebhook` / `hasSlackWebhook` to check whether one is stored. Scripts that send the whole `GET` response back keep the stored URLs (the keys are no longer in it).
70
+ * **Location of admin sign-ins**: to keep seeing country and city, turn on **Look up the location of security events** and provide a local GeoIP database (or choose `ipapi` explicitly).
71
+ * **Security log retention below 7 days** (possible in 4.15 and 4.16) is raised to 7 at the first start, with a log line.
72
+ * **Stored entry titles** are removed from `meta` at the first start (bounded batches; the daily retention job finishes large logs). Nothing to do.
73
+ * **Behind a proxy**, set `server.proxy.maxIpsCount` if the new start-up warning appears.
74
+
75
+ ### Tests
76
+
77
+ * Real-HTTP suite `tests/isolated-admin-activity-http.test.js` covers every finding on Strapi (SQLite and, new in CI, PostgreSQL): title resolution with and without Content Manager rights and field-level permissions, the title migration, a 150-email flood, identity masking and id-only search, opaque session handles, protected settings, the `settings.updated` and retention events, the retention minimum and its migration, webhook masking, and 404 for the Content Manager routes of the plugin types.
78
+ * Unit tests for the queue drop order, aggregation and per-address cap, opt-in location lookup (no ipapi.co request with the defaults), special-purpose ranges, the proxy warning, the Content Manager guard, GraphQL Shadow CRUD, the migrations, the repeated sign-out, token-read auditing and CSV escaping; a StrictMode render test for the webhook field and the read-only protected controls.
79
+
1
80
  # [4.16.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.15.0...v4.16.0) (2026-11-24)
2
81
 
3
82
 
package/README.md CHANGED
@@ -395,7 +395,7 @@ Static defaults from `server/src/config/index.js`; admin units and ranges from t
395
395
  | `enableEmailAlerts` | `false` | boolean | Alerts | Security emails to users. |
396
396
  | `alertOnSuspiciousLogin` / `alertOnNewLocation` / `alertOnVpnProxy` | `true` | boolean | Alerts | Which events send an email. Suspicious sign-in and VPN or proxy need a [risk data source](#risk-data-vpn-proxy-tor). |
397
397
  | `enableWebhooks` | `false` | boolean | Alerts | Team notifications. |
398
- | `discordWebhookUrl` / `slackWebhookUrl` | `''` | https URL on discord.com / discordapp.com, or hooks.slack.com | Alerts | Any other host is rejected. |
398
+ | `discordWebhookUrl` / `slackWebhookUrl` | `''` | https URL on discord.com / discordapp.com, or hooks.slack.com | Alerts | Any other host is rejected. Write-only since 4.17: never returned, see Team notifications. |
399
399
  | `retentionDays` | 90 | days, 1 to 365 or -1 (forever) | Data and retention | How long records of ended sessions are kept. Checked once a day across all instances, the first time about 5 minutes after the server starts. Open sessions are never deleted by retention. |
400
400
  | `rateLimitWriteMax` / `rateLimitReadMax` / `rateLimitWindowSeconds` | 10 / 120 / 60 | 1 to 1000 / 1 to 10000 / 10 to 3600 | not shown | Content API rate limits. Not editable in the UI; Save keeps the stored values. The write limit can only be made stricter than the route floor. |
401
401
  | `emailTemplates` | empty | subject ≤ 200, HTML ≤ 10,000 (sanitised), text ≤ 5,000 characters | Alerts › Edit email templates | As soon as any template has content, only stored templates are used. Fill in all three, or none. |
@@ -498,17 +498,46 @@ Saved settings are not changed: a switch that was on stays stored and applies on
498
498
 
499
499
  ## Login protection
500
500
 
501
- Configuration › Login protection checks **new sign-ins only**. Existing sessions are not affected, and refused sign-ins are not recorded.
501
+ Configuration › Login protection checks **new sign-ins only**. Existing sessions are not affected. Failed and refused sign-ins are written to the [security log](#admin-activity-and-sign-in-history) while **Record failed and refused sign-ins** is on (default).
502
502
 
503
- | Rule | Response | Notes |
504
- | ----------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
505
- | Temporary IP lockout | 429 with `Retry-After` | After `maxFailedLogins` failed sign-ins from one IP address within 15 minutes, that address is refused for 15 minutes. User accounts are not blocked. Shared by all server processes. Each attempt is counted before the password check, so a parallel burst cannot exceed the limit; when more attempts from one address are running at once than the limit, the extra ones get 429 with `Retry-After: 1` and no lock. |
506
- | Reject suspicious sign-ins | 403 | VPN, proxy or Tor address, or, with security scoring on, a score below 50. Needs a [risk data source](#risk-data-vpn-proxy-tor); without one this rule refuses nothing. |
507
- | Country rules | 403 | Allow only listed countries, or reject listed countries. With "Allow only listed countries", an empty list allows every country. |
508
- | Location cannot be determined | 403 "Login temporarily unavailable" | When `geoLookupFailureMode` says reject (`auto` rejects only when "Reject suspicious sign-ins" is on). |
503
+ | Rule | Response | Notes |
504
+ | ----------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
505
+ | IP and account lockout | 429 with `Retry-After` | After `maxFailedLogins` failed sign-ins from one IP address, or `maxFailedLoginsPerAccount` for one account from any address (off by default), within `lockoutWindowMinutes` (15), that address or account is refused for `lockoutDurationMinutes` (15). Shared by all server processes. Each attempt is counted before the password check, so a parallel burst cannot exceed the limit; extra attempts running at once get 429 with `Retry-After: 1` and no lock. See [Lockout, trusted addresses and Locked now](#lockout-trusted-addresses-and-locked-now). |
506
+ | Reject suspicious sign-ins | 403 | VPN, proxy or Tor address, or, with security scoring on, a score below 50. Needs a [risk data source](#risk-data-vpn-proxy-tor); without one this rule refuses nothing. |
507
+ | Country rules | 403 | Allow only listed countries, or reject listed countries. With "Allow only listed countries", an empty list allows every country. |
508
+ | Location cannot be determined | 403 "Login temporarily unavailable" | When `geoLookupFailureMode` says reject (`auto` rejects only when "Reject suspicious sign-ins" is on). |
509
+ | Session limit (policy Refuse) | 403 `SESSION_LIMIT_REACHED` | The user already has `maxSessionsPerUser` open sessions. See [Concurrent session limit](#concurrent-session-limit). |
509
510
 
510
511
  Requests with an ended session get **401** with the header `X-Session-Terminated-Reason` (`logout`, `manual`, `idle`, `expired` or `blocked`).
511
512
 
513
+ ### Lockout, trusted addresses and Locked now
514
+
515
+ - **Per IP** (`maxFailedLogins`, default 5) and **per account** (`maxFailedLoginsPerAccount`, default 0 = off). The account counter uses a SHA-256 hash of the lower-cased identifier (`identifier` of `/auth/local`, `email` of the Magic Link routes); the typed identifier is never stored. An unknown account is counted and answered exactly like an existing one, so the response does not reveal which accounts exist.
516
+ - Anyone who knows an account name can lock that account. Keep the account threshold higher than the IP threshold; admins can lift a lock at once.
517
+ - **Window and duration**: `lockoutWindowMinutes` (1-1440) and `lockoutDurationMinutes` (1-10080). When a lock ends, the failures that caused it no longer count.
518
+ - **Trusted addresses** (`lockoutTrustedAddresses`, up to 100 IPs or CIDR ranges such as `192.0.2.0/24` or `2001:db8::/32`) are never locked by IP. Their accounts can still be locked. Use it for an office NAT or a backend that signs in for many users.
519
+ - **Locked now** (same tab) lists every active lock: IP addresses as the security log stores them (full, shortened or hidden) and accounts with their user. **Unlock** needs the permission **Unlock locked sign-ins** and is recorded with the admin who did it.
520
+ - **Lockout email** (`lockoutNotifyUser`, off by default) tells the account owner about an account lock, through Strapi's email plugin (Magic Mail delivers it when installed). The text is the **Account locked** template under Alerts › Email templates (`{{user.email}}`, `{{user.username}}`, `{{lock.minutes}}`, `{{lock.until}}`).
521
+
522
+ ### Concurrent session limit
523
+
524
+ Sessions › Concurrent sessions: `maxSessionsPerUser` (0 = no limit, the default). Sessions that are idle or past their maximum age do not count.
525
+
526
+ | Policy (`sessionLimitPolicy`) | What happens at the limit |
527
+ | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
528
+ | `end-oldest` (default) | The new sign-in succeeds; the oldest open sessions end (`X-Session-Terminated-Reason: manual`). |
529
+ | `refuse` | The sign-in answers `403` with `{ error: { name: 'ForbiddenError', details: { code: 'SESSION_LIMIT_REACHED', limit } } }`. No token or refresh cookie is sent; Strapi's new session is ended at once. |
530
+
531
+ The check and the session creation run in one cluster-wide critical section per user, so parallel sign-ins on several processes cannot pass the limit together.
532
+
533
+ ### Password change
534
+
535
+ Sessions › Password change › **End other sessions after a password change** (`endOtherSessionsOnPasswordChange`): after `POST /auth/change-password` every other session of the user ends (`logout`), in legacy and refresh mode; the session that made the change stays. On by default for new installations; installations upgraded from 4.16 or earlier keep the previous behaviour (off) until it is turned on. A password reset always ends the other sessions.
536
+
537
+ ### Different rules for some roles
538
+
539
+ Sessions › Roles › **Different rules for some roles** (collapsed): per Users & Permissions role an own session limit, inactivity timeout and account lockout threshold (`roleRules`: `[{ role: '<role documentId>', maxSessionsPerUser, inactivityTimeout, maxFailedLoginsPerAccount }]`, `null` = general value, up to 50 rules). The token check and the idle check use the role's timeout. The dashboard's Active/Idle counts still use the general timeout.
540
+
512
541
  ---
513
542
 
514
543
  ## Alerts
@@ -516,7 +545,7 @@ Requests with an ended session get **401** with the header `X-Session-Terminated
516
545
  Configuration › Alerts. Both kinds are sent only when location data is available for the sign-in.
517
546
 
518
547
  - **Security emails to users** go to the end user's own email address, not to administrators: suspicious sign-in, sign-in from a new country (differs from the user's last 50 sessions), VPN or proxy. Suspicious sign-in and VPN or proxy need a [risk data source](#risk-data-vpn-proxy-tor); the new-country email needs location data only. They use Strapi's Email plugin, so configure an email provider first (for example `@strapi/provider-email-nodemailer`).
519
- - **Team notifications** post every sign-in to Discord or Slack as `login.suspicious`, otherwise `login.new_location`, otherwise `login.success`. Without a [risk data source](#risk-data-vpn-proxy-tor), `login.suspicious` is never sent. Only `https://discord.com`, `https://discordapp.com` and `https://hooks.slack.com` URLs are accepted; Save rejects any other URL with a field error, and an empty field clears the URL.
548
+ - **Team notifications** post every sign-in to Discord or Slack as `login.suspicious`, otherwise `login.new_location`, otherwise `login.success`. Without a [risk data source](#risk-data-vpn-proxy-tor), `login.suspicious` is never sent. Only `https://discord.com`, `https://discordapp.com` and `https://hooks.slack.com` URLs are accepted; Save rejects any other URL with a field error. A webhook URL is a secret (anyone with it can post to the channel), so since 4.17 it is never sent back to the browser: a stored URL shows as **Saved** with the host (`https://discord.com/…`) and **Replace** / **Remove**. Over the API, `GET /settings` returns `hasDiscordWebhook` / `hasSlackWebhook` and `discordWebhookHint` / `slackWebhookHint` instead of the URLs; a `PUT` without the URL key keeps the stored URL, an empty string removes it. Changing webhooks needs **Change protected settings**.
520
549
 
521
550
  Example email provider configuration:
522
551
 
@@ -684,11 +713,17 @@ Prefix `/magic-sessionmanager` (Strapi admin API). Every route requires an authe
684
713
 
685
714
  The **Admin panel sessions** routes need two more permissions, which only the Super Admin role has by default (Settings › Administration Panel › Roles › Plugins › Session Manager › Admin panel):
686
715
 
687
- | Permission | Name in the role editor | Allows |
688
- | ---------------------------------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
689
- | `plugin::magic-sessionmanager.admin-sessions.read` | Read admin panel sessions | The Admin panel view and its two GET routes |
690
- | `plugin::magic-sessionmanager.admin-sessions.revoke` | Sign out admins | **Sign out** and **Sign out everywhere** (also needs read) |
691
- | `plugin::magic-sessionmanager.admin-activity.read` | View admin activity | Sign-in history, Activity, Recent sign-in activity, CSV exports and changing the Admin activity settings (also needs read) |
716
+ | Permission | Name in the role editor | Allows |
717
+ | ---------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
718
+ | `plugin::magic-sessionmanager.admin-sessions.read` | Read admin panel sessions | The Admin panel view and its two GET routes |
719
+ | `plugin::magic-sessionmanager.admin-sessions.revoke` | Sign out admins | **Sign out** and **Sign out everywhere** (also needs read) |
720
+ | `plugin::magic-sessionmanager.admin-activity.read` | View admin activity | Sign-in history, Activity, Recent sign-in activity, CSV exports and changing the Admin activity settings (also needs read) |
721
+ | `plugin::magic-sessionmanager.settings.update` | Change protected settings (location lookup, webhooks, security log, sign-in policies) | Changing IP location lookup, provider, lookup failure mode and database file, team notification webhooks, the sign-in and session policies (lockout, trusted addresses, session limit, password-change sign-out, role rules), and (with View admin activity) the security log settings. Since 4.17; Super Admin only by default |
722
+ | `plugin::magic-sessionmanager.lockouts.unlock` | Unlock locked sign-ins | **Unlock** in Login protection › Locked now (also needs `access`) |
723
+
724
+ **What the admin panel view shows about other admins (4.17).** Names, emails and roles of admins are Strapi's own user data. The Admin panel view and the sign-in history return them only to roles that may also read them in Settings › Users: email and name need Strapi's **Read** permission on Users (`admin::users.read`), role names need it or **Read** on Roles (`admin::roles.read`). Without them the list shows "Admin #12", "Email hidden" and "Hidden" (roles), and the search matches the admin id only. Every admin always sees their own row. Grant `admin::users.read` to roles that should keep seeing names and emails.
725
+
726
+ **Protected settings (4.17).** `PUT /settings` still needs only `access`, so roles that change the session, login-protection, alert-email and retention options keep working. Changing a protected key needs **Change protected settings** as well, else 403 with `error.details.reason: "settings-update-permission"`: `enableGeolocation`, `geoIpProvider`, `geoLookupFailureMode`, `geoIpDatabasePath`, `enableWebhooks`, `discordWebhookUrl`, `slackWebhookUrl`, every security log key (those also keep needing **View admin activity**, reason `admin-activity-permission`) and the sign-in and session policy keys (`maxFailedLoginsPerAccount`, `lockoutWindowMinutes`, `lockoutDurationMinutes`, `lockoutTrustedAddresses`, `lockoutNotifyUser`, `recordUserSignInEvents`, `maxSessionsPerUser`, `sessionLimitPolicy`, `endOtherSessionsOnPasswordChange`, `roleRules`). Sending a protected key back with its stored value is not a change, so these roles can still save the whole form. The admin UI shows these controls read-only for them.
692
727
 
693
728
  | Method | Path | Admin UI action |
694
729
  | -------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -710,9 +745,9 @@ The **Admin panel sessions** routes need two more permissions, which only the Su
710
745
  | GET | `/geoip/status` | GeoIP database status, plus `risk` (`available`, `source`, and per risk database `editionId`, `exists`, `usable`, `fromEnvironment`, `metadata`) |
711
746
  | PUT | `/geoip/credentials` | Save or remove (`{ "clear": true }`) MaxMind credentials |
712
747
  | POST | `/geoip/update` | Update database / Force download. Body `{ "force"?: boolean, "database"?: "location" \| "anonymous-ip" \| "asn" }` (default `location`; anything else is 400). A 401/403 from MaxMind answers 502 "MaxMind refused the download…" |
713
- | GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input) |
748
+ | GET, PUT | `/settings` | Configuration (PUT validates every field and returns `error.details.errors` on invalid input). Webhook URLs are never returned: `hasDiscordWebhook`, `hasSlackWebhook` and a hint (`https://discord.com/…`); see below |
714
749
  | POST | `/sessions/:sessionId/simulate-timeout` | Development only; removed when `NODE_ENV` is `production` or `staging` |
715
- | GET | `/admin-sessions/admins` | Admin panel view: `?page=&pageSize=` (1-100), `search` (up to 100 characters, name or email), `filter` (`all`, `signed-in`, `not-signed-in`); needs `admin-sessions.read` |
750
+ | GET | `/admin-sessions/admins` | Admin panel view: `?page=&pageSize=` (1-100), `search` (up to 100 characters, name or email; the admin id only without `admin::users.read`), `filter` (`all`, `signed-in`, `not-signed-in`); needs `admin-sessions.read` |
716
751
  | GET | `/admin-sessions/admins/:adminId/sessions` | **View sessions**: one entry per signed-in browser; needs `admin-sessions.read` |
717
752
  | POST | `/admin-sessions/admins/:adminId/sessions/:sessionId/sign-out` | **Sign out** one browser; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
718
753
  | POST | `/admin-sessions/admins/:adminId/sign-out-everywhere` | **Sign out everywhere**; needs `admin-sessions.revoke`; signed-in administrators only; 10 per minute |
@@ -720,6 +755,9 @@ The **Admin panel sessions** routes need two more permissions, which only the Su
720
755
  | GET | `/admin-activity/sign-ins/export` | CSV export batches of 500 rows, newest first; same filters plus `cursor`; follow `meta.nextCursor` |
721
756
  | GET | `/admin-activity/content` | **Activity**: `adminId`, `action` (`all`, `view`, `create`, `update`, `publish`, `unpublish`, `discard`, `delete`, `clone`), `contentType` (uid), `from`, `to`, `page`, `pageSize`; needs `admin-activity.read` |
722
757
  | GET | `/admin-activity/content/export` | CSV export batches of 500 rows; same filters plus `cursor` |
758
+ | GET | `/lockouts` | **Locked now**: `{ data: [{ id, kind: 'ip' \| 'account', ip, user, failures, lockedAt, until }] }`; read rate limit |
759
+ | POST | `/lockouts/unlock` | **Unlock**: body `{ id }` from the list; needs `lockouts.unlock`; 404 when the lock already ended; 10 per minute |
760
+ | GET | `/roles` | Users & Permissions roles (without Public) for **Different rules for some roles** |
723
761
 
724
762
  **Session list parameters.** `page` (from 1), `pageSize` (1-100), `status` (`all`, `open`, `active`, `idle`, `ended`), `reason` (with `status=ended`: `logout`, `idle`, `expired`, `manual`, `blocked`, `unrecorded`), `search` (up to 100 characters; matches email, username, IP address, browser, operating system and device type) and `sort` (`loginTime:desc`, `loginTime:asc`, `lastActive:desc`, `lastActive:asc`). The response is `{ data, meta: { pagination: { page, pageSize, total, pageCount } } }` with exact totals. Unknown or out-of-range parameters return 400. Pages that start after the first 50,000 matching sessions return 400; narrow the filter or use the export, which walks every row with a cursor. Without `page` and `pageSize`, `GET /sessions` keeps the 4.x response (latest 1,000 rows, `meta.truncated`) for existing scripts.
725
763
 
@@ -729,9 +767,9 @@ The list, statistics, analytics, export, untracked-session summary and `/users/s
729
767
 
730
768
  **Block / unblock** (`toggle-block`): send `{ "blocked": true }` or `{ "blocked": false }`. This sets the state, is safe to retry and is what the admin UI sends. A request without a body still toggles, but is deprecated, because a retry after a lost response can reverse the intended state. A non-boolean `blocked` returns 400. The response contains `blocked` and `mode` (`explicit` or `toggle`). Blocking ends all open sessions with the reason `blocked`; if that fails, the response is 500 and the request can be retried.
731
769
 
732
- **Admin panel sessions.** `GET /admin-sessions/admins` returns `{ data: [{ id, name, email, roles: [{ name, superAdmin }], account, self, sessionCount, lastActiveAt, canSignOut, protectedReason }], meta: { supported, pagination, stats: { signedInAdmins, activeSessions, activeAccounts, totalAdmins }, policy, truncated } }`. `account` is `active`, `deactivated` or `invited`. `GET …/sessions` returns `{ data: [{ id, device, signedInAt, lastActiveAt, endsAt, rememberMe, current }], meta: { admin, policy } }`; `id` is the Strapi session id of the browser's newest session record (32 hexadecimal characters). No token, refresh token, device id or password field is ever returned. Both sign-out routes return `{ data: { ended, signedOutSelf } }`: `signedOutSelf` is `true` when the browser that sent the request was signed out. Answers: 404 for an unknown admin, and for a session id that is not a live session of that admin (no probing of other admins' sessions); 403 with `error.details.reason` `super-admin-protected` when an admin without the Super Admin role tries to sign out a Super Admin, or `browser-session-required` for admin API tokens; 429 after 10 sign-outs per minute per admin; 503 when the Strapi version has no session manager (`meta.supported: false` on the GET routes). Each sign-out writes one log line, `[magic-sessionmanager] Admin sign-out: actor=<admin id> target=<admin id> scope=one|all ended=<n>`, at info level (no email, session id or token), and emits the Strapi event `magic-sessionmanager.admin-sessions.signed-out` with the same fields.
770
+ **Admin panel sessions.** `GET /admin-sessions/admins` returns `{ data: [{ id, name, email, roles: [{ name, superAdmin }], account, self, sessionCount, lastActiveAt, canSignOut, protectedReason }], meta: { supported, pagination, stats: { signedInAdmins, activeSessions, activeAccounts, totalAdmins }, policy, truncated, recording, identity: { names, emails, roles } } }`. `account` is `active`, `deactivated` or `invited`. `name` and `email` are empty strings and `roles` is empty when the caller may not see them (see above; `meta.identity`). `GET …/sessions` returns `{ data: [{ id, device, signedInAt, lastActiveAt, endsAt, rememberMe, current }], meta: { admin, policy } }`; since 4.17 `id` is an opaque handle of the browser's newest session record (32 hexadecimal characters, a SHA-256 of Strapi's `sessionId`, which is a claim of the admin's access token and is no longer returned). The sign-out route accepts the handle, and still a raw Strapi session id. No token, refresh token, device id or password field is ever returned. Both sign-out routes return `{ data: { ended, signedOutSelf } }`: `signedOutSelf` is `true` when the browser that sent the request was signed out. Answers: 404 for an unknown admin, and for a session id that is not a live session of that admin (no probing of other admins' sessions); 403 with `error.details.reason` `super-admin-protected` when an admin without the Super Admin role tries to sign out a Super Admin, or `browser-session-required` for admin API tokens; 429 after 10 sign-outs per minute per admin; 503 when the Strapi version has no session manager (`meta.supported: false` on the GET routes). Each sign-out writes one log line, `[magic-sessionmanager] Admin sign-out: actor=<admin id> target=<admin id> scope=one|all ended=<n>`, at info level (no email, session id or token), and emits the Strapi event `magic-sessionmanager.admin-sessions.signed-out` with the same fields.
733
771
 
734
- **How a sign-out works (Strapi 5.62).** The plugin deletes Strapi's own session records of that browser (`strapi.sessionManager('admin').invalidateRefreshToken(adminId, deviceId)`, the same call Strapi's logout makes) or of every browser (`invalidateRefreshToken(adminId)`). Strapi's admin authentication checks the session record on every admin request (`isSessionActive`), so the admin's next request returns 401 and the admin panel cannot renew its token: it shows the login page. There is no waiting period for the 30-minute access token (`accessTokenLifespan`). The plugin deletes every record of the browser, not only the newest one: an older access token belongs to an older, rotated record, and deleting just the newest record (`revokeSessionById`) would leave that token working until it expires. The integration suite proves both. Admin API tokens (Settings › Admin tokens) are separate from sessions and are not affected.
772
+ **How a sign-out works (Strapi 5.62).** The plugin deletes Strapi's own session records of that browser (`strapi.sessionManager('admin').invalidateRefreshToken(adminId, deviceId)`, the same call Strapi's logout makes) or of every browser (`invalidateRefreshToken(adminId)`). Strapi's admin authentication checks the session record on every admin request (`isSessionActive`), so the admin's next request returns 401 and the admin panel cannot renew its token: it shows the login page. There is no waiting period for the 30-minute access token (`accessTokenLifespan`). About a second later the plugin runs the same delete once more, so a token renewal that raced the sign-out (Strapi reads the old record, then writes the new one) cannot leave a new record behind. The plugin deletes every record of the browser, not only the newest one: an older access token belongs to an older, rotated record, and deleting just the newest record (`revokeSessionById`) would leave that token working until it expires. The integration suite proves both. Admin API tokens (Settings › Admin tokens) are separate from sessions and are not affected.
735
773
 
736
774
  Errors use Strapi's `{ data: null, error }` envelope: 400 for invalid input, 404 for unknown IDs, 500 for server-side failures, 502 for a failed MaxMind download, 409 for a settings save based on an outdated `revision`.
737
775
 
@@ -741,12 +779,17 @@ Errors use Strapi's `{ data: null, error }` envelope: 400 for invalid input, 404
741
779
 
742
780
  Since 4.15 the plugin keeps a **security log**: one table (`plugin::magic-sessionmanager.security-event`, collection `magic_sessions_security_events`, hidden from the Content Manager and the Content-Type Builder) where every event has an actor (`actorType` `admin`/`user`/`system`, `actorId`), a target (`targetType`, `targetId`), an `event` name, `ip`, `userAgent`, `geo`, a small `meta` object (at most 16 plain values, 2 KB) and `createdAt`. It is indexed on actor, target, event and time. The admin panel uses it for two things:
743
781
 
744
- | Recorded | Events | Default |
745
- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
746
- | **Admin sign-in history** | `admin.sign-in`, `admin.sign-in.failed` (reason), `admin.lockout`, `admin.sign-out`, `admin.session.revoked` (who signed out whom, one browser or everywhere) | On |
747
- | **Content Manager activity** | `admin.content.view` (opening an entry), `.create`, `.update`, `.publish`, `.unpublish`, `.discard`, `.delete`, `.clone`, with content type, document id, locale and title | **Off** |
782
+ | Recorded | Events | Default |
783
+ | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
784
+ | **Admin sign-in history** | `admin.sign-in`, `admin.sign-in.failed` (reason), `admin.lockout`, `admin.sign-out`, `admin.session.revoked` (who signed out whom, one browser or everywhere) | On |
785
+ | **Content Manager activity** | `admin.content.view` (opening an entry), `.create`, `.update`, `.publish`, `.unpublish`, `.discard`, `.delete`, `.clone`, with content type, document id and locale | **Off** |
786
+ | **Changes to the log itself** (4.17) | `settings.updated` (who changed which settings keys, never the values), `security-log.retention.purged` (how many events the daily job deleted), `security-log.read` (a read of the history with an admin API token, once per token and list per 5 minutes) | Always |
748
787
 
749
- **Who can see it.** The new permission **View admin activity** (`plugin::magic-sessionmanager.admin-activity.read`, together with `access` and `admin-sessions.read`). Only the Super Admin role has it until you grant it in Settings › Administration Panel › Roles › Plugins › Session Manager › Admin panel. The same permission is needed to change the settings below; other admins can still save the Configuration page, but not change these values (403).
788
+ **Entry titles (4.17).** The log stores no entry title or other content of an entry. The Activity list and its export look the title up when they are read, with the reader's own Content Manager permissions: the reader must be allowed to read the content type and its main field (field-level permissions and conditions such as "is creator" apply). Otherwise, and for deleted entries, the row shows the document id. Titles stored by 4.15 and 4.16 are removed once at start-up.
789
+
790
+ **Who can see it.** The new permission **View admin activity** (`plugin::magic-sessionmanager.admin-activity.read`, together with `access` and `admin-sessions.read`). Only the Super Admin role has it until you grant it in Settings › Administration Panel › Roles › Plugins › Session Manager › Admin panel. Changing the settings below needs it **and** **Change protected settings** (`settings.update`, 4.17); other admins can still save the Configuration page, but not change these values (403). Admin names in the history need `admin::users.read`, as in the Admin panel view.
791
+
792
+ **Not reachable elsewhere (4.17).** The plugin's tables are internal. The Content Manager admin API answers 404 for them (also for roles that were granted Content Manager permissions on them), and when `@strapi/plugin-graphql` is installed, GraphQL Shadow CRUD is turned off for them, so they are not in the schema.
750
793
 
751
794
  ### How events are captured (Strapi 5.63)
752
795
 
@@ -756,7 +799,8 @@ Since 4.15 the plugin keeps a **security log**: one table (`plugin::magic-sessio
756
799
  - **Registration and password reset** create a session without an event; a small server middleware records them as sign-ins.
757
800
  - **Content Manager activity** is recorded by the same middleware after the Content Manager has answered: only successful calls of a signed-in admin to the entry routes (`collection-types` findOne, create, update, publish, unpublish, discard, delete, clone and bulk actions, and the single-type routes). List views, counts, relations and configuration calls are not activity. Opening the same entry (same admin, content type, document and locale) again within 10 minutes, or right after editing it, is one event.
758
801
  - The request behind an event is read from Strapi's request context (`strapi.requestContext`), which is how the IP address and user agent reach the event hub listeners.
759
- - Nothing is written on the request path. Events go to a bounded in-memory queue and are written in batches about once a second; GeoIP lookups also happen there. The settings are read when the batch is written, so a switched-off recording drops queued events.
802
+ - Nothing is written on the request path. Events go to a bounded in-memory queue and are written in batches about once a second; GeoIP lookups (if turned on) also happen there. The settings are read when the batch is written, so a switched-off recording drops queued events.
803
+ - **Floods (4.17).** Failed sign-ins of unknown accounts (an email that is not an admin; Strapi's login rate limit counts per email and address, so changing the email gets around it) are counted per anonymised address and 5 minutes into one row (`meta.count`, shown as "N attempts within 5 minutes"). Each address stores at most 30 failed-sign-in and lockout rows per hour; further attempts are counted into that row. User agents are cut to 256 characters. If the queue (2,000 events) is full, failed sign-ins are dropped first, then Content Manager views, then other activity; sign-ins, sign-outs and settings changes last. The log line names how many events of each kind were dropped.
760
804
 
761
805
  ### Client IP address and reverse proxies
762
806
 
@@ -773,19 +817,22 @@ module.exports = ({ env }) => ({
773
817
  });
774
818
  ```
775
819
 
776
- Without `proxy.koa` every event shows the proxy's address. The integration suite runs once without and once with a trusted proxy (`ADMIN_ACTIVITY_PROXY=1`) and checks both.
820
+ Without `proxy.koa` every event shows the proxy's address. With `proxy.koa: true` and no `maxIpsCount` (or 0), Koa takes the left-most `X-Forwarded-For` entry, which the client chooses: the plugin logs a warning at start-up (4.17). When the client IP and the TCP peer differ, the log also keeps the peer, anonymised, in `meta.socketIp`, so a spoofed address can be told apart. The integration suite runs once without and once with a trusted proxy (`ADMIN_ACTIVITY_PROXY=1`) and checks both.
777
821
 
778
822
  ### Settings (Configuration › Admin activity)
779
823
 
780
- | Setting | Key | Default | Notes |
781
- | --------------------------------------- | -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
782
- | Record admin sign-ins | `adminSignInHistory` | On | Sign-ins, failures, lockouts, sign-outs, who signed out whom. |
783
- | Record Content Manager activity | `adminContentActivity` | **Off** | Records how people work; read the notes below before you turn it on. |
784
- | Store IP addresses | `securityLogStoreIp` | On | Applies to the whole security log. Location uses the IP location lookup under Location data (local MaxMind database or ipapi.co). |
785
- | Anonymise the last part of IP addresses | `securityLogAnonymizeIp` | Off | Stores `203.0.113.0` instead of `203.0.113.42`; IPv6 keeps the first 48 bits. The location is looked up from the anonymised address. |
786
- | Keep security events for | `securityLogRetentionDays` | 90 days | 1-730. A daily job (03:17 server time, one process per cluster) deletes older events. |
824
+ | Setting | Key | Default | Notes |
825
+ | --------------------------------------- | -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
826
+ | Record admin sign-ins | `adminSignInHistory` | On | Sign-ins, failures, lockouts, sign-outs, who signed out whom. |
827
+ | Record Content Manager activity | `adminContentActivity` | **Off** | Records how people work; read the notes below before you turn it on. |
828
+ | Store IP addresses | `securityLogStoreIp` | On | Applies to the whole security log. |
829
+ | Anonymise the last part of IP addresses | `securityLogAnonymizeIp` | Off | Stores `203.0.113.0` instead of `203.0.113.42`; IPv6 keeps the first 48 bits. |
830
+ | Look up the location of security events | `securityLogGeoLookup` | **Off** | 4.17. Only the anonymised address is looked up, in the local GeoIP database; ipapi.co only when you chose `ipapi` as provider. Before 4.17 the full address went to ipapi.co by default. |
831
+ | Keep security events for | `securityLogRetentionDays` | 90 days | 7-730 (the minimum was 1 before 4.17; lower stored values are raised to 7 at start-up). A daily job (03:17 server time, one process per cluster) deletes older events and records how many. |
832
+
833
+ All keys in this table are protected settings: changing them needs **View admin activity** and **Change protected settings**. Every settings change is recorded as `settings.updated` with the admin and the key names.
787
834
 
788
- When an admin account is deleted, the plugin deletes the events of that admin (sign-ins, failures, activity). Where that admin had signed someone else out, the event stays with the other admin and only the actor reference is cleared. The same clean-up runs daily for accounts deleted while the plugin was not running.
835
+ When an admin account is deleted, the plugin deletes the events of that admin (sign-ins, failures, activity). Where that admin had signed someone else out, changed settings or read the log with a token, the event stays and only the actor reference is cleared. The same clean-up runs daily for accounts deleted while the plugin was not running.
789
836
 
790
837
  ### Legal notes (information, not legal advice)
791
838
 
@@ -793,7 +840,7 @@ These notes describe what the feature does so you can check it with your data pr
793
840
 
794
841
  - **GDPR.** Sign-in history with IP addresses is personal data of your admins. A typical basis is a legitimate interest in securing the admin panel (Art. 6(1)(f) GDPR) or, for employees, the national employment rules. Tell your admins about it in your privacy information (Art. 13), keep the retention as short as your security needs allow, and consider **Anonymise the last part of IP addresses**. An admin's events can be exported as CSV for an access request (Art. 15) and are deleted with the account.
795
842
  - **Content Manager activity.** This records what each person works on and when. In Germany, a technical system that can monitor the behaviour or performance of employees is subject to the works council's co-determination (Section 87(1) no. 6 BetrVG), and comparable rules exist in other countries. That is why it is off by default; inform the people concerned and, where there is one, agree it with the works council before you turn it on. Check whether a data protection impact assessment (Art. 35 GDPR) is needed.
796
- - **Third parties.** With the `auto` or `ipapi` location provider, IP addresses can be sent to ipapi.co. Use a local MaxMind database or turn off the IP location lookup to keep them on your server.
843
+ - **Third parties.** Since 4.17 no admin address leaves the server by default: **Look up the location of security events** is off, and when it is on, only the anonymised address is looked up in the local database (ipapi.co only with the explicit `ipapi` provider). For end-user sessions, the `auto` or `ipapi` provider can still send IP addresses to ipapi.co; use a local MaxMind database or turn off the IP location lookup to keep them on your server. Special-purpose addresses (private, loopback, link-local, CGNAT, documentation, benchmarking, multicast and reserved ranges, IPv4 and IPv6) are never looked up.
797
844
 
798
845
  ### Performance
799
846
 
@@ -987,9 +1034,10 @@ The plugin sits in the request path of every authenticated Content API call, so
987
1034
 
988
1035
  - **Ownership.** Content API routes only return or end the caller's own sessions. A foreign session ID answers exactly like a missing one, so IDs cannot be probed.
989
1036
  - **Revocation.** Ended, expired and revoked sessions and blocked users are rejected on every Content API request, in both token check modes. Tokens of deleted records stay on a revocation list.
990
- - **Password reset.** A successful password reset ends every older session of the user in both JWT modes.
1037
+ - **Password reset and change.** A successful password reset ends every older session of the user in both JWT modes; a password change does the same when **End other sessions after a password change** is on.
1038
+ - **Lockout data.** Lock counters store SHA-256 hashes of IPs and identifiers, never the typed identifier. The Locked now list shows IPs as the security log stores them and expires with the lock. Failed and refused app-user sign-ins go to the security log (switch **Record failed and refused sign-ins**); deleting a user deletes their events.
991
1039
  - **Privacy.** Session records contain IP addresses, user agents and location data. With the `auto` or `ipapi` provider, IP addresses can be sent to ipapi.co; use `local-mmdb` or turn off IP location lookup to avoid that. The details dialog never looks up a location unless you click **Look up location**. Set **Keep ended sessions for** to match your retention policy, and use **Delete ended sessions** or **Delete record** to remove history.
992
- - **What leaves your server.** Only what you turn on: IP lookups at ipapi.co (provider `auto` without a local database, or `ipapi`), Discord or Slack webhooks (Team notifications), emails through your own Email provider (Security emails) and the MaxMind database download when you click **Update database** or run the updater. There is no telemetry, no install ping and no license check.
1040
+ - **What leaves your server.** Only what you turn on: IP lookups of end-user sign-ins at ipapi.co (provider `auto` without a local database, or `ipapi`; admin security events only with **Look up the location of security events** and the explicit `ipapi` provider, and then only the anonymised address), Discord or Slack webhooks (Team notifications), emails through your own Email provider (Security emails) and the MaxMind database download when you click **Update database** or run the updater. There is no telemetry, no install ping and no license check.
993
1041
  - **Reporting a vulnerability.** Please do not post exploit details in a public issue. Open an issue that asks for a private contact, or use the email address on the maintainer's GitHub profile, and you will get a reply before anything is published.
994
1042
  - **Secrets.** MaxMind license keys are never returned to the browser. Webhook URLs grant posting rights to your channel; treat them as secrets. Exports never contain tokens.
995
1043
  - **Admin panel sessions.** The Admin panel view reads Strapi's own `admin::session` records (origin `admin`). Only Super Admin can see or sign out admins until another role is granted `admin-sessions.read` / `admin-sessions.revoke`; a delegated role cannot sign out a Super Admin. Sign-outs need a signed-in administrator (not an admin API token), are rate limited and logged with admin ids and counts only.
@@ -7,7 +7,7 @@ import styled from "styled-components";
7
7
  import { Typography, Flex, LinkButton, Button, EmptyStateLayout, VisuallyHidden } from "@strapi/design-system";
8
8
  import { ArrowClockwise, ChartBubble, User, Clock, Calendar } from "@strapi/icons";
9
9
  import { EmptyDocuments } from "@strapi/icons/symbols";
10
- import { K as normalizeDeviceType, u as useSessionFormatters, l as pluginId, s as isCancelledRequest, m as logSafeAdminError, n as PersistentAlert, R as ReadableText, w as PageShell, x as StatGrid, y as StatCard, G as EqualGrid, b as getTranslation, L as getDeviceTypeMessage } from "./index-DUESEUaO.mjs";
10
+ import { K as normalizeDeviceType, u as useSessionFormatters, f as pluginId, n as isCancelledRequest, l as logSafeAdminError, h as PersistentAlert, R as ReadableText, q as PageShell, r as StatGrid, s as StatCard, z as EqualGrid, b as getTranslation, L as getDeviceTypeMessage } from "./index-B102RF2H.mjs";
11
11
  import { S as SectionCard } from "./SectionCard-D51bv4Hi.mjs";
12
12
  const ANALYTICS_UNKNOWN_KEY = "unknown";
13
13
  const VERSION_TOKEN = /^v?\d[\w.]*$/i;
@@ -9,7 +9,7 @@ const styled = require("styled-components");
9
9
  const designSystem = require("@strapi/design-system");
10
10
  const icons = require("@strapi/icons");
11
11
  const symbols = require("@strapi/icons/symbols");
12
- const index = require("./index-CgZiLcJ1.js");
12
+ const index = require("./index-w0OuPYFm.js");
13
13
  const SectionCard = require("./SectionCard-BlWv8CRt.js");
14
14
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
15
15
  const styled__default = /* @__PURE__ */ _interopDefault(styled);