-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add keystone audit middleware API logging
This commit adds Keystone audit middleware API logging to the Nova- Cloud-Contoller charm in versions Yoga and newer to allow users to configure their environment for CADF compliance. This feature can be enabled/disabled and is set to 'disabled' by default to avoid bloat in log files. The logging output writes to /var/log/nova/nova-api-wsgi.log. This commit builds on previous discussions: juju/charm-helpers#808. Closes-Bug: 1856555 Change-Id: Ie09cc6775c13a2dba6a0f3d69a4a080f9fc484c8 (cherry picked from commit 723515f)
- Loading branch information
Showing
6 changed files
with
554 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
############ | ||
# Metadata # | ||
############ | ||
[composite:metadata] | ||
use = egg:Paste#urlmap | ||
/: meta | ||
|
||
[pipeline:meta] | ||
pipeline = cors metaapp | ||
|
||
[app:metaapp] | ||
paste.app_factory = nova.api.metadata.handler:MetadataRequestHandler.factory | ||
|
||
############# | ||
# OpenStack # | ||
############# | ||
|
||
[composite:osapi_compute] | ||
use = call:nova.api.openstack.urlmap:urlmap_factory | ||
/: oscomputeversions | ||
# starting in Liberty the v21 implementation replaces the v2 | ||
# implementation and is suggested that you use it as the default. If | ||
# this causes issues with your clients you can rollback to the | ||
# *frozen* v2 api by commenting out the above stanza and using the | ||
# following instead:: | ||
# /v2: openstack_compute_api_legacy_v2 | ||
# if rolling back to v2 fixes your issue please file a critical bug | ||
# at - https://bugs.launchpad.net/nova/+bugs | ||
# | ||
# v21 is an exactly feature match for v2, except it has more stringent | ||
# input validation on the wsgi surface (prevents fuzzing early on the | ||
# API). It also provides new features via API microversions which are | ||
# opt into for clients. Unaware clients will receive the same frozen | ||
# v2 API feature set, but with some relaxed validation | ||
/v2: openstack_compute_api_v21_legacy_v2_compatible | ||
/v2.1: openstack_compute_api_v21 | ||
|
||
# NOTE: this is deprecated in favor of openstack_compute_api_v21_legacy_v2_compatible | ||
[composite:openstack_compute_api_legacy_v2] | ||
use = call:nova.api.auth:pipeline_factory | ||
noauth2 = cors compute_req_id faultwrap sizelimit noauth2 legacy_ratelimit osapi_compute_app_legacy_v2 | ||
{% if audit_middleware and service_name -%} | ||
keystone = cors compute_req_id faultwrap sizelimit authtoken keystonecontext legacy_ratelimit audit osapi_compute_app_legacy_v2 | ||
keystone_nolimit = cors compute_req_id faultwrap sizelimit authtoken keystonecontext audit osapi_compute_app_legacy_v2 | ||
{% else -%} | ||
keystone = cors compute_req_id faultwrap sizelimit authtoken keystonecontext legacy_ratelimit osapi_compute_app_legacy_v2 | ||
keystone_nolimit = cors compute_req_id faultwrap sizelimit authtoken keystonecontext osapi_compute_app_legacy_v2 | ||
{% endif %} | ||
|
||
[composite:openstack_compute_api_v21] | ||
use = call:nova.api.auth:pipeline_factory_v21 | ||
noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit noauth2 osapi_compute_app_v21 | ||
{% if audit_middleware and service_name -%} | ||
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit authtoken keystonecontext audit osapi_compute_app_v21 | ||
{% else -%} | ||
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v21 | ||
{% endif %} | ||
|
||
[composite:openstack_compute_api_v21_legacy_v2_compatible] | ||
use = call:nova.api.auth:pipeline_factory_v21 | ||
noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit noauth2 legacy_v2_compatible osapi_compute_app_v21 | ||
{% if audit_middleware and service_name -%} | ||
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit authtoken keystonecontext legacy_v2_compatible audit osapi_compute_app_v21 | ||
{% else -%} | ||
keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit authtoken keystonecontext legacy_v2_compatible osapi_compute_app_v21 | ||
{% endif %} | ||
|
||
[filter:request_id] | ||
paste.filter_factory = oslo_middleware:RequestId.factory | ||
|
||
[filter:compute_req_id] | ||
paste.filter_factory = nova.api.compute_req_id:ComputeReqIdMiddleware.factory | ||
|
||
[filter:faultwrap] | ||
paste.filter_factory = nova.api.openstack:FaultWrapper.factory | ||
|
||
[filter:noauth2] | ||
paste.filter_factory = nova.api.openstack.auth:NoAuthMiddleware.factory | ||
|
||
[filter:legacy_ratelimit] | ||
paste.filter_factory = nova.api.openstack.compute.limits:RateLimitingMiddleware.factory | ||
{% if api_rate_limit_rules -%} | ||
limits = {{ api_rate_limit_rules }} | ||
{% endif -%} | ||
|
||
[filter:sizelimit] | ||
paste.filter_factory = oslo_middleware:RequestBodySizeLimiter.factory | ||
|
||
[filter:http_proxy_to_wsgi] | ||
paste.filter_factory = oslo_middleware.http_proxy_to_wsgi:HTTPProxyToWSGI.factory | ||
|
||
[filter:legacy_v2_compatible] | ||
paste.filter_factory = nova.api.openstack:LegacyV2CompatibleWrapper.factory | ||
|
||
[app:osapi_compute_app_legacy_v2] | ||
paste.app_factory = nova.api.openstack.compute:APIRouter.factory | ||
|
||
[app:osapi_compute_app_v21] | ||
paste.app_factory = nova.api.openstack.compute:APIRouterV21.factory | ||
|
||
[pipeline:oscomputeversions] | ||
pipeline = faultwrap http_proxy_to_wsgi oscomputeversionapp | ||
|
||
[app:oscomputeversionapp] | ||
paste.app_factory = nova.api.openstack.compute.versions:Versions.factory | ||
|
||
########## | ||
# Shared # | ||
########## | ||
|
||
[filter:cors] | ||
paste.filter_factory = oslo_middleware.cors:filter_factory | ||
oslo_config_project = nova | ||
|
||
[filter:keystonecontext] | ||
paste.filter_factory = nova.api.auth:NovaKeystoneContext.factory | ||
|
||
[filter:authtoken] | ||
paste.filter_factory = keystonemiddleware.auth_token:filter_factory | ||
|
||
{% include "section-filter-audit" %} | ||
|
||
{% if service_host -%} | ||
# NOTE(jamespage) - not used - but required for relation to nova-compute | ||
service_protocol = {{ service_protocol }} | ||
service_host = {{ service_host }} | ||
service_port = {{ service_port }} | ||
auth_host = {{ auth_host }} | ||
auth_port = {{ auth_port }} | ||
auth_protocol = {{ auth_protocol }} | ||
admin_tenant_name = {{ admin_tenant_name }} | ||
admin_user = {{ admin_user }} | ||
admin_password = {{ admin_password }} | ||
{% if admin_domain_name -%} | ||
admin_domain_name = {{ admin_domain_name }} | ||
{% endif -%} | ||
{% endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[DEFAULT] | ||
# default target endpoint type | ||
# should match the endpoint type defined in service catalog | ||
target_endpoint_type = None | ||
|
||
[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 |
Oops, something went wrong.