diff --git a/CHANGELOG.md b/CHANGELOG.md index 6024376e2..16c84a186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ This file documents all notable changes made to ITFlow. ### Upgrading -Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files. There are no database changes, and nothing else is required. This release has three security fixes - see Security. +Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's one database change (3.6.6 to 3.6.7) in the same pass. It adds three tables for RMM providers and changes nothing that is there. Nothing else is required. This release has three security fixes - see Security. ### Security @@ -14,8 +14,23 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Invites: with a login key required, the page behind an agent's invite link went on showing the sign-in address with the key in it after the invite had been cancelled or had run out. Someone whose invite was withdrawn could still read the key from their old link. The key signs no one in by itself - it only opens the agents' sign-in page, which still asks for an email and password. A cancelled or run-out link now leads to the plain sign-in page. Releases from 26.11 to 26.11.8 are affected. If you cancelled an invite because the person should never have had it, change the login key in Admin > Settings > Security. - Client access: an agent limited to some clients could read a few names belonging to the others, by putting a record's number in a page's address - a project's name on the tickets list, a site's name, a ticket's subject and an invoice's number on Trips and its export window, a vendor's name in the domains export window, and a client's name on Update Prices and in the message when an AI request was turned away. Nothing else of those records showed, and nothing could be changed. These names now show only for clients the agent can open. Releases from 26.09 to 26.11.8 are affected. +### New Features & Updates + +- RMM Providers: Admin > Integrations > RMM Providers brings in devices from your RMM - Tactical RMM is the first it knows. Add it with its API address and an API key, then on its Clients page link its clients to yours: a client with the same name is suggested, one click links it, and Link the suggested does them all. A linked client's devices come in as its assets straight away, then every 15 minutes or with Sync now. A device is matched to the asset you already have for it - same serial number, or the only asset with its name - and only what that asset is missing is filled in. Otherwise a new asset is made: its name, type (laptop, desktop, server or virtual machine), make and model, serial number, OS, IP, CPU and storage, at the location named like its site in the RMM. +- RMM Providers: more than one can be set up - two Tactical servers, say, each with a name of its own. A device both have is matched to the same asset, which shows what each says. +- RMM Providers: what the RMM says about a device keeps its asset up to date, field by field - until you change that field in ITFlow, which then stays as you set it. A blank from the RMM never clears anything. +- RMM Providers: an asset from an RMM shows whether the device is online, offline or overdue, beside its status. It also gets a card named after its provider: when it was last seen, who is signed in, its public IP and site, and whether it needs a reboot, has patches waiting or has checks failing. For Tactical RMM, Take Control opens its remote session, and its menu has Open in Tactical RMM and Remote Background. The quick look has the state and Take Control too. +- RMM Providers: on the assets list, a dot after a device's name says how it is, and the RMM filter - named after your provider when you have one - shows the online, offline or overdue ones, every device in it, or the assets that aren't in it. +- RMM Providers: a device the RMM no longer has keeps its asset, marked as no longer in it. If you delete an asset in ITFlow, the next sync doesn't make it again - Bring back on the client's row does. A client linked to another of your clients brings its devices in there. The assets already made for the first client stay, no longer kept up. Each change is in the asset's history. +- RMM Providers: the RMM Sync job is on Maintenance > Cron. Turning a provider off stops its syncs, and Delete forgets its links - the assets stay as they are either way. API keys are kept like other providers' keys and never shown again. A Tactical RMM key can do whatever its Tactical user can, so make it for a user whose role can see clients and agents and no more. + ### Developer Updates +- Database 3.6.7: `rmm_providers` (`rmm_provider_kind` - `tactical` for now - the name it goes by, `api_url`, `web_url`, `api_key`, `api_secret` for an RMM that signs in with an id and a secret, and how the last sync went), `rmm_clients` (each provider's clients, `rmm_client_client_id` 0 until linked, `rmm_client_removed_at` once the RMM stops listing one) and `rmm_devices` (one a device: its asset, what the RMM last said - status, last seen, signed-in user, reboot, patches, checks - and `rmm_device_synced`, JSON of what the sync last wrote to the asset). Re-runnable, like 3.6.0. +- `functions/rmm.php` is what every RMM shares. A kind is an entry in `rmmProviderKinds()` and a file of its own - `functions/rmm_tactical.php` for Tactical. It names the connection fields it uses, with their labels and help (the window and its checks are built from them), hints added to errors, the device links it offers, and four functions: `clients`, `devices` (each device in the shape described above `rmmDeviceFacts()`), `dashboard` and `device_urls`. `rmmHttp()` makes the request and turns a refused key, a redirect, a 404 or an answer that isn't JSON into a sentence for the person; `rmmTacticalRequest()` adds Tactical's `X-API-KEY`. Another RMM is a file like `rmm_tactical.php`, a line in `rmmProviderKinds()` and a `require_once` in `functions.php`. +- `rmmSync($provider, $only = 0, $max_seconds = 120)` asks the kind for its clients, then for each linked client's devices, longest since brought in first, and stops on time to pick up next run. `GET_LOCK('itflow_rmm_sync_')` keeps each provider to one sync at a time. Devices and clients are marked removed by what the RMM listed, never by time, and only for a client whose list came back whole. One client failing doesn't hold up the rest or mark its devices removed. `rmmDeviceSave()` matches (`rmmAssetMatch()` - serial, then a name only one asset has, among this client's unarchived assets no other device of the provider has), makes (`rmmAssetCreate()`) and follows (`rmmAssetFollow()`). The follow rule: a field is written when it is empty or still holds what `rmm_device_synced` says was last written, and a blank never writes. Values go through `rmmText()` first - what `escapeSql()` would store - so a value compares the same on both sides and isn't written again every run. CPU and storage are asset details (`asset_specs`) and are only written for a type that has them. A device two providers have is one asset with a row from each, and each follows only what it wrote. +- `cron/rmm_sync.php` is the `rmm_sync` job in `includes/cron_jobs.php`, every 15 minutes: `rmmSyncAll()` syncs each provider that is on, sharing two minutes between them. It stops with the failing providers' notes, or when cron is off. Admin handlers are in `admin/post/rmm.php`; their request keys are in `DEMO_MODE_LOCKS`, and `admin/rmm_providers.php` and `admin/rmm_clients.php` are locked pages in the demo. +- `agent/assets.php` takes `rmm` (`any`, `online`, `offline`, `overdue`, `none`) as a subquery on `rmm_devices`, in the list and the tab counts alike. The RMM select only shows once a provider is set up. - `agent/ajax.php`: the seventeen GET answers that printed JSON under PHP's default `text/html` now send `Content-Type: application/json` first - `get_credential_via_id`, `get_totp_token_via_id`, `get_readable_pass`, `get_active_clients`, `get_client_contacts`, `get_client_assets`, `get_client_locations`, `get_client_vendors`, `get_client_projects`, `get_internal_users`, `get_document_content`, `get_canned_response`, `ticket_query_views`, `client_duplicate_check`, `contact_email_check`, `network_ip_check` and `domain_check`. Their callers read the body as text (`itflowGet()`) or with `res.json()`, so nothing changes for them. A new JSON answer sets the header the same way: a value that is not escaped for HTML, as a login's username and password are not, must never go out as `text/html`. - `getFieldByIdInScope($table, $id, $field, $client_field)` (`functions/app.php`) is `getFieldById()` for a record that belongs to a client. It gives null unless `hasClientAccess()` passes for the record's client, as it does for a record that isn't there; a record with no client (0) is anyone's. Use it wherever a label is made from an id in the query string. The two labels read with their own query, on `agent/trips.php` and `agent/modals/trip/trip_export.php`, take `clientScopeSql()` instead. - `join.php` puts the login key in its sign-in link only while the invite is `pending` or `accepted` (`userInviteState()`). diff --git a/admin/database_updates/3.6.7.php b/admin/database_updates/3.6.7.php new file mode 100644 index 000000000..660484ee1 --- /dev/null +++ b/admin/database_updates/3.6.7.php @@ -0,0 +1,90 @@ +Text Messaging

+