Audit middleware does not work with APIs which does not require a Keystone token

Bug #1583699 reported by Guang Yee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystonemiddleware
Fix Released
Medium
Guang Yee

Bug Description

Audit middleware assumes the existence of Keystone token and therefore the existence of the identity headers (i.e. HTTP_X_USER_ID, HTTP_X_USER_NAME) in the headers.

https://github.com/openstack/keystonemiddleware/blob/master/keystonemiddleware/audit.py#L400

Some Swift APIs (i.e. list publically available containers) does not required a Keystone token, and therefore the identity headers will not be populated.

Audit middleware should consider the following:

1. do not emit an audit event if Keystone token is not present in the request, or
2. come up with a generic/common way to audit these types of requests

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystonemiddleware (master)

Fix proposed to branch: master
Review: https://review.openstack.org/320725

Changed in keystonemiddleware:
assignee: nobody → Guang Yee (guang-yee)
status: New → In Progress
Changed in keystonemiddleware:
importance: Undecided → Medium
Changed in keystonemiddleware:
assignee: Guang Yee (guang-yee) → Samuel de Medeiros Queiroz (samueldmq)
Changed in keystonemiddleware:
assignee: Samuel de Medeiros Queiroz (samueldmq) → Guang Yee (guang-yee)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystonemiddleware (master)

Reviewed: https://review.openstack.org/320725
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=d8cb5a3e9339a67aab13c2af31bfbff39b14fbc6
Submitter: Jenkins
Branch: master

commit d8cb5a3e9339a67aab13c2af31bfbff39b14fbc6
Author: Guang Yee <email address hidden>
Date: Tue May 24 17:24:47 2016 -0700

    Make sure audit can handle API requests which does not require a token

    Some service APIs such as Swift list public containers does not require
    a token. Therefore, there will be no identity or service catalog information
    available. In these cases, audit should fill in the default
    (i.e. taxonomy.UNKNOWN) for both initiator and target instead of raising an
    exception.

    Change-Id: I3f3c12d5e8c0fa176fb7f0218c368971e0a9d0b5
    Closes-Bug: 1583699

Changed in keystonemiddleware:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/keystonemiddleware 4.6.0

This issue was fixed in the openstack/keystonemiddleware 4.6.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.