airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Audit rest api update requests

Open gmcatsf opened this issue 3 years ago • 2 comments

Description

Need a way to monitor updates from rest api, like persisting requests into existing log table.

Use case/motivation

Airflow UI audit user actions by logging into log table, but this feature is missing in the rest api endpoints. For production this feature is needed to track mis usages or bugs.

Related issues

No response

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

gmcatsf avatar Mar 17 '22 21:03 gmcatsf

Discussion on the devlist here: https://lists.apache.org/thread/4n5on5srh0lnlwjy92p3m00dch52o35h I think it's a nice idea and hope someone will pick it up.

potiuk avatar Mar 21 '22 14:03 potiuk

airflow.www.decorators has action_logging method used in different parts of the views for logging. An example of using the decorator in the patch_connection endpoint where I modified the description of the connection using rest api.

Id Dttm Dag Id Task Id Event Logical Date Owner Extra
2581 2022-04-23, 11:56:53 None   patch_connection   test [('connection_id', 'aws_default')]

tirkarthi avatar Apr 23 '22 06:04 tirkarthi