File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 646646 This job runs the devstack with scope checks enabled.
647647 vars :
648648 devstack_localrc :
649- # Keep enabeling the services here to run with system scope
650- CINDER_ENFORCE_SCOPE : true
651- GLANCE_ENFORCE_SCOPE : true
652- NEUTRON_ENFORCE_SCOPE : true
649+ ENFORCE_SCOPE : true
653650
654651- job :
655652 name : devstack-multinode
Original file line number Diff line number Diff line change @@ -1154,7 +1154,7 @@ function is_ironic_hardware {
11541154}
11551155
11561156function is_ironic_enforce_scope {
1157- is_service_enabled ironic && [[ " $IRONIC_ENFORCE_SCOPE " == " True" ]] && return 0
1157+ is_service_enabled ironic && [[ " $IRONIC_ENFORCE_SCOPE " == " True" || " $ENFORCE_SCOPE " == " True " ]] && return 0
11581158 return 1
11591159}
11601160
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ function configure_cinder {
380380 iniset $CINDER_CONF coordination backend_url " etcd3+http://${SERVICE_HOST} :$ETCD_PORT "
381381 fi
382382
383- if [[ " $CINDER_ENFORCE_SCOPE " == True ]] ; then
383+ if [[ " $CINDER_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
384384 iniset $CINDER_CONF oslo_policy enforce_scope true
385385 iniset $CINDER_CONF oslo_policy enforce_new_defaults true
386386 fi
Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ function configure_glance {
432432 iniset $GLANCE_API_CONF DEFAULT workers " $API_WORKERS "
433433 fi
434434
435- if [[ " $GLANCE_ENFORCE_SCOPE " == True ]] ; then
435+ if [[ " $GLANCE_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
436436 iniset $GLANCE_API_CONF oslo_policy enforce_scope true
437437 iniset $GLANCE_API_CONF oslo_policy enforce_new_defaults true
438438 iniset $GLANCE_API_CONF DEFAULT enforce_secure_rbac true
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ function configure_keystone {
265265 iniset $KEYSTONE_CONF security_compliance lockout_duration $KEYSTONE_LOCKOUT_DURATION
266266 iniset $KEYSTONE_CONF security_compliance unique_last_password_count $KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT
267267 fi
268- if [[ " $KEYSTONE_ENFORCE_SCOPE " == True ]] ; then
268+ if [[ " $KEYSTONE_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
269269 iniset $KEYSTONE_CONF oslo_policy enforce_scope true
270270 iniset $KEYSTONE_CONF oslo_policy enforce_new_defaults true
271271 iniset $KEYSTONE_CONF oslo_policy policy_file policy.yaml
Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ function configure_neutron {
632632# configure_rbac_policies() - Configure Neutron to enforce new RBAC
633633# policies and scopes if NEUTRON_ENFORCE_SCOPE == True
634634function configure_rbac_policies {
635- if [ " $NEUTRON_ENFORCE_SCOPE " == " True" ]; then
635+ if [[ " $NEUTRON_ENFORCE_SCOPE " == " True" || " ENFORCE_SCOPE " == " True " ] ]; then
636636 iniset $NEUTRON_CONF oslo_policy enforce_new_defaults True
637637 iniset $NEUTRON_CONF oslo_policy enforce_scope True
638638 else
Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ function configure_neutron_after_post_config {
500500# configure_rbac_policies() - Configure Neutron to enforce new RBAC
501501# policies and scopes if NEUTRON_ENFORCE_SCOPE == True
502502function configure_rbac_policies {
503- if [ " $NEUTRON_ENFORCE_SCOPE " == " True" ]; then
503+ if [[ " $NEUTRON_ENFORCE_SCOPE " == " True" || " $ENFORCE_SCOPE " == True ] ]; then
504504 iniset $NEUTRON_CONF oslo_policy enforce_new_defaults True
505505 iniset $NEUTRON_CONF oslo_policy enforce_scope True
506506 else
Original file line number Diff line number Diff line change @@ -607,14 +607,19 @@ function configure_tempest {
607607 # If services enable the enforce_scope for their policy
608608 # we need to enable the same on Tempest side so that
609609 # test can be run with scoped token.
610- if [[ " $KEYSTONE_ENFORCE_SCOPE " == True ]] ; then
610+ if [[ " $KEYSTONE_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
611611 iniset $TEMPEST_CONFIG enforce_scope keystone true
612612 iniset $TEMPEST_CONFIG auth admin_system ' all'
613613 iniset $TEMPEST_CONFIG auth admin_project_name ' '
614614 fi
615- iniset $TEMPEST_CONFIG enforce_scope glance " $GLANCE_ENFORCE_SCOPE "
616615
617- iniset $TEMPEST_CONFIG enforce_scope cinder " $CINDER_ENFORCE_SCOPE "
616+ if [[ " $GLANCE_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
617+ iniset $TEMPEST_CONFIG enforce_scope glance true
618+ fi
619+
620+ if [[ " $CINDER_ENFORCE_SCOPE " == True || " $ENFORCE_SCOPE " == True ]] ; then
621+ iniset $TEMPEST_CONFIG enforce_scope cinder true
622+ fi
618623
619624 if [ " $VIRT_DRIVER " = " libvirt" ] && [ " $LIBVIRT_TYPE " = " lxc" ]; then
620625 # libvirt-lxc does not support boot from volume or attaching volumes
Original file line number Diff line number Diff line change 179179# TODO(frickler): Drop this when plugins no longer need it
180180IDENTITY_API_VERSION=3
181181
182+ # Global option for enforcing scope. If enabled, ENFORCE_SCOPE overrides
183+ # each services ${SERVICE}_ENFORCE_SCOPE variables
184+ ENFORCE_SCOPE=$( trueorfalse False ENFORCE_SCOPE)
185+
182186# Enable use of Python virtual environments. Individual project use of
183187# venvs are controlled by the PROJECT_VENV array; every project with
184188# an entry in the array will be installed into the named venv.
You can’t perform that action at this time.
0 commit comments