Skip to content

Commit 7460ed9

Browse files
rabistuggi
authored andcommitted
Enforcing scope with SRBAC breaks heat
Heat won't work when scope is enforced and it's being used by many of our NFV customers. Rather than making a single property to enable SRBAC, let's split them so that `enforce_new_defaults` can be set to true by default and customers can toggle `enforce_scope` if they're not using heat.
1 parent 7513487 commit 7460ed9

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

api/bases/keystone.openstack.org_keystoneapis.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ spec:
8484
files. Those get added to the service config dir in /etc/<service>
8585
. TODO: -> implement'
8686
type: object
87-
enableSecureRBAC:
88-
default: true
89-
description: EnableSecureRBAC - Enable Consistent and Secure RBAC
90-
policies
91-
type: boolean
9287
memcachedInstance:
9388
default: memcached
9489
description: Memcached instance name.
@@ -365,6 +360,12 @@ spec:
365360
description: Secret containing OpenStack password information for
366361
keystone AdminPassword
367362
type: string
363+
secureRBACEnforceNewDefaults:
364+
default: true
365+
type: boolean
366+
secureRBACEnforceScope:
367+
default: false
368+
type: boolean
368369
tls:
369370
description: TLS - Parameters related to the TLS
370371
properties:

api/v1beta1/keystoneapi_types.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ type KeystoneAPISpecCore struct {
9999
// Secret containing OpenStack password information for keystone AdminPassword
100100
Secret string `json:"secret"`
101101

102+
// +kubebuilder:validation:Optional
103+
// +kubebuilder:default=false
104+
SecureRBACEnforceScope bool `json:"secureRBACEnforceScope"`
105+
102106
// +kubebuilder:validation:Optional
103107
// +kubebuilder:default=true
104-
// EnableSecureRBAC - Enable Consistent and Secure RBAC policies
105-
EnableSecureRBAC bool `json:"enableSecureRBAC"`
108+
SecureRBACEnforceNewDefaults bool `json:"secureRBACEnforceNewDefaults"`
106109

107110
// +kubebuilder:validation:Optional
108111
// +kubebuilder:default=""

config/crd/bases/keystone.openstack.org_keystoneapis.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ spec:
8484
files. Those get added to the service config dir in /etc/<service>
8585
. TODO: -> implement'
8686
type: object
87-
enableSecureRBAC:
88-
default: true
89-
description: EnableSecureRBAC - Enable Consistent and Secure RBAC
90-
policies
91-
type: boolean
9287
memcachedInstance:
9388
default: memcached
9489
description: Memcached instance name.
@@ -365,6 +360,12 @@ spec:
365360
description: Secret containing OpenStack password information for
366361
keystone AdminPassword
367362
type: string
363+
secureRBACEnforceNewDefaults:
364+
default: true
365+
type: boolean
366+
secureRBACEnforceScope:
367+
default: false
368+
type: boolean
368369
tls:
369370
description: TLS - Parameters related to the TLS
370371
properties:

controllers/keystoneapi_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,8 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
11631163
instance.Status.DatabaseHostname,
11641164
keystone.DatabaseName,
11651165
),
1166-
"enableSecureRBAC": instance.Spec.EnableSecureRBAC,
1166+
"EnforceScope": instance.Spec.SecureRBACEnforceScope,
1167+
"EnforceNewDefaults": instance.Spec.SecureRBACEnforceNewDefaults,
11671168
}
11681169

11691170
// create httpd vhost template parameters

templates/keystoneapi/config/keystone.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ db_max_retries=-1
1313
connection={{ .DatabaseConnection }}
1414

1515
[oslo_policy]
16-
enforce_new_defaults = {{ .enableSecureRBAC }}
17-
enforce_scope = {{ .enableSecureRBAC }}
16+
enforce_new_defaults = {{ .EnforceNewDefaults }}
17+
enforce_scope = {{ .EnforceScope }}
1818

1919
[fernet_tokens]
2020
key_repository=/etc/keystone/fernet-keys

0 commit comments

Comments
 (0)