netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.35k stars 2.6k forks source link

Allow to store an "audit user" for changes via restAPI #18055

Open JohannesKreuzer opened 4 days ago

JohannesKreuzer commented 4 days ago

NetBox version

v4.1.6

Feature type

Data model extension

Triage priority

N/A

Proposed functionality

allow to pass an username (actually an arbitrary string) via restAPI to store the user of the upstream application which triggered the rest api request for auditing purposes, it should default to the username of the netbox user triggering the request, if it is not passed in the request. Might be done via an additional HTTP-Header to be sent from restAPI client to netbox server.

Use case

Netbox is used as a Datasource for an upstream application. To be able to see who really triggered the changes in netbox, it is needed to be able to pass the username from the upstream application to netbox.

Database changes

add an additonal audit_username field of type string to ChangeLog model.

External dependencies

support in the netbox restAPI client libraries