Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ func applyKeyStoreConfig(fc *FileConfig, cfg *servicecfg.Config) error {
if fc.Auth.CAKeyParams.AWSKMS != nil {
return trace.Wrap(applyAWSKMSConfig(fc.Auth.CAKeyParams.AWSKMS, cfg))
}
cfg.Auth.KeyStore.HealthCheck = fc.Auth.CAKeyParams.HealthCheck
return nil
}

Expand Down
38 changes: 38 additions & 0 deletions lib/config/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3414,6 +3414,44 @@ func TestApplyKeyStoreConfig(t *testing.T) {
},
errMessage: "must set keyring in ca_key_params.gcp_kms",
},
{
name: "enable health checking",
auth: Auth{
CAKeyParams: &CAKeyParams{
HealthCheck: &servicecfg.KeystoreHealthCheck{
Active: &servicecfg.KeystoreActiveHealthCheck{
Enabled: true,
},
},
},
},
want: servicecfg.KeystoreConfig{
HealthCheck: &servicecfg.KeystoreHealthCheck{
Active: &servicecfg.KeystoreActiveHealthCheck{
Enabled: true,
},
},
},
},
{
name: "disable health checking",
auth: Auth{
CAKeyParams: &CAKeyParams{
HealthCheck: &servicecfg.KeystoreHealthCheck{
Active: &servicecfg.KeystoreActiveHealthCheck{
Enabled: false,
},
},
},
},
want: servicecfg.KeystoreConfig{
HealthCheck: &servicecfg.KeystoreHealthCheck{
Active: &servicecfg.KeystoreActiveHealthCheck{
Enabled: false,
},
},
},
},
}

for _, tt := range tests {
Expand Down
2 changes: 2 additions & 0 deletions lib/config/fileconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,8 @@ type CAKeyParams struct {
// AWSKMS configures AWS Key Management Service to to be used for
// all CA private key crypto operations.
AWSKMS *AWSKMS `yaml:"aws_kms,omitempty"`
// HealthCheck contains configuration for keystore health checking.
HealthCheck *servicecfg.KeystoreHealthCheck `yaml:"health_check,omitempty"`
}

// PKCS11 configures a PKCS#11 HSM to be used for private key generation and
Expand Down
Loading