Commit Graph

20 Commits

Author SHA1 Message Date
Stephen Finucane 22408f8da0 Remove six
Change-Id: Ib3edfdd087ed1d954f1ecf72a191138f8f1c46a1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-06-27 18:03:31 +01:00
Stephen Finucane 0f48ff3e8d Bump hacking to 6.0.x
A note about dependency ordering is removed from the requirements file:
this is no longer true with the dependency resolver introduced with pip
20.3.

Change-Id: I615be3453db37588edf98a46ce484efc5e051f11
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-06-27 18:03:30 +01:00
Takashi Kajinami 7b8a72d2c5 Add oslo.config.opts entrypoint for audit middleware options
... so that each service using the audit middleware can include these
parameters in .conf file generated by oslo-config-generator by adding
that entrypoint to the command.

Closes-Bug: #1939632
Change-Id: Ied954c633570c51af9504514ffed18e12de8caac
2021-08-12 11:17:13 +09:00
Leehom Li (feli5) 82707e15a5 Make sure audit middleware use own context
Keystone audit middleware requires to iterate req.context as dict,
but Glance requires to access req.context.read_only.
When glance enabled audit, they are conflict with each other.
This patch fix this issue by store audit context in
req.environ['audit.context']

Change-Id: Ib9a62a4cd0b7b9ffb9fa2d6440e8072d45ee0fee
Closes-Bug: #1809101
Signed-off-by: Leehom Li <feli5@cisco.com>
2018-12-24 02:02:17 +00:00
Artem Vasilyev f2f5820c5f Added request_id and global_request_id to CADF notifications
Change-Id: I8d571d3414071c68b4fa565dec46cc2d2941331c
Closes-Bug: #1803940
2018-11-19 11:49:24 +03:00
Michael Johnson 782729b6e9 Fix audit target service selection
The keystonemiddleware audit code would select the wrong OpenStack service
endpoint for a request if the cloud is not using unique TCP ports for each
service endpoint. As most services are no longer using a port per service,
but instead using unique paths, this caused the audit to select the wrong
target service. This leads to incorrect audit logging due to the wrong
audit map being used.

This patch checks the request to see if a TCP port was present in the request,
and if not, fall back to using the target_endpoint_type configured in the
audit map file.

Change-Id: Ie2e0bf74ecca485d599a4041bb770bd6e296bc99
Closes-bug: 1797584
2018-10-29 11:08:34 -07:00
Guang Yee 6779838a24 Skip the services with no endpoints when parsing service catalog
When parsing the service catalog to find the source, audit middleware
should skip over the services which have no endpoints instead of
assuming they will have at least one endpoint.

Change-Id: I287873e99338d95baaf20d52ecb3a43763a401fc
Closes-Bug: #1800017
2018-10-26 08:13:39 -07:00
Stefan Nica e83bd0bc3c Add option to disable using oslo_message notifier
Add a configuration option, 'use_oslo_messaging', to indicate whether
to use oslo_messaging notifier. It is set to true for backwards
compatibility.
We can't use audit middleware with services like Swift, which have no
dependency on Oslo and does not work well with oslo_log. Swift uses rsyslog.
Currently, audit middleware indiscriminately chooses oslo_messaging if the
package is installed. This is problematic if Swift proxy is on the same
controller as any service which consumes oslo_messaging. With this new option,
Swift can now safely consume audit middleware by electing to use local
log notifier instead of oslo_messaging.

Change-Id: I87bf857c20e4b78e97d40dcc51a1b4ff0014abb2
Closes-Bug: #1695038
2018-02-20 11:26:22 +01:00
Hangdong Zhang 4a72cd6c3b Update URLs in documentation
Update URLs according to OpenStack document migration.

Change-Id: Icb4232fcce79bb1ea121489122e578e3109b5e90
2017-07-20 16:38:16 +08:00
Tin Lam 0f4d4f8010 Fix oslo.messaging deprecation of get_transport
Oslo.messaging has deprecated get_transport and splits it into
get_notification_transport and get_rpc_transport.  This patch set updates the
code and addresses a zuul check/gate error [1].

[1] http://logs.openstack.org/55/467155/2/check/gate-keystonemiddleware-python27-ubuntu-xenial/3b6d9ef/console.html#_2017-05-24_23_49_58_453129

Change-Id: I263bd1076b47749bd14393855803419d0be9d758
2017-05-24 22:14:07 -05:00
D G Lee 50fcc70df1 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I73ca5fc046ad04505b52ca93c9bbdbfd72405aed
2017-05-02 09:58:02 +08:00
Thomas Bechtold d94c40b1e0 Remove deprecated oslo.messaging aliases parameter
Those are remnants from the oslo-incubator times. Also, oslo.messaging
deprecated [1] transport aliases since 5.2.0+ that is the minimal
version supported for stable/newton.

[1] I314cefa5fb1803fa7e21e3e34300e5ced31bba89

Closes-Bug: #1424728
Change-Id: I50c4559ea2ebc8512a05ffad52e5f04b22743ff4
2017-04-04 18:17:46 +02:00
Eric Brown 96dac98364 Use https for *.openstack.org references
The openstack.org pages now support https and our references to
the site should by default be one signed by the organization.

Change-Id: I8521461203fe40e4576f4de7cfb500bd64027d6d
2017-02-05 20:36:42 -08:00
Janonymous f4d453ec30 use oslo.log instead of logging
The constants of log levels were added in the 1.8 version
of the oslo.log library.
So we can replace all usage of system logging module
with log module from oslo.log

Change-Id: I97a1d913b543dc9dbd4d228b04adbdf7ee320df5
2017-01-13 03:24:18 +00:00
Jamie Lennox 0d1fc6c81f Use jsonutils instead of ast for loading the service catalog
AST! Never AST!

The service catalog set from auth_token middleware is a json blob not a
python blob and should be decoded as such.

This brings up the problem that the service catalog specified in the
tests is not actually valid JSON. In future I'll attempt to change this
over to using the auth_token fixture instead of a custom environment
dictionary.

Change-Id: Ic9ab68f7d41d19d3595a3ddbbb2e233f57ef52c8
2016-07-09 02:34:20 +00:00
Jamie Lennox 3ee96f1cb7 Refactor API tests to not run middleware
The API tests don't really use the API, they just test the creation of
an event so focus them on that.

There are two tests that are in the API class that really do test
middleware so they are moved back.

Change-Id: I345fe4f4c2a0d8f98ba1ff10491802002d590fa6
2016-06-28 10:06:11 +10:00
Jamie Lennox bf80779ee0 Refactor create_event onto the api object.
There are a number of methods on the api object that already handle
request specifics. Move the create_event method over to the api so that
it can be tested independantly of the middleware.

Change-Id: I60e524f1e03bfa4592756fc1da861b687ba2ee85
2016-06-27 12:15:26 +10:00
Jamie Lennox 515a990dce Extract a common notifier pattern
Create a notifier pattern that abstracts the message notification. This
should make it easier to test.

Change-Id: Ifbe3be434c304f1d3d4d570d645937a72c3503c8
2016-06-27 12:15:26 +10:00
Jamie Lennox aa2cde7f9f Break out the API piece into its own file
Refactor the API object out of the audit middleware into its own file.

Change-Id: Iddeb91db48c718d749d878ebfbe09f6a3a143229
2016-06-27 09:45:57 +10:00
Jamie Lennox 9c67feedb6 Move audit into its own folder
This is the start of a cleanup of some of the audit middleware code.

The test changes are because this reorders the test execution order and
some of the global project tests were setting long lasting state.

Change-Id: I7a5576c1f497b9a43420f66c9e511cf6f280b62e
2016-06-24 13:47:47 +00:00