Skip to content

Commit

Permalink
Merge pull request #74 from dmendiza/configurable-kek
Browse files Browse the repository at this point in the history
Use Simple Crypto KEK from Secret
  • Loading branch information
vakwetu authored Jan 17, 2024
2 parents de33896 + 2dbe87f commit bb33810
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions controllers/barbicanapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func (r *BarbicanAPIReconciler) generateServiceConfigs(
"ServiceURL": "https://barbican.openstack.svc:9311",
"TransportURL": string(transportURLSecret.Data["transport_url"]),
"LogFile": fmt.Sprintf("%s%s.log", barbican.BarbicanLogPath, instance.Name),
"SimpleCryptoKEK": string(ospSecret.Data["BarbicanSimpleCryptoKEK"]),
"EnableSecureRBAC": instance.Spec.EnableSecureRBAC,
}

Expand Down
5 changes: 3 additions & 2 deletions controllers/barbicanworker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ func (r *BarbicanWorkerReconciler) generateServiceConfigs(
instance.Spec.DatabaseHostname,
barbican.DatabaseName,
),
"TransportURL": string(transportURLSecret.Data["transport_url"]),
"LogFile": fmt.Sprintf("%s%s.log", barbican.BarbicanLogPath, instance.Name),
"TransportURL": string(transportURLSecret.Data["transport_url"]),
"LogFile": fmt.Sprintf("%s%s.log", barbican.BarbicanLogPath, instance.Name),
"SimpleCryptoKEK": string(ospSecret.Data["BarbicanSimpleCryptoKEK"]),
}

return GenerateConfigsGeneric(ctx, h, instance, envVars, templateParameters, customData, labels, false)
Expand Down
4 changes: 3 additions & 1 deletion templates/barbican/config/00-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ global_default = true

[simple_crypto_plugin]
plugin_name = Software Only Crypto
kek = dGhpcnR5X3R3b19ieXRlX2tleWJsYWhibGFoYmxhaGg=
{{ if (index . "SimpleCryptoKEK") }}
kek = {{ .SimpleCryptoKEK }}
{{ end }}

0 comments on commit bb33810

Please sign in to comment.