ssh: allow to configure public key auth algorithms

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-11-09 20:03:04 +01:00
parent f83600225b
commit c5c5860012
15 changed files with 160 additions and 46 deletions

View File

@@ -77,14 +77,15 @@ func (h *HostKey) GetAlgosAsString() string {
// ServiceStatus defines the service status
type ServiceStatus struct {
IsActive bool `json:"is_active"`
Bindings []Binding `json:"bindings"`
SSHCommands []string `json:"ssh_commands"`
HostKeys []HostKey `json:"host_keys"`
Authentications []string `json:"authentications"`
MACs []string `json:"macs"`
KexAlgorithms []string `json:"kex_algorithms"`
Ciphers []string `json:"ciphers"`
IsActive bool `json:"is_active"`
Bindings []Binding `json:"bindings"`
SSHCommands []string `json:"ssh_commands"`
HostKeys []HostKey `json:"host_keys"`
Authentications []string `json:"authentications"`
MACs []string `json:"macs"`
KexAlgorithms []string `json:"kex_algorithms"`
Ciphers []string `json:"ciphers"`
PublicKeyAlgorithms []string `json:"public_key_algorithms"`
}
// GetSSHCommandsAsString returns enabled SSH commands as comma separated string
@@ -112,6 +113,12 @@ func (s *ServiceStatus) GetCiphersAsString() string {
return strings.Join(s.Ciphers, ", ")
}
// GetPublicKeysAlgosAsString returns enabled public key authentication
// algorithms as comma separated string
func (s *ServiceStatus) GetPublicKeysAlgosAsString() string {
return strings.Join(s.PublicKeyAlgorithms, ", ")
}
// GetStatus returns the server status
func GetStatus() ServiceStatus {
return serviceStatus