forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Adds ML tasks to the kibana audit log (elastic#195120)
Adds a new `MlAuditLogger` service for logging calls to elasticsearch in kibana's audit log. Not all calls are logged, only ones which make changes to ML jobs or trained models, e.g. creating, deleting, starting, stopping etc. Calls to the es client are wrapped in a logging function so successes and failures can be caught and logged. the audit log can be enabed by adding this to the kibana yml or dev.yml file `xpack.security.audit.enabled: true` An example log entry (NDJSON formatted to make it readable): ``` { "event": { "action": "ml_start_ad_datafeed", "type": [ "change" ], "category": [ "database" ], "outcome": "success" }, "labels": { "application": "elastic/ml" }, "user": { "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0", "name": "elastic", "roles": [ "superuser" ] }, "kibana": { "space_id": "default", "session_id": "U6HQCDkk+fAEUCXs7i4qM2/MZITPxE02pp8o7h09P68=" }, "trace": { "id": "4f1b616b-8535-43e1-8516-32ea9fe76d19" }, "client": { "ip": "127.0.0.1" }, "http": { "request": { "headers": { "x-forwarded-for": "127.0.0.1" } } }, "service": { "node": { "roles": [ "background_tasks", "ui" ] } }, "ecs": { "version": "8.11.0" }, "@timestamp": "2024-10-11T09:07:47.933+01:00", "message": "Starting anomaly detection datafeed datafeed-11aaaa", "log": { "level": "INFO", "logger": "plugins.security.audit.ecs" }, "process": { "pid": 58305, "uptime": 100.982390291 }, "transaction": { "id": "77c14aadc6901324" } } ``` --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 923c450)
- Loading branch information
1 parent
df228d4
commit 5ec58aa
Showing
8 changed files
with
743 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.