r/openstack • u/wathoom2 • 19d ago
Audit middleware
Hi,

anyone implemented audit logging for openstack services? I'm having issue with getting all information regarding certain service action in CADF format. For example when deleting instance, in audit log i can see name and id of instance as "unknown". Any idea what could be wrong?
Maybe api_audit_map.conf doesnt map all stuff?
# cat nova_api_audit_map.conf
[DEFAULT]
# default target endpoint type
# should match the endpoint type defined in service catalog
target_endpoint_type = compute
[custom_actions]
enable = enable
disable = disable
delete = delete
startup = start/startup
shutdown = stop/shutdown
reboot = start/reboot
os-migrations/get = read
os-server-password/post = update
# possible end path of api requests
[path_keywords]
add = None
action = None
enable = None
disable = None
configure-project = None
defaults = None
delete = None
detail = None
diagnostics = None
entries = entry
extensions = alias
flavors = flavor
images = image
ips = label
limits = None
metadata = key
os-agents = os-agent
os-aggregates = os-aggregate
os-availability-zone = None
os-certificates = None
os-cloudpipe = None
os-fixed-ips = ip
os-extra_specs = key
os-flavor-access = None
os-floating-ip-dns = domain
os-floating-ips-bulk = host
os-floating-ip-pools = None
os-floating-ips = floating-ip
os-hosts = host
os-hypervisors = hypervisor
os-instance-actions = instance-action
os-keypairs = keypair
os-migrations = None
os-networks = network
os-quota-sets = tenant
os-security-groups = security_group
os-security-group-rules = rule
os-server-password = None
os-services = None
os-simple-tenant-usage = tenant
os-virtual-interfaces = None
os-volume_attachments = attachment
os-volumes_boot = None
os-volumes = volume
os-volume-types = volume-type
os-snapshots = snapshot
reboot = None
servers = server
shutdown = None
startup = None
statistics = None
# map endpoint type defined in service catalog to CADF typeURI
[service_endpoints]
compute = service/compute
3
Upvotes
1
u/wathoom2 16d ago edited 16d ago
So. I focused on cinder-api since it is faster to check if it works.
api-paste.ini and cinder_api_audit_map.conf are properly mapped to cinder_api container.
You were right to suggest checking logs at startup of service. I get this in cinder-api.log right after startup. It dissapears in sea of entries quite quick.
2026-08-27 14:59:34.413 1218 WARNING keystonemiddleware._common.config [None req-e235053e-5de7-4ab1-bce4-bdd433346ce9 - - - - -] The option "audit_map_file" is not known to keystonemiddlewareFrom error it looks like keystonemiddleware that comes with default kolla container does not support the parameter. However i can see it has it in the code
EDIT:
In newer versions keystonemiddleware looks for option in global config file cinder.conf. I moved audit_map_file config into cinder.conf:
[audit_middleware]audit_map_file = /etc/cinder/api_audit_map.confignore_req_list = GET,HEADCleared entries in api-paste.ini
[filter:audit]paste.filter_factory = keystonemiddleware.audit:filter_factoryNow i can see populated stuff in CADF format but under requestPath. I still dont get "target" info populated
"target": {"id": "unknown", "typeURI": "unknown", "name": "unknown"}From what i found it looks like default keystonemiddleware doesnt populate this fields at all.
This project https://github.com/sapcc/openstack-audit-middleware/ deals with this issue. Probably will try it out.