strapi-plugin-magic-sessionmanager 4.21.0 → 4.22.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.
- package/CHANGELOG.md +48 -0
- package/README.md +46 -11
- package/dist/admin/{Analytics-BqdZIBV4.js → Analytics-DeDLGiCe.js} +1 -1
- package/dist/admin/{Analytics-C-OLLzoB.mjs → Analytics-WbCUmkQQ.mjs} +1 -1
- package/dist/admin/{App-Cx9v6n_7.js → App-Bkv-W0Sv.js} +1336 -2591
- package/dist/admin/{App-BswHmNQT.mjs → App-C4bihk2K.mjs} +1309 -2564
- package/dist/admin/{OnlineUsersWidget-BRmQPPp9.js → OnlineUsersWidget-CSvNe2rC.js} +1 -1
- package/dist/admin/{OnlineUsersWidget-Dusgjc1d.mjs → OnlineUsersWidget-q0Z6nbbO.mjs} +1 -1
- package/dist/admin/{Settings-DZyQheUS.mjs → Settings-avD0DbXP.mjs} +2 -2
- package/dist/admin/{Settings-DWGuf_Z3.js → Settings-xokFI5LO.js} +44 -44
- package/dist/admin/dashboardModel-BBNRgcEr.mjs +170 -0
- package/dist/admin/dashboardModel-D4389iIV.js +169 -0
- package/dist/admin/{de-DUnrmFWk.mjs → de-BQlEdBMr.mjs} +73 -4
- package/dist/admin/{de-24TPqzG6.js → de-HcJ19LKI.js} +73 -4
- package/dist/admin/{en-8mBSkWOF.js → en-DI-98CPM.js} +74 -5
- package/dist/admin/{en-D8J__tyF.mjs → en-DzuXWL1W.mjs} +74 -5
- package/dist/admin/{es-BgpgWdk0.mjs → es-BfyED9YI.mjs} +73 -4
- package/dist/admin/{es-ChUKey-Q.js → es-Cm0Eklav.js} +73 -4
- package/dist/admin/{fr-DE_CWmgq.js → fr-C3nzszsI.js} +73 -4
- package/dist/admin/{fr-k1MHYKJo.mjs → fr-CzFNGWq0.mjs} +73 -4
- package/dist/admin/index-6zc5D8eb.mjs +4729 -0
- package/dist/admin/index-Dk5Jqe5U.js +4730 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/{pt-BjqU5ioB.js → pt-BPZ6chPT.js} +73 -4
- package/dist/admin/{pt-DPO4DmDc.mjs → pt-DmyQnGI_.mjs} +73 -4
- package/dist/server/index.js +552 -55
- package/dist/server/index.mjs +552 -55
- package/package.json +1 -1
- package/dist/admin/index-Ceh3Q1Ki.js +0 -2308
- package/dist/admin/index-meLDPPwt.mjs +0 -2307
- package/dist/admin/settingsTabs-C1q5iMMw.mjs +0 -437
- package/dist/admin/settingsTabs-CfquZuKH.js +0 -436
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
# [4.22.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.21.0...v4.22.0) (2026-11-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* app-user security activity with its own permission, full page and Content Manager panel ([#43](https://github.com/Schero94/Magic-Sessionmanager/issues/43)) ([8716281](https://github.com/Schero94/Magic-Sessionmanager/commit/8716281cb2f9a5599be5579d9e51d39b50f3d49e))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Release type: minor (`feat`). Additive: one RBAC action (`user-activity.read`, "View app-user security activity"), two read-only admin routes and new admin screens; no stored data changes. Four app-user event labels are shorter (see Changed), and a refused request during an impersonation now names the impersonated user (see Changed).
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **Security activity of app users.** The app-user events the plugin has written to the security log since 4.17 (failed and refused sign-ins, lockouts and unlocks, session limits, the sign-out after a password change, new devices, impossible travel, "This wasn't me", personal data exports and impersonations of app users) were recorded but shown nowhere. They now have three places, all with the 4.19 event table, details dialog, colours, filters, pagination and CSV export:
|
|
14
|
+
* **App users tab › Security activity**: the latest eight events with **Show all**.
|
|
15
|
+
* **Full page** `/plugins/magic-sessionmanager/app-users/activity`: filters for the kind of event (Failed and refused sign-ins, Lockouts and unlocks, New devices / impossible travel / "This wasn't me", Session limit and password change, Personal data exports, Impersonation), the period and one user (**Show only events of …** in the details), Strapi's pagination and CSV export. Filters, page and user are in the URL.
|
|
16
|
+
* **Content Manager › user › Sessions panel › Security activity**: the latest three events of that user and **Show all security activity**, which opens the page filtered to the user.
|
|
17
|
+
* **Plain words for every event.** Each event has its own label, colour and icon, and a second line that says what happened, for example "Account locked for 15 minutes after 5 failed sign-ins", "Session limit of 3 reached", "9100 km from the last sign-in, 4550 km/h · DE to US", "The user downloaded 4 sessions and 12 security events". The details dialog adds **What happened**, the user, who did it (an admin, or **Automatic**), the address, place, browser, operating system, user agent and event id, and **Open user** (Content Manager) when the reader may see the user. All text in English, German (Sie), French, Spanish and Portuguese.
|
|
18
|
+
* **New permission "View app-user security activity"** (`plugin::magic-sessionmanager.user-activity.read`, Settings › Roles › Plugins › Session Manager › General). Super Admin holds it automatically; other roles only when granted. It guards both new routes and every new screen; without it nothing is requested.
|
|
19
|
+
* **API.** `GET /magic-sessionmanager/user-activity` (`event` = `all`, `failed`, `lockouts`, `suspicious`, `sessions`, `privacy`, `impersonation`; `userId` = documentId; `from`, `to`, `page`, `pageSize` 1-100; unknown keys are a 400) and `GET /magic-sessionmanager/user-activity/export` (500-row keyset batches, `cursor`). Rows: `id`, `event`, `at`, `target`, `user` (`{ id, documentId, email, username }`), `actor` (`{ type: 'admin' | 'system', id, name }`), `details` (numbers and codes of the event), `ipAddress`, `ipAnonymized`, `location`, `browser`, `os`, `deviceType`, `userAgent`; `meta.identity` says what was visible.
|
|
20
|
+
|
|
21
|
+
### Security and privacy
|
|
22
|
+
|
|
23
|
+
* **Identities as in Strapi (4.16.1 rules).** A user's email and username are returned only when the reader may read that user in the Content Manager (`plugin::content-manager.explorer.read` on `plugin::users-permissions.user`, including conditions and field-level permissions on `email` and `username`); otherwise the screens show "User #id". Admin names need `admin::users.read` ("Admin #id" otherwise). The reason an admin gave for an impersonation is returned only to readers who hold **Impersonate app users**. No entry titles, typed identifiers, device hashes, socket addresses or tokens are ever returned.
|
|
24
|
+
* **No admin data through the app-user view.** Events an admin caused (lock lifted, impersonation) store the admin's own request; their IP address, browser and user agent stay with the admin activity (**View admin activity**) and are never returned here.
|
|
25
|
+
* **Export audit.** Every export of the app-user activity records an always-on `security-log.read` event (`list: 'user-activity'`, `exported: true`, `via: 'admin-panel'` or `'admin-token'`); reads with an admin API token are recorded as for the admin lists since 4.17 (once per token and list within 5 minutes). The admin **Security activity** page shows them as **Security log exported** / **Log read with an API token** under **Settings and log access**.
|
|
26
|
+
* **Privacy settings apply when reading.** Events older than the security log retention are hidden at once (the daily retention run deletes them); with **Anonymise IP addresses** on, older full addresses are shown shortened; with **Store IP addresses** off, no address and no place is returned. No location is looked up when reading; a place appears only where the opt-in location lookup stored one.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
* **Keyboard access to the event tables (also the 4.19 admin lists).** The column headers did not pass on the grid coordinates the DS table gives its cells, so no cell had `tabIndex=0` and Tab skipped every Security activity, Sign-in history and Activity table; only a mouse could open an event's details. Tab now enters the table once, the arrow keys move between cells and Enter or Space on the eye opens the details, as in Strapi's own tables.
|
|
31
|
+
* **Filter chips.** The removable "Admin: …" / "User: …" filter used the DS Tag, whose remove button is 28 × 28 px; it is now a DS IconButton of 32 px (WCAG 2.5.8, the plugin's mobile rule).
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
* The labels of four app-user events are shorter, because they only appear in the App users view: "Sign-in failed", "Sign-in refused", "Locked out", "Lock lifted" (were "App user sign-in failed", "App user sign-in refused", "App user locked out", "Lockout lifted"). Impersonation events have one label each (started, ended, timed out, request refused) instead of one shared label.
|
|
36
|
+
* A request refused during an impersonation (`impersonation.refused`, `meta.refusal: call-*`) now stores the impersonated user as target instead of none, so it appears in that user's activity and is deleted with the account. Older rows keep `targetId: null` and show "Unknown account".
|
|
37
|
+
* Internal: the three security log lists share one event table component and one query schema module (`server/src/utils/event-query.js`); the admin lists look and behave as before.
|
|
38
|
+
|
|
39
|
+
### Migration
|
|
40
|
+
|
|
41
|
+
* Nothing to do. Strapi adds the new permission to the Super Admin role at start-up. Grant **View app-user security activity** to other roles that should see the app-user events (it shows personal data: emails, IP addresses, devices).
|
|
42
|
+
* Webhook deliveries are not written to the security log, so the new view has no webhook events.
|
|
43
|
+
|
|
44
|
+
### Tests
|
|
45
|
+
|
|
46
|
+
* `tests/isolated-user-activity-http.test.js` (real Strapi, SQLite and PostgreSQL in CI, and the 5.50 floor): RBAC (anonymous 401, Editor and access-only 403, Super Admin automatically 200, granted 200, revoked 403), a real failed sign-in, every event type and no admin event, email masking with field-level Content Manager permissions, admin names, the impersonation reason, filters and paging with 400s for bad input, keyset export with the export audit, admin API token audit, anonymise and IP-off at read time, retention at read time and deletion with the user.
|
|
47
|
+
* Unit tests for the server model, the service rows and the controller audit; admin model tests for every label, the second lines, URL state and CSV; StrictMode tests for the App users section, the full page and the Sessions panel (with and without the permission).
|
|
48
|
+
|
|
1
49
|
# [4.21.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.20.0...v4.21.0) (2026-11-25)
|
|
2
50
|
|
|
3
51
|
|
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ Live docs: [https://schero94.github.io/Magic-Sessionmanager/](https://schero94.g
|
|
|
41
41
|
- [Examples](#examples)
|
|
42
42
|
- [Optional route policy: `session-required`](#optional-route-policy-session-required)
|
|
43
43
|
- [Admin API and permissions](#admin-api-and-permissions)
|
|
44
|
+
- [Security activity of app users](#security-activity-of-app-users)
|
|
44
45
|
- [Admin activity and sign-in history](#admin-activity-and-sign-in-history)
|
|
45
46
|
- [Impersonation](#impersonation)
|
|
46
47
|
- [Running several instances (Railway replicas, pm2 cluster)](#running-several-instances-railway-replicas-pm2-cluster)
|
|
@@ -180,6 +181,7 @@ Strapi 5.62, synthetic admins `*.example.test`. The [gallery](https://schero94.g
|
|
|
180
181
|
| Content Manager, User edit view | **Sessions** panel | What access does this user have, and how do I cut it off? |
|
|
181
182
|
| Strapi homepage | **Online users** widget | Who is online right now? |
|
|
182
183
|
| Session Manager › Admin panel | **Admin panel sessions** | Who is signed in to this admin panel, and how do I sign someone out? |
|
|
184
|
+
| Session Manager › App users | **Security activity of app users** | Which security events happened to my app's users, and to whom? |
|
|
183
185
|
| Settings › Session Manager | **Configuration** | How should sessions and sign-ins behave? |
|
|
184
186
|
| Settings › Session Manager | **Analytics** | How are sessions used over time and by device? |
|
|
185
187
|
|
|
@@ -225,6 +227,7 @@ Shown on the edit view of a Users & Permissions user only.
|
|
|
225
227
|
- **End all sessions:** signs the user out on every device. The user can sign in again unless the account is blocked.
|
|
226
228
|
- **Block user** / **Unblock user:** blocking ends all open sessions and prevents sign-in. The open form's Blocked field is updated, so a later Save does not undo it. Setting the native Blocked field and saving has the same effect.
|
|
227
229
|
- Up to five open sessions, then **Show all sessions**, which opens the dashboard filtered by the user's email.
|
|
230
|
+
- **Security activity** (roles with "View app-user security activity"): the user's latest three security events and **Show all security activity**, which opens [Security activity of app users](#security-activity-of-app-users) filtered by this user.
|
|
228
231
|
- For an unsaved user the panel only says "Save this user before you can manage sessions."
|
|
229
232
|
|
|
230
233
|
### Online users widget
|
|
@@ -761,6 +764,7 @@ The **Admin panel sessions** routes need two more permissions, which only the Su
|
|
|
761
764
|
| `plugin::magic-sessionmanager.admin-sessions.read` | Read admin panel sessions | The Admin panel view and its two GET routes |
|
|
762
765
|
| `plugin::magic-sessionmanager.admin-sessions.revoke` | Sign out admins | **Sign out** and **Sign out everywhere** (also needs read) |
|
|
763
766
|
| `plugin::magic-sessionmanager.admin-activity.read` | View admin activity | Sign-in history, Activity, Recent security activity and the Security activity page, CSV exports and changing the Admin activity settings (also needs read) |
|
|
767
|
+
| `plugin::magic-sessionmanager.user-activity.read` | View app-user security activity | **Security activity** on the App users tab and in the user's Sessions panel, the full page and its CSV export (also needs `access`, not `admin-sessions.read`); see [Security activity of app users](#security-activity-of-app-users) |
|
|
764
768
|
| `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), the signed webhook and its **Send test**, the event selection, impossible travel and shortened session IPs, and (with View admin activity) the security log settings. Since 4.17; Super Admin only by default |
|
|
765
769
|
| `plugin::magic-sessionmanager.lockouts.unlock` | Unlock locked sign-ins | **Unlock** in Login protection › Locked now (also needs `access`) |
|
|
766
770
|
| `plugin::magic-sessionmanager.impersonate.users` | Impersonate app users | Starting, listing and ending impersonations of app users (also needs `access` and the **Allow impersonation** switch); see [Impersonation](#impersonation). Since 4.20 |
|
|
@@ -800,6 +804,8 @@ The **Admin panel sessions** routes need two more permissions, which only the Su
|
|
|
800
804
|
| GET | `/admin-activity/sign-ins/export` | CSV export batches of 500 rows, newest first; same filters plus `cursor`; follow `meta.nextCursor` |
|
|
801
805
|
| 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` |
|
|
802
806
|
| GET | `/admin-activity/content/export` | CSV export batches of 500 rows; same filters plus `cursor` |
|
|
807
|
+
| GET | `/user-activity` | **Security activity of app users**: `event` (`all`, `failed`, `lockouts`, `suspicious`, `sessions`, `privacy`, `impersonation`), `userId` (documentId), `from`, `to`, `page`, `pageSize` (1-100); needs `user-activity.read` |
|
|
808
|
+
| GET | `/user-activity/export` | CSV export batches of 500 rows; same filters plus `cursor`; the first batch of every export is recorded in the security log |
|
|
803
809
|
| GET | `/lockouts` | **Locked now**: `{ data: [{ id, kind: 'ip' \| 'account', ip, user, failures, lockedAt, until }] }`; read rate limit |
|
|
804
810
|
| POST | `/lockouts/unlock` | **Unlock**: body `{ id }` from the list; needs `lockouts.unlock`; 404 when the lock already ended; 10 per minute |
|
|
805
811
|
| GET | `/roles` | Users & Permissions roles (without Public) for **Different rules for some roles** |
|
|
@@ -826,6 +832,31 @@ Errors use Strapi's `{ data: null, error }` envelope: 400 for invalid input, 404
|
|
|
826
832
|
|
|
827
833
|
---
|
|
828
834
|
|
|
835
|
+
## Security activity of app users
|
|
836
|
+
|
|
837
|
+
Since 4.17 the plugin writes app-user events to its security log; since 4.22 they are shown. Open **Session Manager** (the App users view) and scroll to **Security activity**: the latest eight events, newest first, with **Show all**. The same events of one user are in the user's **Sessions** panel in the Content Manager.
|
|
838
|
+
|
|
839
|
+
| Event | Shown as | Second line (example) |
|
|
840
|
+
| ------------------------------------------------------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
841
|
+
| `user.sign-in.failed` | Sign-in failed | No account with this email or username |
|
|
842
|
+
| `user.sign-in.refused` | Sign-in refused | Session limit of 3 reached; Risky address (VPN, proxy or Tor); Sign-ins from this country are blocked |
|
|
843
|
+
| `user.lockout` | Locked out | Account locked for 15 minutes after 5 failed sign-ins |
|
|
844
|
+
| `user.lockout.lifted` | Lock lifted | An admin unlocked the account · by Ada Example |
|
|
845
|
+
| `user.session.limit` | Session limit reached | 1 older session ended to stay within 2 |
|
|
846
|
+
| `user.password-change.ended-others` | Signed out after a password change | 2 other sessions ended |
|
|
847
|
+
| `user.sign-in.new-device` | Sign-in from a new device | Firefox 133 on Linux (device column) |
|
|
848
|
+
| `user.sign-in.impossible-travel` | Impossible travel | 9100 km from the last sign-in, 4550 km/h · DE to US |
|
|
849
|
+
| `user.not-me` | Reported as "This wasn't me" | The user ended all their sessions |
|
|
850
|
+
| `user.data.exported` | Personal data exported | The user downloaded 4 sessions and 12 security events |
|
|
851
|
+
| `impersonation.started` / `.ended` / `.expired` / `.refused` | Impersonation started / ended / timed out / request refused | For 30 minutes; Ended by an admin; A sign-in, password or email request was blocked |
|
|
852
|
+
|
|
853
|
+
Red marks a security signal (failed, refused, locked, impossible travel, "This wasn't me", refused impersonation), amber a rule that ended sessions or a running impersonation, blue information (new device, data export, lock lifted), grey the end of an impersonation.
|
|
854
|
+
|
|
855
|
+
- **Full page** (`/plugins/magic-sessionmanager/app-users/activity`): the same table across the width with **Time**, **Event** (badge and what happened), **User**, **IP address and device** and **Done by** (an admin, or **Automatic**). Filters: kind of event, period, one user (**Show only events of …** in the details, removable tag). Strapi's pagination; filters, page and user live in the URL, so `?userId=<documentId>` is a shareable link. **Export CSV** exports every event that matches the filters (up to 10,000 newest).
|
|
856
|
+
- **Details** (row click or the eye button): the exact time, **What happened**, the user, who did it, the address, place, browser, operating system, user agent and event id, and **Open user** when you may see the user.
|
|
857
|
+
- **Below about 800 px** the table becomes stacked rows; the Sessions panel always uses them.
|
|
858
|
+
- **Permission:** "View app-user security activity" (`user-activity.read`); Super Admin has it automatically. Without it, the section, the page and the panel section are not shown and nothing is requested. Identities, retention and IP rules: see [What is recorded](#what-is-recorded-fact-sheet-for-data-protection-and-works-councils).
|
|
859
|
+
|
|
829
860
|
## Admin activity and sign-in history
|
|
830
861
|
|
|
831
862
|
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:
|
|
@@ -1245,20 +1276,22 @@ The plugin sits in the request path of every authenticated Content API call, so
|
|
|
1245
1276
|
|
|
1246
1277
|
Information for your records of processing, a data protection impact assessment or a works agreement (Germany: section 87(1) no. 6 BetrVG when the users are employees). It describes the software, not your legal basis; it is not legal advice.
|
|
1247
1278
|
|
|
1248
|
-
| Data | When it is recorded | Where | Kept for | Who can see it
|
|
1249
|
-
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
1250
|
-
| App-user session: user, sign-in, last activity and sign-out time, end reason, IP address, browser, system, device type, country and city (when location lookup is on) | Every sign-in and while the session is used | `magic_sessions` | Ended sessions: `retentionDays` (default 90; presets 7, 90, 365; or forever) | Admins with **Access the Session Manager plugin**; the user through the Content API
|
|
1251
|
-
| Device key (HMAC of browser family, system family, device type and the app's `deviceId`) | Every sign-in | `magic_sessions.device_key` | With the session | Nobody in the UI (used only to compare devices)
|
|
1252
|
-
| Rounded location (0.1 degree, about 11 km) | Every sign-in while **Detect impossible travel** is on | Inside the session's location | With the session | Admins with plugin access
|
|
1253
|
-
| Failed and refused app-user sign-ins, locks, unlocks (with the admin who unlocked), session-limit and password-change endings, new device, impossible travel, "This wasn't me", data exports | When they happen | `magic_sessions_security_events` | `securityLogRetentionDays` (default 90) | Admins with **View
|
|
1254
|
-
| Unknown-account sign-ins | Once per anonymised address per 5 minutes | Same log, without account and without the typed name | Same | Same
|
|
1255
|
-
| Lock counters | During the counting window and the lock | `magic_sm_counters` (SHA-256 hashes of IP and identifier) | Until the lock ends | Nobody (hashes)
|
|
1256
|
-
| "Locked now" entries | While a lock lasts | `magic_sm_cache` | Until the lock ends | Admins with plugin access
|
|
1257
|
-
| Admin sign-ins and, opt-in, Content Manager activity | See [Admin activity](#admin-activity-and-sign-in-history) | Security log | `securityLogRetentionDays` | Admins with **View admin activity**
|
|
1258
|
-
| Impersonations: admin, user, reason, duration, start and end; refused starts and refused requests | When an admin impersonates a user | `magic_sessions_impersonations` and the security log | Table: 7 days after the end; log: `securityLogRetentionDays` | Admins with **Impersonate app users** (list), **View admin activity** (log)
|
|
1279
|
+
| Data | When it is recorded | Where | Kept for | Who can see it | Switch |
|
|
1280
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
1281
|
+
| App-user session: user, sign-in, last activity and sign-out time, end reason, IP address, browser, system, device type, country and city (when location lookup is on) | Every sign-in and while the session is used | `magic_sessions` | Ended sessions: `retentionDays` (default 90; presets 7, 90, 365; or forever) | Admins with **Access the Session Manager plugin**; the user through the Content API | IP shortening: **Shorten IP addresses of sessions** (off); location: **IP location lookup** |
|
|
1282
|
+
| Device key (HMAC of browser family, system family, device type and the app's `deviceId`) | Every sign-in | `magic_sessions.device_key` | With the session | Nobody in the UI (used only to compare devices) | Always; it cannot be turned back into the device |
|
|
1283
|
+
| Rounded location (0.1 degree, about 11 km) | Every sign-in while **Detect impossible travel** is on | Inside the session's location | With the session | Admins with plugin access | **Detect impossible travel** (off) |
|
|
1284
|
+
| Failed and refused app-user sign-ins, locks, unlocks (with the admin who unlocked), session-limit and password-change endings, new device, impossible travel, "This wasn't me", data exports | When they happen | `magic_sessions_security_events` | `securityLogRetentionDays` (default 90) | Admins with **View app-user security activity** (emails only with Content Manager read access to users), the user (own-data export) | **Record failed and refused sign-ins** (on) for failed/refused/locks; the others only while their feature is on |
|
|
1285
|
+
| Unknown-account sign-ins | Once per anonymised address per 5 minutes | Same log, without account and without the typed name | Same | Same | Same |
|
|
1286
|
+
| Lock counters | During the counting window and the lock | `magic_sm_counters` (SHA-256 hashes of IP and identifier) | Until the lock ends | Nobody (hashes) | Lockout thresholds; 0 turns a lock off |
|
|
1287
|
+
| "Locked now" entries | While a lock lasts | `magic_sm_cache` | Until the lock ends | Admins with plugin access | Follows the log's IP options |
|
|
1288
|
+
| Admin sign-ins and, opt-in, Content Manager activity | See [Admin activity](#admin-activity-and-sign-in-history) | Security log | `securityLogRetentionDays` | Admins with **View admin activity** | **Record admin sign-ins** (on), **Record Content Manager activity** (off) |
|
|
1289
|
+
| Impersonations: admin, user, reason, duration, start and end; refused starts and refused requests | When an admin impersonates a user | `magic_sessions_impersonations` and the security log | Table: 7 days after the end; log: `securityLogRetentionDays` | Admins with **Impersonate app users** (list), **View admin activity** (log) | **Allow impersonation** (off) |
|
|
1259
1290
|
|
|
1260
1291
|
What leaves the server, only when you turn it on: security emails through Strapi's email provider; Discord, Slack and the signed webhook with the selected events (user documentId, IP as the log stores it, browser, country, city, event details; never email addresses or passwords); IP lookups at ipapi.co only with the `auto`/`ipapi` provider. No telemetry.
|
|
1261
1292
|
|
|
1293
|
+
**Security activity of app users (4.22).** These app-user events are shown in Session Manager › App users › Security activity, on its full page and in each user's Sessions panel, to roles with **View app-user security activity** only (Super Admin by default). The view shows the user's email and username only to admins who may read that user in the Content Manager (otherwise "User #id"), admin names only with Strapi's **Read** permission on Users, and an impersonation reason only to admins who may impersonate. It follows the security log settings when it reads: events older than `securityLogRetentionDays` are hidden at once, **Anonymise IP addresses** also shortens older addresses, and with **Store IP addresses** off no address or place is shown. It never looks up a location; a place appears only where the opt-in location lookup stored one. Events an admin caused (lock lifted, impersonation) show no IP address or browser in this view: those would be the admin's own, which stay behind **View admin activity**. Every CSV export (and every read with an admin API token) is itself recorded in the security log with the admin who did it (**Security log exported** under Settings and log access). Webhook deliveries are not recorded.
|
|
1294
|
+
|
|
1262
1295
|
Purpose: protecting accounts (lockouts, session control, detection of misuse). No performance or behaviour scoring of people is computed. Users can download their own data (`GET /api/magic-sessionmanager/my-data`); deleting a user deletes their security events; retention jobs delete older data daily.
|
|
1263
1296
|
|
|
1264
1297
|
## Troubleshooting
|
|
@@ -1376,6 +1409,8 @@ SESSION_HTTP_REQUIRED=1 SESSION_HTTP_STRAPI_NODE_MODULES=$PWD/node_modules node
|
|
|
1376
1409
|
|
|
1377
1410
|
CI runs the same suites a second time against Strapi 5.50.0, the peer floor, installed into a separate directory (`SESSION_HTTP_STRAPI_NODE_MODULES=<dir>/node_modules`), so the floor stays tested.
|
|
1378
1411
|
|
|
1412
|
+
The app-user activity suite (`tests/isolated-user-activity-http.test.js`) checks RBAC (Super Admin automatically, 403 without the permission, 200 when granted), email masking with field-level Content Manager permissions, the export audit, filters, paging and the read-time privacy rules.
|
|
1413
|
+
|
|
1379
1414
|
The admin panel suite signs synthetic admins in through `POST /admin/login` and checks listing, signing out one browser and everywhere, self sign-out, the Super Admin guard, RBAC denials, the rate limit, that the next request and the refresh are rejected, and that admin sessions never reach the app-user numbers.
|
|
1380
1415
|
|
|
1381
1416
|
Quick manual check: sign in to your app as an end user (`POST /api/auth/local`), open Session Manager and find the session as **Active**, click **End session** and confirm, then call any Content API route with the same token: it returns 401 and the row shows **Ended · Ended manually**.
|
|
@@ -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-
|
|
12
|
+
const index = require("./index-Dk5Jqe5U.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);
|
|
@@ -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 {
|
|
10
|
+
import { aN as normalizeDeviceType, u as useSessionFormatters, f as pluginId, F as isCancelledRequest, l as logSafeAdminError, h as PersistentAlert, R as ReadableText, Q as PageShell, T as StatGrid, W as StatCard, au as EqualGrid, b as getTranslation, aO as getDeviceTypeMessage } from "./index-6zc5D8eb.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;
|