Skip to content

Allow nova_api_audit_map.conf in DefaultConfigOverride#1104

Open
vyzigold wants to merge 1 commit into
openstack-k8s-operators:mainfrom
vyzigold:allow_nova_api_audit_map_conf
Open

Allow nova_api_audit_map.conf in DefaultConfigOverride#1104
vyzigold wants to merge 1 commit into
openstack-k8s-operators:mainfrom
vyzigold:allow_nova_api_audit_map_conf

Conversation

@vyzigold
Copy link
Copy Markdown

@vyzigold vyzigold commented Apr 22, 2026

Allow providing a nova_api_audit_map.conf file through the
DefaultConfigOverride to NovaAPI.

Conditionally configure the
audit_middleware_notifications.use_oslo_messaging
based on if notification_transport_url is defined or not.

This is being tested in functional tests, kuttl tests and the
nova-operator-tempest-multinode test job.

Jira: OSPRH-29257

@openshift-ci openshift-ci Bot requested review from abays and mrkisaolamb April 22, 2026 13:25
Copy link
Copy Markdown
Contributor

@gibizer gibizer left a comment

Choose a reason for hiding this comment

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

Could you please providing reasoning why this changes is needed?

@SeanMooney
Copy link
Copy Markdown
Contributor

this might be requried for non default middelware? but we do not support modifying the mideddlware without a supprort exectpion so this probaly needs deicssion about how this will be tested and if it will be supproted in the product at all unless that has alreayd happend

in either case any feature work shoudl be assocated with a jira issue in osprh so at a minimum that context need to be capture before this proceeds.

@SeanMooney
Copy link
Copy Markdown
Contributor

this appares to be realted to https://opendev.org/openstack/pycadf/src/branch/master/doc/source/audit_maps.rst#L43
but https://opendev.org/openstack/keystonemiddleware/src/branch/master/keystonemiddleware/audit/_api.py

has never been suprpoted in optream nova with any testing and is not supproted in our downstream today.

it might work but there is 0 testing or supprot for that form the nova maintaienr today
which is shy that woudl requrie a supprot expction to enable.

i dont nessiarlly object to supprotign the config file but customer woudl not be able to use this without violdating the supprot for the nova api.

if they have any api perfonce issue or geniss issue we woudl require them to repoduce with the default middelware set before there requrest would be supproted and all issue related to this woudl have to be feilded by the Secrity team or how eve fis the formal maintaienr of that in our downstrema

so can you please provide the jira planing docs and work wirht teh relevent product owners to ensure this is planned properly before we proceed.

@vyzigold
Copy link
Copy Markdown
Author

We have a feature for providing documentation on how to enable and forward audit logs. I added the task to enable the nova_api_audit_map.conf customization in nova-operator in the PR description following an example I saw in some other PR here.

@SeanMooney we have a whole feature based around audit logs https://redhat.atlassian.net/browse/RHOSSTRAT-1255 . Plan is to provide documentation on how to enable audit logs and how to configure openshift-logging to distinguish them and to forward them into a separate log storage. As part of the feature we'll also work on providing test coverage. Feel free to leave feedback if you want.

Copy link
Copy Markdown
Contributor

@SeanMooney SeanMooney left a comment

Choose a reason for hiding this comment

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

I have commented on the Jira, but this is not sufficient to enable this feature.

The CADF middleware that this is for uses RabbitMQ by default and falls back to the notification message bus if its own config options are not set:
https://opendev.org/openstack/keystonemiddleware/src/branch/master/keystonemiddleware/audit/__init__.py#L44-L66

It is not correct to set the transport_url via the CustomServiceConfig or the nova-api-audit-map.conf, as that would be in plain text. This means that today there is no protection from enabling the middleware via api-paste.ini when
you have not passed a notification bus.

This patch is also missing Kuttl tests to show that the feature works end-to-end in that environment. Ideally, this would be enabled in one of the EDPM jobs—either the Ceph job or the local storage job, whichever has notifications enabled.

The fact that middleware can use a RabbitMQ connection running in the Nova API process without our knowledge is also concerning from a performance and concurrency point of view, especially given the Eventlet removal efforts and the change to how that works now.

We do not allow long-running connections in the API process, and if it is killed and recreated on every request, that will also slow down every request by at least the TCP handshake time for every notification it sends.

@vyzigold
Copy link
Copy Markdown
Author

We don't plan to use RabbitMQ or a notification bus, since we don't have anything, that'd listen there for these logs. The documentation will have users set the log driver for the audit middleware like this:

          [audit_middleware_notifications]
          driver = log

Logs will then get collected by the openshift-logging and stored.

I'll add kuttl-test coverage 👍

@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch 2 times, most recently from ed882bf to b87609b Compare April 24, 2026 09:21
@SeanMooney
Copy link
Copy Markdown
Contributor

We don't plan to use RabbitMQ or a notification bus, since we don't have anything, that'd listen there for these logs. The documentation will have users set the log driver for the audit middleware like this:

          [audit_middleware_notifications]
          driver = log

Logs will then get collected by the openshift-logging and stored.

I'll add kuttl-test coverage 👍

or we could default the value of use_oslo_messaging

[audit_middleware_notifications]
use_oslo_messaging = < true if notification bus is passed else false>

whey woudl still have to opt into the middlware by modifying the pipeline
but then it would route to the logs if notification were disabled
and send the notification to the notifcation buss
if they want to overreid that they can then also add driver = log
to alwasy send it to the logs.

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/5fdad4322b6d4f1582634d34e221b439

✔️ openstack-meta-content-provider SUCCESS in 2h 31m 55s
nova-operator-kuttl FAILURE in 55m 29s
✔️ nova-operator-tempest-multinode SUCCESS in 2h 15m 25s
nova-operator-tempest-multinode-ceph FAILURE in 39m 22s

@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch from b87609b to 652bfcd Compare April 27, 2026 09:02
@SeanMooney SeanMooney dismissed their stale review April 27, 2026 10:07

ill see if i can find time to re reivew but i think most of my feedback has been adressed
but i still want the compute folks to way in on if they are ok wiht this in general

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/202ae4c0635347cea19e10a20918927f

✔️ openstack-meta-content-provider SUCCESS in 3h 55m 35s
nova-operator-kuttl FAILURE in 51m 03s
nova-operator-tempest-multinode FAILURE in 2h 13m 07s
✔️ nova-operator-tempest-multinode-ceph SUCCESS in 2h 58m 31s

@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch from 652bfcd to 0545a2d Compare April 29, 2026 09:10
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/d2b200289b52491283b1b69f94c8ab0c

openstack-meta-content-provider FAILURE in 5m 23s
⚠️ nova-operator-kuttl SKIPPED Skipped due to failed job openstack-meta-content-provider
⚠️ nova-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-meta-content-provider
⚠️ nova-operator-tempest-multinode-ceph SKIPPED Skipped due to failed job openstack-meta-content-provider

@vyzigold
Copy link
Copy Markdown
Author

recheck download tools issue

@TristanCacqueray
Copy link
Copy Markdown

recheck

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdo/buildset/bb24970215534cecb26784e4431fdf55

openstack-meta-content-provider NODE_FAILURE Node(set) request 100-0000082651 failed in 0s
⚠️ nova-operator-kuttl SKIPPED Skipped due to failed job openstack-meta-content-provider
⚠️ nova-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-meta-content-provider
⚠️ nova-operator-tempest-multinode-ceph SKIPPED Skipped due to failed job openstack-meta-content-provider

@TristanCacqueray
Copy link
Copy Markdown

recheck

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdo/buildset/107c3c8012ac4f15807b47f493ec8188

✔️ openstack-meta-content-provider SUCCESS in 3h 23m 13s
nova-operator-kuttl RETRY_LIMIT in 1m 02s
nova-operator-tempest-multinode RETRY_LIMIT in 33s
nova-operator-tempest-multinode-ceph RETRY_LIMIT in 33s

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdo/buildset/776b5003add34f8bacfea51788fd8f55

✔️ openstack-meta-content-provider SUCCESS in 2h 55m 44s
nova-operator-kuttl FAILURE in 54m 10s
nova-operator-tempest-multinode FAILURE in 35m 09s
✔️ nova-operator-tempest-multinode-ceph SUCCESS in 2h 39m 31s

@vyzigold
Copy link
Copy Markdown
Author

vyzigold commented May 6, 2026

recheck no logs

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/66c8395b73754415afb2ce6dee2a85e2

✔️ openstack-meta-content-provider SUCCESS in 3h 16m 24s
nova-operator-kuttl FAILURE in 54m 56s
✔️ nova-operator-tempest-multinode SUCCESS in 2h 30m 24s
✔️ nova-operator-tempest-multinode-ceph SUCCESS in 2h 34m 44s

@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch from f25b7cf to 197975a Compare May 6, 2026 12:41
@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/5b5c0596c71241dc97ebcade650bf4be

✔️ openstack-meta-content-provider SUCCESS in 2h 57m 21s
✔️ nova-operator-kuttl SUCCESS in 56m 49s
✔️ nova-operator-tempest-multinode SUCCESS in 2h 40m 08s
nova-operator-tempest-multinode-ceph FAILURE in 47m 33s

@vyzigold
Copy link
Copy Markdown
Author

vyzigold commented May 6, 2026

recheck ceph job failed during make openstack while waiting for metallb operator to start

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/ad2e73e41d1b43b6ab72d0db4a4d3b18

✔️ openstack-meta-content-provider SUCCESS in 2h 52m 59s
nova-operator-kuttl POST_FAILURE in 57m 20s
✔️ nova-operator-tempest-multinode SUCCESS in 2h 24m 43s
nova-operator-tempest-multinode-ceph FAILURE in 2h 37m 28s

@vyzigold
Copy link
Copy Markdown
Author

vyzigold commented May 7, 2026

recheck timeout in tempest.scenario.test_network_basic_ops.TestNetworkBasicOps test in ceph job and POST_FAILURE without accessible logs in kuttl.

@vyzigold
Copy link
Copy Markdown
Author

@gibizer I'd say this is ready for reviews now. I think I addressed all of Sean's comments.

To sum up why it's needed. We need to have audit logs from some chosen services (nova is among them). For that we need to be able to modify the api-paste.ini and add a nova_api_audit_map.conf file from https://github.com/openstack/pycadf/blob/master/etc/pycadf/nova_api_audit_map.conf . BTW, this isn't a completely new thing in RHOSO, we already have this doc https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/hardening_a_red_hat_openstack_services_on_openshift_deployment/audit-system-events_hardening , which IMO really needs improvements ASAP.

@vyzigold vyzigold requested a review from gibizer May 18, 2026 20:49
Copy link
Copy Markdown
Contributor

@mrkisaolamb mrkisaolamb 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 simple functional test to check the newly generated config section?

Comment thread templates/nova/nova.conf
Comment thread ci/nova-operator-tempest-multinode/control_plane_hook.yaml Outdated
@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch from 197975a to 617bd3d Compare May 26, 2026 13:12
@vyzigold
Copy link
Copy Markdown
Author

Rebased on top of current main and implemented mrkisaolamb's suggestions (see the 3rd commit).

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/16aad2d9e1db4385b7fda0cc581e827a

✔️ openstack-meta-content-provider SUCCESS in 2h 55m 26s
nova-operator-kuttl FAILURE in 1h 00m 50s
✔️ nova-operator-tempest-multinode SUCCESS in 2h 24m 39s
nova-operator-tempest-multinode-ceph FAILURE in 30m 06s

@vyzigold
Copy link
Copy Markdown
Author

I believe kuttl-tests are just blocked on #1108 . And ceph job failed early on deploying nncp it seems. I'll wait until 1108 merges before trying again.

@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch from 617bd3d to 832887d Compare May 28, 2026 15:02
@vyzigold
Copy link
Copy Markdown
Author

just a rebase on top of current main.

Comment thread test/functional/nova/novaapi_controller_test.go Outdated
Comment thread ci/nova-operator-tempest-multinode/control_plane_hook.yaml Outdated
Allow providing a nova_api_audit_map.conf file through the
DefaultConfigOverride to NovaAPI.

Conditionally configure the
audit_middleware_notifications.use_oslo_messaging
based on if notification_transport_url is defined or not.

This is being tested in functional tests, kuttl tests and the
nova-operator-tempest-multinode test job.

Closes: https://redhat.atlassian.net/browse/OSPRH-29237
@vyzigold vyzigold force-pushed the allow_nova_api_audit_map_conf branch from bd26bac to 5bc3d42 Compare May 29, 2026 09:33
@vyzigold
Copy link
Copy Markdown
Author

Resolved mrkisaolamb's comments and squashed the commits. PR description was updated to reflect the added testing and conditional nova.conf config added later.

@openshift-ci openshift-ci Bot added the lgtm label May 29, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrkisaolamb, vyzigold

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mrkisaolamb mrkisaolamb removed the lgtm label May 29, 2026
@mrkisaolamb mrkisaolamb requested a review from SeanMooney May 29, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants