strapi-plugin-magic-sessionmanager 4.17.0 → 4.18.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 +35 -0
- package/README.md +78 -18
- package/dist/admin/{Analytics-BTIByTUY.js → Analytics-C8fV6LDV.js} +1 -1
- package/dist/admin/{Analytics-B-p2Q7th.mjs → Analytics-CBspdl1I.mjs} +1 -1
- package/dist/admin/{App-CH6635JB.js → App-D92MTQmn.js} +2 -2
- package/dist/admin/{App-DmesuM2g.mjs → App-PLwqaRSQ.mjs} +2 -2
- package/dist/admin/{OnlineUsersWidget-TlOp8nie.js → OnlineUsersWidget-CiKapC1B.js} +1 -1
- package/dist/admin/{OnlineUsersWidget-CuqeQ0tb.mjs → OnlineUsersWidget-CwfBJdIX.mjs} +1 -1
- package/dist/admin/{Settings-C4IgGBjQ.mjs → Settings-CMgL-Aub.mjs} +866 -38
- package/dist/admin/{Settings-DtP_H4JS.js → Settings-Duil_4jv.js} +866 -38
- package/dist/admin/{dashboardModel-0ROcWcB1.mjs → dashboardModel-BhUonEqc.mjs} +1 -1
- package/dist/admin/{dashboardModel-BSJhZdXI.js → dashboardModel-sksvIc1c.js} +1 -1
- package/dist/admin/{de-C_ooq6EF.js → de-CnInuvMY.js} +87 -3
- package/dist/admin/{de-BoahnYIP.mjs → de-D2BqfY1f.mjs} +87 -3
- package/dist/admin/{en-DHme92L-.mjs → en-BPy208we.mjs} +87 -3
- package/dist/admin/{en-CuUVE2K0.js → en-KnmmYHTF.js} +87 -3
- package/dist/admin/{es-CjcTgS9Z.mjs → es-B4VNeT0A.mjs} +87 -3
- package/dist/admin/{es-lbDNXcQi.js → es-D1NGCAJK.js} +87 -3
- package/dist/admin/{fr-BPwnrSaC.mjs → fr-AwhLN1BC.mjs} +87 -3
- package/dist/admin/{fr-RtypjgGp.js → fr-D1KNyogi.js} +87 -3
- package/dist/admin/{index-B102RF2H.mjs → index-BmnC2BPs.mjs} +9 -9
- package/dist/admin/{index-w0OuPYFm.js → index-Bnt0Jq6O.js} +9 -9
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/{pt-D5FHSP2y.mjs → pt-D6m1TijL.mjs} +87 -3
- package/dist/admin/{pt-BMCAKRQ4.js → pt-EKThRXPY.js} +87 -3
- package/dist/server/index.js +1686 -26
- package/dist/server/index.mjs +1686 -26
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
# [4.18.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.17.0...v4.18.0) (2026-11-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* new-device email with "This wasn't me", impossible travel, signed webhook and GDPR self-service ([#37](https://github.com/Schero94/Magic-Sessionmanager/issues/37)) ([92af596](https://github.com/Schero94/Magic-Sessionmanager/commit/92af5962b647827851a4225d0b135c1fff95dffe))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Release type: minor (`feat`). Additive: one new admin route, three new Content API routes, one new Content API permission, one new private session column and new settings keys; see Migration.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
* **New-device email with "This wasn't me"** (Alerts › Security emails › Sign-in from a new device, `alertOnNewDevice`, off by default). A device is the browser family, operating system family and device type from the User-Agent, plus the `deviceId` the app may send at sign-in; the plugin stores only `deviceKey`, an HMAC-SHA256 of these with a key derived from `SESSION_ENCRYPTION_KEY` (new private session column). No fingerprinting, no cookie. New = not seen in the user's last 50 sessions; the first sign-in is never new. Event `user.sign-in.new-device`.
|
|
14
|
+
* **"This wasn't me" link** in the new-device and impossible-travel emails: `GET /api/magic-sessionmanager/not-me?token=` shows a confirmation page only (mail scanners cannot end sessions); `POST /api/magic-sessionmanager/not-me` (`token`, `scope=session|all`, form or JSON) ends that session or every session of the user. The token is signed (HMAC-SHA256, purpose key), expires after 72 hours and works once across all processes; both routes are public on purpose and rate-limited per address (30 and 10 per minute). Event `user.not-me`. The link is built from `server.url` (no link without an absolute http(s) URL).
|
|
15
|
+
* **Impossible travel** (Login protection › Impossible travel, `impossibleTravelEnabled`, off by default): distance between the locations of this and the previous sign-in divided by the time between them; flagged above `impossibleTravelSpeedKmh` (1000) over at least `impossibleTravelMinDistanceKm` (500). Needs a location database with cities; while on, session locations are stored rounded to 0.1 degree. Action `alert` (default: event `user.sign-in.impossible-travel`, optional email `alertOnImpossibleTravel`, webhook) or `reauthenticate` (every session of the user ends; the sign-in gets `401` with `details.code: "REAUTHENTICATION_REQUIRED"` and no token).
|
|
16
|
+
* **Signed webhook** (Alerts › Signed webhook, off by default): POST JSON `{ id, event, createdAt, data }` to your https endpoint with `X-Magic-Sessionmanager-Signature: t=<unix>,v1=<HMAC-SHA256 of "t.body">`, `X-Magic-Sessionmanager-Event` and `X-Magic-Sessionmanager-Delivery`. SSRF guard: https only, no credentials in the URL, every resolved address must be public (no loopback, private, link-local incl. 169.254.169.254, CGNAT, multicast, reserved, documentation, unique-local IPv6), the connection is pinned to the checked address, redirects are not followed, 5-second timeout, at most 64 KB of the answer read. Retries after 2 and 10 seconds for network errors, timeouts, 429 and 5xx. The URL and the secret are write-only: the admin API returns only `hasGenericWebhook` / `hasGenericWebhookSecret`, the secret is stored encrypted; a PUT without the fields keeps them. **Send test** (`POST /magic-sessionmanager/webhook/test`) reports a safe result code.
|
|
17
|
+
* **Events to send** (`webhookEvents`): one selection for Discord, Slack and the signed webhook: every successful sign-in, suspicious, new country, new device, impossible travel, failed, refused, lockout, lock lifted, session limit, password change, "This wasn't me".
|
|
18
|
+
* **Own-data export** (GDPR Art. 15): `GET /api/magic-sessionmanager/my-data` (signed-in user, own data only, 3 per hour) returns the user's sessions and security events as a JSON download, without tokens, hashes, device keys or native ids. The Authenticated role gets the new permission `self-service.exportOwnData` once (installations at permission version 2 get only this action). Event `user.data.exported`.
|
|
19
|
+
* **Shorten IP addresses of sessions** (Data and retention › Privacy, `sessionIpAnonymize`, off by default): new sessions store 203.0.113.0 instead of 203.0.113.42 (IPv6 /48).
|
|
20
|
+
* **Retention presets** (Data and retention): Minimal (sessions 7 days, events 30), Standard (90/90), Extended (365/365); the security log part needs "View admin activity" and "Change protected settings".
|
|
21
|
+
* The signed webhook, the event selection, impossible travel and **Shorten IP addresses of sessions** are **protected settings** (`settings.update`), like the Discord and Slack webhooks; **Send test** (`POST /magic-sessionmanager/webhook/test`) needs the same permission. The new-device and impossible-travel email switches stay with plugin access, like the other alert emails. The signed webhook URL is returned only as `hasGenericWebhook` with `genericWebhookHint` (scheme and host), the secret only as `hasGenericWebhookSecret`.
|
|
22
|
+
* README: "What is recorded" fact sheet for data protection and works councils, webhook verification snippet, the not-me and export routes.
|
|
23
|
+
|
|
24
|
+
### Migration
|
|
25
|
+
|
|
26
|
+
* `X-Session-Terminated-Reason` keeps its five values: sessions ended by the session limit, "This wasn't me" or "Require a new sign-in" report `manual`, by a password change `logout`.
|
|
27
|
+
* **Discord and Slack no longer post every sign-in by default.** New installations send only the selected events (default: suspicious, new country, new device, impossible travel, lockout, "This wasn't me"). An installation upgraded from 4.16 or earlier keeps posting every sign-in (`webhookEvents` is stored once as `login.success`, `login.suspicious`, `login.new_location`) until an administrator changes **Events to send**.
|
|
28
|
+
* The session table gets a private `deviceKey` column (Strapi adds it on start). Sessions from before the upgrade have none and are compared by browser and system family.
|
|
29
|
+
* Content API permission version 3: the Authenticated role gets `self-service.exportOwnData` once; actions an administrator removed stay removed.
|
|
30
|
+
|
|
31
|
+
### Tests
|
|
32
|
+
|
|
33
|
+
* `tests/isolated-signals-http.test.js` (real Strapi): new-device email and link, not-me GET/POST (single use, tampered token, scope all, German page), impossible travel (alert with email, re-sign-in), write-only webhook URL and secret, test send refused for 127.0.0.1 and 169.254.169.254, RBAC, event selection, own-data export (no token material, rate limit), permission grant, shortened IPs. CI runs it on SQLite and PostgreSQL in both JWT modes and on the 5.50 floor.
|
|
34
|
+
* Unit tests for the SSRF guard (incl. IPv4-mapped forms), signatures and their verification, pinned delivery, retries, the not-me token (tamper, expiry, parallel single use), device keys, travel maths and detection settings; rendered tests for the event checklist and the signed webhook card.
|
|
35
|
+
|
|
1
36
|
# [4.17.0](https://github.com/Schero94/Magic-Sessionmanager/compare/v4.16.1...v4.17.0) (2026-11-25)
|
|
2
37
|
|
|
3
38
|
|
package/README.md
CHANGED
|
@@ -545,7 +545,46 @@ Sessions › Roles › **Different rules for some roles** (collapsed): per Users
|
|
|
545
545
|
Configuration › Alerts. Both kinds are sent only when location data is available for the sign-in.
|
|
546
546
|
|
|
547
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`).
|
|
548
|
-
- **Team notifications** post
|
|
548
|
+
- **Team notifications** post the events selected under **Events to send** to Discord or Slack. A sign-in is sent as `login.suspicious`, otherwise `login.new_location`, otherwise `login.success`, when that event is selected. New installations leave out `login.success` (every sign-in); installations upgraded from 4.16 or earlier keep it selected until it is changed. 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 and the event selection needs **Change protected settings**.
|
|
549
|
+
|
|
550
|
+
- **New device** (`alertOnNewDevice`, off) and **impossible travel** (`alertOnImpossibleTravel`, off, needs [impossible travel](#new-device-and-impossible-travel)) emails carry a **"This wasn't me"** link. These two are evaluated even without location data for the new-device case.
|
|
551
|
+
|
|
552
|
+
### New device and impossible travel
|
|
553
|
+
|
|
554
|
+
- **Device, without fingerprinting.** Browser family, operating system family and device type from the User-Agent header, plus the optional `deviceId` your app sends in the sign-in body (Users & Permissions uses the same field for its sessions). No cookie is set and nothing else is read. The session stores `deviceKey`, an HMAC-SHA256 of these values with a key derived from `SESSION_ENCRYPTION_KEY`, so it cannot be linked to a device outside your installation. A sign-in is from a **new device** when none of the user's last 50 sessions has the same key; the first sign-in of a user is never new. Sessions created before 4.17 have no key and are compared by browser and system family.
|
|
555
|
+
- **Impossible travel** (Login protection › Impossible travel, off). The great-circle distance between this sign-in and the user's previous sign-in with a location, divided by the time between them. Flagged when the distance is at least `impossibleTravelMinDistanceKm` (500) and the speed is above `impossibleTravelSpeedKmh` (1000). Needs a location database with cities (coordinates); while the feature is on, locations are stored rounded to 0.1 degree (about 11 km). VPNs and mobile networks cause false alarms, so the default action only records and alerts. **Require a new sign-in** ends every session of the user and answers `401` with `error.details.code: "REAUTHENTICATION_REQUIRED"`; signing in again from the new place then works.
|
|
556
|
+
- **"This wasn't me"**: the link opens `GET /api/magic-sessionmanager/not-me?token=…`, a confirmation page in the user's browser language (en, de, fr, es, pt) that changes nothing; **Sign out that device** or **Sign out everywhere** posts to the same path. The token is signed (HMAC-SHA256 with its own derived key), expires after 72 hours and works once, also across processes. The link is built from `server.url`; without an absolute http(s) URL the email has no link. Both routes are public on purpose and rate-limited per address.
|
|
557
|
+
|
|
558
|
+
### Signed webhook
|
|
559
|
+
|
|
560
|
+
Alerts › **Signed webhook** sends the selected events to your own https endpoint (for example a SIEM):
|
|
561
|
+
|
|
562
|
+
```http
|
|
563
|
+
POST /your/endpoint HTTP/1.1
|
|
564
|
+
Content-Type: application/json
|
|
565
|
+
X-Magic-Sessionmanager-Event: lockout
|
|
566
|
+
X-Magic-Sessionmanager-Delivery: 0f7c9a1e-…
|
|
567
|
+
X-Magic-Sessionmanager-Signature: t=1795000000,v1=5b1f…
|
|
568
|
+
|
|
569
|
+
{"id":"0f7c9a1e-…","event":"lockout","createdAt":"2026-11-25T09:00:00.000Z","data":{"user":{"documentId":"…"},"ip":"203.0.113.0","userAgent":"…","location":{"country":"DE","city":"Berlin"},"details":{"kind":"account","failures":5,"minutes":15}}}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
Verify every delivery before you trust it (Node.js):
|
|
573
|
+
|
|
574
|
+
```js
|
|
575
|
+
const crypto = require('node:crypto');
|
|
576
|
+
|
|
577
|
+
function verifyMagicSignature(secret, rawBody, header, toleranceSeconds = 300) {
|
|
578
|
+
const match = /^t=(\d+),v1=([a-f0-9]{64})$/.exec(header || '');
|
|
579
|
+
if (!match) return false;
|
|
580
|
+
if (Math.abs(Date.now() / 1000 - Number(match[1])) > toleranceSeconds) return false; // replay
|
|
581
|
+
const expected = crypto.createHmac('sha256', secret).update(`${match[1]}.${rawBody}`).digest();
|
|
582
|
+
const given = Buffer.from(match[2], 'hex');
|
|
583
|
+
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
Use the raw request body (before JSON parsing). The URL and the secret are write-only: after saving, the admin panel only shows that they are set (the URL with its host, `https://hooks.example.com/…`); the secret is stored encrypted. Over the API, `GET /settings` returns `hasGenericWebhook`, `genericWebhookHint` and `hasGenericWebhookSecret` instead of the values; a `PUT` without `genericWebhookUrl` / `genericWebhookSecret` keeps the stored value, an empty string removes it. Changing the signed webhook, the event selection and **Send test** need **Change protected settings**. The server refuses URLs that are not https or contain credentials, and checks before every delivery that **every** address the host resolves to is public (no loopback, private, link-local including `169.254.169.254`, CGNAT, multicast, reserved, documentation or unique-local IPv6 address); it then connects to the checked address, does not follow redirects, times out after 5 seconds and reads at most 64 KB of the answer. Network errors, timeouts, 429 and 5xx are retried after 2 and 10 seconds. **Send test** sends one `test` event and shows the result.
|
|
549
588
|
|
|
550
589
|
Example email provider configuration:
|
|
551
590
|
|
|
@@ -576,15 +615,17 @@ export default ({ env }) => ({
|
|
|
576
615
|
|
|
577
616
|
Prefix `/api/magic-sessionmanager`. Every route requires a Users & Permissions JWT (`Authorization: Bearer <JWT>`), works on the caller's **own** sessions only and is rate-limited (writes 10, reads 120 requests per minute by default; 429 with `Retry-After`).
|
|
578
617
|
|
|
579
|
-
| Method
|
|
580
|
-
|
|
|
581
|
-
| GET
|
|
582
|
-
| GET
|
|
583
|
-
| GET
|
|
584
|
-
| POST
|
|
585
|
-
| POST
|
|
586
|
-
| POST
|
|
587
|
-
| DELETE
|
|
618
|
+
| Method | Path | Purpose | Response |
|
|
619
|
+
| --------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
620
|
+
| GET | `/my-sessions` | Own sessions (up to 200), current session first | `{ data: [...], meta: { count, active, hasMore, limit } }` |
|
|
621
|
+
| GET | `/current-session` | The session of the current token | `{ data: {..., isCurrentSession: true } }`; 404 when none |
|
|
622
|
+
| GET | `/user/:userId/sessions` | Sessions of a user; only your own `userId` | 403 for another user |
|
|
623
|
+
| POST | `/logout` | End the current session (reason `logout`) | `{ message, terminated }` |
|
|
624
|
+
| POST | `/logout-all` | End all own sessions (reason `logout`) | `{ message, terminatedCount }` |
|
|
625
|
+
| POST | `/logout-others` | End all own sessions except the current one | `{ message, terminatedCount, currentSessionPreserved }` |
|
|
626
|
+
| DELETE | `/my-sessions/:sessionId` | End one own session that is not the current one (reason `manual`) | `{ message, success, alreadyTerminated }`; 400 for the current session, 404 for unknown or foreign IDs |
|
|
627
|
+
| GET | `/my-data` | Own sessions and security events as a JSON download (GDPR Art. 15); 3 per hour | `{ exportedAt, user, sessions, securityEvents }` with `Content-Disposition: attachment`; no tokens, hashes or device keys |
|
|
628
|
+
| GET, POST | `/not-me` | **Public** (no JWT): the "This wasn't me" link of the security emails; GET shows a confirmation, POST `{ token, scope: 'session' \| 'all' }` ends sessions | HTML page, or `{ data: { ended, scope } }` with `Accept: application/json`; 410 when the link is invalid, expired or used |
|
|
588
629
|
|
|
589
630
|
`POST /api/auth/logout` also ends the current session; the plugin mounts it when Users & Permissions does not provide it.
|
|
590
631
|
|
|
@@ -713,17 +754,17 @@ Prefix `/magic-sessionmanager` (Strapi admin API). Every route requires an authe
|
|
|
713
754
|
|
|
714
755
|
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):
|
|
715
756
|
|
|
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`)
|
|
757
|
+
| Permission | Name in the role editor | Allows |
|
|
758
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
759
|
+
| `plugin::magic-sessionmanager.admin-sessions.read` | Read admin panel sessions | The Admin panel view and its two GET routes |
|
|
760
|
+
| `plugin::magic-sessionmanager.admin-sessions.revoke` | Sign out admins | **Sign out** and **Sign out everywhere** (also needs read) |
|
|
761
|
+
| `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) |
|
|
762
|
+
| `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 |
|
|
763
|
+
| `plugin::magic-sessionmanager.lockouts.unlock` | Unlock locked sign-ins | **Unlock** in Login protection › Locked now (also needs `access`) |
|
|
723
764
|
|
|
724
765
|
**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
766
|
|
|
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.
|
|
767
|
+
**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`), and the detection and integration keys (`impossibleTravelEnabled`, `impossibleTravelSpeedKmh`, `impossibleTravelMinDistanceKm`, `impossibleTravelAction`, `webhookEvents`, `genericWebhookEnabled`, `genericWebhookUrl`, `genericWebhookSecret`, `sessionIpAnonymize`). The new-device and impossible-travel email switches stay with `access`, like the other alert emails. 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.
|
|
727
768
|
|
|
728
769
|
| Method | Path | Admin UI action |
|
|
729
770
|
| -------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -1045,6 +1086,25 @@ The plugin sits in the request path of every authenticated Content API call, so
|
|
|
1045
1086
|
|
|
1046
1087
|
---
|
|
1047
1088
|
|
|
1089
|
+
## What is recorded (fact sheet for data protection and works councils)
|
|
1090
|
+
|
|
1091
|
+
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.
|
|
1092
|
+
|
|
1093
|
+
| Data | When it is recorded | Where | Kept for | Who can see it | Switch |
|
|
1094
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
1095
|
+
| 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** |
|
|
1096
|
+
| 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 |
|
|
1097
|
+
| 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) |
|
|
1098
|
+
| 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 admin activity** (log), the user (own-data export) | **Record failed and refused sign-ins** (on) for failed/refused/locks; the others only while their feature is on |
|
|
1099
|
+
| Unknown-account sign-ins | Once per anonymised address per 5 minutes | Same log, without account and without the typed name | Same | Same | Same |
|
|
1100
|
+
| 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 |
|
|
1101
|
+
| "Locked now" entries | While a lock lasts | `magic_sm_cache` | Until the lock ends | Admins with plugin access | Follows the log's IP options |
|
|
1102
|
+
| 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) |
|
|
1103
|
+
|
|
1104
|
+
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.
|
|
1105
|
+
|
|
1106
|
+
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.
|
|
1107
|
+
|
|
1048
1108
|
## Troubleshooting
|
|
1049
1109
|
|
|
1050
1110
|
| Problem | Fix |
|
|
@@ -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-Bnt0Jq6O.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 { 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-
|
|
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-BmnC2BPs.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,8 +9,8 @@ const designSystem = require("@strapi/design-system");
|
|
|
9
9
|
const icons = require("@strapi/icons");
|
|
10
10
|
const symbols = require("@strapi/icons/symbols");
|
|
11
11
|
const styled = require("styled-components");
|
|
12
|
-
const index = require("./index-
|
|
13
|
-
const dashboardModel = require("./dashboardModel-
|
|
12
|
+
const index = require("./index-Bnt0Jq6O.js");
|
|
13
|
+
const dashboardModel = require("./dashboardModel-sksvIc1c.js");
|
|
14
14
|
const SectionCard = require("./SectionCard-BlWv8CRt.js");
|
|
15
15
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
16
16
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
@@ -7,8 +7,8 @@ import { Typography, Flex, Loader, Button, Modal, Accordion, Box, IconButton, Li
|
|
|
7
7
|
import { Earth, Duplicate, Cross, Eye, Trash, More, CaretDown, Download, ArrowClockwise, Check, Clock, User, ChartBubble, Cog, SignOut } from "@strapi/icons";
|
|
8
8
|
import { EmptyDocuments } from "@strapi/icons/symbols";
|
|
9
9
|
import styled, { useTheme } from "styled-components";
|
|
10
|
-
import { g as getSessionEndReason, a as getEndReasonPresentation, b as getTranslation, p as presentText, u as useSessionFormatters, c as getSessionStatus, d as getDevicePresentation, i as isNativeOnlySession, e as getSessionEndReasonPresentation, D as DeviceIcon, S as StatusBadge, P as PropertyList, C as ConfirmAction, t as toValidDate, f as pluginId, l as logSafeAdminError, h as PersistentAlert, R as ReadableText, j as pluginPermissions, M as MissingValue, V as ValueOrMissing, k as SESSION_STATES, m as SESSION_STATUS_PRESENTATION, n as isCancelledRequest, o as SESSION_FILTER_OPTIONS, E as END_REASON_FILTER_OPTIONS, q as PageShell, r as StatGrid, s as StatCard, v as restoreDialogFocus, w as requireSessionList, x as getBadgeColors, T as TargetLink$1 } from "./index-
|
|
11
|
-
import { i as isRiskSource, g as getSessionUserLabels, a as getUserEditPath, R as RISK_SETTINGS_PATH, b as RowActions, s as shouldIsolateActionKey, c as shouldRedispatchEscape, D as DASHBOARD_COMPACT_TABLE_COLUMNS, d as DASHBOARD_TABLE_COLUMNS, r as readDisclosureOpen, e as getBrowserStorage, w as writeDisclosureOpen, u as useElementWidth, p as parseDashboardQuery, A as AUTO_REFRESH_INTERVAL_MS, f as pickFocusSessionId, h as encodeSearchQuery, j as shouldUseCompactTable, P as PAGE_SIZE_OPTIONS, k as DEFAULT_PAGE_SIZE, l as getExportDeviceInfo, m as getErrorStatus, n as hasActiveFilters } from "./dashboardModel-
|
|
10
|
+
import { g as getSessionEndReason, a as getEndReasonPresentation, b as getTranslation, p as presentText, u as useSessionFormatters, c as getSessionStatus, d as getDevicePresentation, i as isNativeOnlySession, e as getSessionEndReasonPresentation, D as DeviceIcon, S as StatusBadge, P as PropertyList, C as ConfirmAction, t as toValidDate, f as pluginId, l as logSafeAdminError, h as PersistentAlert, R as ReadableText, j as pluginPermissions, M as MissingValue, V as ValueOrMissing, k as SESSION_STATES, m as SESSION_STATUS_PRESENTATION, n as isCancelledRequest, o as SESSION_FILTER_OPTIONS, E as END_REASON_FILTER_OPTIONS, q as PageShell, r as StatGrid, s as StatCard, v as restoreDialogFocus, w as requireSessionList, x as getBadgeColors, T as TargetLink$1 } from "./index-BmnC2BPs.mjs";
|
|
11
|
+
import { i as isRiskSource, g as getSessionUserLabels, a as getUserEditPath, R as RISK_SETTINGS_PATH, b as RowActions, s as shouldIsolateActionKey, c as shouldRedispatchEscape, D as DASHBOARD_COMPACT_TABLE_COLUMNS, d as DASHBOARD_TABLE_COLUMNS, r as readDisclosureOpen, e as getBrowserStorage, w as writeDisclosureOpen, u as useElementWidth, p as parseDashboardQuery, A as AUTO_REFRESH_INTERVAL_MS, f as pickFocusSessionId, h as encodeSearchQuery, j as shouldUseCompactTable, P as PAGE_SIZE_OPTIONS, k as DEFAULT_PAGE_SIZE, l as getExportDeviceInfo, m as getErrorStatus, n as hasActiveFilters } from "./dashboardModel-BhUonEqc.mjs";
|
|
12
12
|
import { S as SectionCard } from "./SectionCard-D51bv4Hi.mjs";
|
|
13
13
|
const EndReason = ({ session, reason, variant = "omega", textColor = "neutral800" }) => {
|
|
14
14
|
const { formatMessage } = useIntl();
|
|
@@ -7,7 +7,7 @@ const styled = require("styled-components");
|
|
|
7
7
|
const designSystem = require("@strapi/design-system");
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
9
|
const StrapiAdmin = require("@strapi/strapi/admin");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-Bnt0Jq6O.js");
|
|
11
11
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
12
12
|
function _interopNamespace(e) {
|
|
13
13
|
if (e && e.__esModule) return e;
|
|
@@ -6,7 +6,7 @@ import { Flex, Loader, Button, Box, Typography } from "@strapi/design-system";
|
|
|
6
6
|
import { User, Lightning, Clock, Lock, WarningCircle } from "@strapi/icons";
|
|
7
7
|
import * as StrapiAdmin from "@strapi/strapi/admin";
|
|
8
8
|
import { useFetchClient } from "@strapi/strapi/admin";
|
|
9
|
-
import { l as logSafeAdminError, n as isCancelledRequest, b as getTranslation, R as ReadableText, M as MissingValue } from "./index-
|
|
9
|
+
import { l as logSafeAdminError, n as isCancelledRequest, b as getTranslation, R as ReadableText, M as MissingValue } from "./index-BmnC2BPs.mjs";
|
|
10
10
|
function normalizeUserCounts(response) {
|
|
11
11
|
const totalUsers = response?.data?.totalUsers;
|
|
12
12
|
const blockedUsers = response?.data?.blockedUsers;
|