From 1b14ed6e2ad46d0b89bbc05051fd367ecf236379 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 23 Nov 2021 12:35:13 -0500 Subject: [PATCH] Docs: update auditing documentation with new logs (#41722) (#42158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add detailed info on audit log contents * Apply suggestions from code review Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Docs: update auditing documentation with new logs * add back remove datasource permission * improve formatting * fix incorrect action * clean formatting * formatting Co-authored-by: Jesse Weaver Co-authored-by: Jesse Weaver (cherry picked from commit 934e4ad3afdf8348f673a7eeb8571c93b92b6453) Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> --- docs/sources/enterprise/auditing.md | 48 ++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/docs/sources/enterprise/auditing.md b/docs/sources/enterprise/auditing.md index 1bb76e03748..01982586f82 100644 --- a/docs/sources/enterprise/auditing.md +++ b/docs/sources/enterprise/auditing.md @@ -181,6 +181,14 @@ external group. | Restore old dashboard version | `{"action": "restore", "resources": [{"type": "dashboard"}]}` | | Delete dashboard | `{"action": "delete", "resources": [{"type": "dashboard"}]}` | +#### Library elements management + +| Action | Distinguishing fields | +| ---------------------- | ------------------------------------------------------------------ | +| Create library element | `{"action": "create", "resources": [{"type": "library-element"}]}` | +| Update library element | `{"action": "update", "resources": [{"type": "library-element"}]}` | +| Delete library element | `{"action": "delete", "resources": [{"type": "library-element"}]}` | + #### Data sources management | Action | Distinguishing fields | @@ -192,11 +200,37 @@ external group. | Disable permissions for datasource | `{"action": "disable-permissions", "resources": [{"type": "datasource"}]}` | | Grant datasource permission to role, team, or user | `{"action": "create", "resources": [{"type": "datasource"}, {"type": "dspermission"}]}`\* | | Remove datasource permission | `{"action": "delete", "resources": [{"type": "datasource"}, {"type": "dspermission"}]}` | +| Enable caching for datasource | `{"action": "enable-cache", "resources": [{"type": "datasource"}]}` | +| Disable caching for datasource | `{"action": "disable-cache", "resources": [{"type": "datasource"}]}` | +| Update datasource caching configuration | `{"action": "update", "resources": [{"type": "datasource"}]}` | \* `resources` may also contain a third item with `"type":` set to `"user"` or `"team"`. #### Alerts and notification channels management +| Action | Distinguishing fields | +| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| Save alert manager configuration | `{"action": "update", "requestUri": "/api/alertmanager/RECIPIENT/config/api/v1/alerts"}` | +| Reset alert manager configuration | `{"action": "delete", "requestUri": "/api/alertmanager/RECIPIENT/config/api/v1/alerts"}` | +| Create silence | `{"action": "create", "requestUri": "/api/alertmanager/RECIPIENT/api/v2/silences"}` | +| Delete silence | `{"action": "delete", "requestUri": "/api/alertmanager/RECIPIENT/api/v2/silences/SILENCE-ID"}` | +| Create alert | `{"action": "create", "requestUri": "/api/ruler/RECIPIENT/api/v2/alerts"}` | +| Create or update rule group | `{"action": "create-update", "requestUri": "/api/ruler/RECIPIENT/api/v1/rules/NAMESPACE"}` | +| Delete rule group | `{"action": "delete", "requestUri": "/api/ruler/RECIPIENT/api/v1/rules/NAMESPACE/GROUP-NAME"}` | +| Delete namespace | `{"action": "delete", "requestUri": "/api/ruler/RECIPIENT/api/v1/rules/NAMESPACE"}` | +| Test Grafana managed receivers | `{"action": "test", "requestUri": "/api/alertmanager/RECIPIENT/config/api/v1/receivers/test"}` | +| Create or update the NGalert configuration of the user's organization | `{"action": "create-update", "requestUri": "/api/v1/ngalert/admin_config"}` | +| Delete the NGalert configuration of the user's organization | `{"action": "delete", "requestUri": "/api/v1/ngalert/admin_config"}` | + +Where the following: + +- `RECIPIENT` is `grafana` for requests handled by Grafana or the numeric data source ID for requests forwarded to a data source. +- `NAMESPACE` is the string identifier for the rules namespace. +- `GROUP-NAME` is the string identifier for the rules group. +- `SILENCE-ID` is the ID of the affected silence. + +The following legacy alerting actions are still supported: + | Action | Distinguishing fields | | --------------------------------- | --------------------------------------------------------------------- | | Test alert rule | `{"action": "test", "resources": [{"type": "panel"}]}` | @@ -235,13 +269,6 @@ external group. #### Provisioning -"resources": [ -{ -"id": 1, -"type": "api-key" -} -], - | Action | Distinguishing fields | | -------------------------------- | ------------------------------------------ | | Reload provisioned dashboards | `{"action": "provisioning-dashboards"}` | @@ -249,6 +276,13 @@ external group. | Reload provisioned plugins | `{"action": "provisioning-plugins"}` | | Reload provisioned notifications | `{"action": "provisioning-notifications"}` | +#### Plugins management + +| Action | Distinguishing fields | +| ---------------- | ------------------------- | +| Install plugin | `{"action": "install"}` | +| Uninstall plugin | `{"action": "uninstall"}` | + #### Miscellaneous | Action | Distinguishing fields |