Skip to content

Commit

Permalink
Merge pull request #395 from rabi/enforce_scope
Browse files Browse the repository at this point in the history
Enforcing scope with SRBAC breaks heat
  • Loading branch information
openshift-merge-bot[bot] committed Mar 26, 2024
2 parents 86c8fe8 + 8180ec0 commit d8230c2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
11 changes: 6 additions & 5 deletions api/bases/keystone.openstack.org_keystoneapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ spec:
files. Those get added to the service config dir in /etc/<service>
. TODO: -> implement'
type: object
enableSecureRBAC:
default: true
description: EnableSecureRBAC - Enable Consistent and Secure RBAC
policies
type: boolean
memcachedInstance:
default: memcached
description: Memcached instance name.
Expand Down Expand Up @@ -365,6 +360,12 @@ spec:
description: Secret containing OpenStack password information for
keystone AdminPassword
type: string
secureRBACEnforceNewDefaults:
default: true
type: boolean
secureRBACEnforceScope:
default: false
type: boolean
tls:
description: TLS - Parameters related to the TLS
properties:
Expand Down
7 changes: 5 additions & 2 deletions api/v1beta1/keystoneapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ type KeystoneAPISpecCore struct {
// Secret containing OpenStack password information for keystone AdminPassword
Secret string `json:"secret"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
SecureRBACEnforceScope bool `json:"secureRBACEnforceScope"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=true
// EnableSecureRBAC - Enable Consistent and Secure RBAC policies
EnableSecureRBAC bool `json:"enableSecureRBAC"`
SecureRBACEnforceNewDefaults bool `json:"secureRBACEnforceNewDefaults"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=""
Expand Down
11 changes: 6 additions & 5 deletions config/crd/bases/keystone.openstack.org_keystoneapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ spec:
files. Those get added to the service config dir in /etc/<service>
. TODO: -> implement'
type: object
enableSecureRBAC:
default: true
description: EnableSecureRBAC - Enable Consistent and Secure RBAC
policies
type: boolean
memcachedInstance:
default: memcached
description: Memcached instance name.
Expand Down Expand Up @@ -365,6 +360,12 @@ spec:
description: Secret containing OpenStack password information for
keystone AdminPassword
type: string
secureRBACEnforceNewDefaults:
default: true
type: boolean
secureRBACEnforceScope:
default: false
type: boolean
tls:
description: TLS - Parameters related to the TLS
properties:
Expand Down
3 changes: 2 additions & 1 deletion controllers/keystoneapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,8 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
instance.Status.DatabaseHostname,
keystone.DatabaseName,
),
"enableSecureRBAC": instance.Spec.EnableSecureRBAC,
"EnforceScope": instance.Spec.SecureRBACEnforceScope,
"EnforceNewDefaults": instance.Spec.SecureRBACEnforceNewDefaults,
}

// create httpd vhost template parameters
Expand Down
4 changes: 2 additions & 2 deletions templates/keystoneapi/config/keystone.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ db_max_retries=-1
connection={{ .DatabaseConnection }}

[oslo_policy]
enforce_new_defaults = {{ .enableSecureRBAC }}
enforce_scope = {{ .enableSecureRBAC }}
enforce_new_defaults = {{ .EnforceNewDefaults }}
enforce_scope = {{ .EnforceScope }}

[fernet_tokens]
key_repository=/etc/keystone/fernet-keys
Expand Down

0 comments on commit d8230c2

Please sign in to comment.