Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REST API events to Audit Log #37734

Merged
merged 14 commits into from Mar 7, 2024
Merged

Conversation

bbovenzi
Copy link
Contributor

Closes #22352

Add logging to all CRUD REST API endpoints. In the action_logging decorator, include checks for the url and origin to also distinguish between API endpoints from the Airflow UI vs externally. api.{name_of_function} or ui.{name_of_function}


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@bbovenzi bbovenzi changed the title Add rest api crud events to audit log Add REST API events to Audit Log Feb 27, 2024
@Lee-W Lee-W force-pushed the audit-rest-api-crud branch 2 times, most recently from 07e54dc to 68a655a Compare March 1, 2024 09:05
@Lee-W
Copy link
Member

Lee-W commented Mar 1, 2024

@bbovenzi package.json looks like accidentally added to me. Could you please confirm whether I misunderstood or not? Thanks!

@Lee-W Lee-W force-pushed the audit-rest-api-crud branch 2 times, most recently from 96419d8 to 77249b2 Compare March 1, 2024 11:28
Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a newfragment that documents the event changes that happen as a result of this?

newsfragments/37734.significant.rst Outdated Show resolved Hide resolved
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
@bbovenzi bbovenzi merged commit 31f5900 into apache:main Mar 7, 2024
56 checks passed
@bbovenzi bbovenzi deleted the audit-rest-api-crud branch March 7, 2024 22:47
@ephraimbuddy ephraimbuddy added the type:improvement Changelog: Improvements label Mar 14, 2024
howardyoo pushed a commit to howardyoo/airflow that referenced this pull request Mar 18, 2024
* Fix rest API logging

* Interpret ui/api & func name, format extra as json

* Fix secret check

* Add action logging and tests for crud endpoints

* Check correct task instance in setNote test

* Update airflow/migrations/versions/0134_2_9_0_increase_log_event_string_size.py

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>

* fix mypy

* fix: remove package.json and package-lock.json which seems to be accidentally added

* fix mypy

* Merge Log migration files

* rename migration

* try fix mypy?

* Add news fragment

* Update newsfragments/37734.significant.rst

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>

---------

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Co-authored-by: Daniel Standish <15932138+dstandish@users.noreply.github.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
howardyoo pushed a commit to howardyoo/airflow that referenced this pull request Mar 31, 2024
* Fix rest API logging

* Interpret ui/api & func name, format extra as json

* Fix secret check

* Add action logging and tests for crud endpoints

* Check correct task instance in setNote test

* Update airflow/migrations/versions/0134_2_9_0_increase_log_event_string_size.py

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>

* fix mypy

* fix: remove package.json and package-lock.json which seems to be accidentally added

* fix mypy

* Merge Log migration files

* rename migration

* try fix mypy?

* Add news fragment

* Update newsfragments/37734.significant.rst

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>

---------

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Co-authored-by: Daniel Standish <15932138+dstandish@users.noreply.github.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Apr 22, 2024
* Fix rest API logging

* Interpret ui/api & func name, format extra as json

* Fix secret check

* Add action logging and tests for crud endpoints

* Check correct task instance in setNote test

* Update airflow/migrations/versions/0134_2_9_0_increase_log_event_string_size.py

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>

* fix mypy

* fix: remove package.json and package-lock.json which seems to be accidentally added

* fix mypy

* Merge Log migration files

* rename migration

* try fix mypy?

* Add news fragment

* Update newsfragments/37734.significant.rst

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>

---------

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Co-authored-by: Daniel Standish <15932138+dstandish@users.noreply.github.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:webserver Webserver related Issues kind:documentation type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit rest api update requests
6 participants