File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,10 @@ public class GlobalConfiguration
9
9
public LoggingDefinition Logging { get ; set ; } = new LoggingDefinition ( ) ;
10
10
public HostKeysDefinition HostKeys { get ; set ; } = new HostKeysDefinition ( ) ;
11
11
public HooksDefinition Hooks { get ; set ; } = new HooksDefinition ( ) ;
12
+
13
+ public string Ciphers { get ; set ; }
14
+ public string HostKeyAlgorithms { get ; set ; }
15
+ public string KexAlgorithms { get ; set ; }
16
+ public string MACs { get ; set ; }
12
17
}
13
18
}
Original file line number Diff line number Diff line change 17
17
</ItemGroup >
18
18
19
19
<ItemGroup >
20
- <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 6 .0.0 " />
20
+ <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 7 .0.1 " />
21
21
<PackageReference Include =" MediatR.Extensions.Microsoft.DependencyInjection" Version =" 8.1.0" />
22
- <PackageReference Include =" Microsoft.Extensions.Options.ConfigurationExtensions" Version =" 3.1.6 " />
22
+ <PackageReference Include =" Microsoft.Extensions.Options.ConfigurationExtensions" Version =" 3.1.8 " />
23
23
<PackageReference Include =" Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version =" 1.10.8" />
24
- <PackageReference Include =" Serilog" Version =" 2.9 .0" />
24
+ <PackageReference Include =" Serilog" Version =" 2.10 .0" />
25
25
<PackageReference Include =" Serilog.AspNetCore" Version =" 3.4.0" />
26
26
<PackageReference Include =" Serilog.Extensions.Hosting" Version =" 3.1.0" />
27
27
</ItemGroup >
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ public class SSHConfiguration
9
9
10
10
public List < string > AllowUsers { get ; } = new List < string > ( ) ;
11
11
12
+ public string Ciphers { get ; set ; }
13
+ public string HostKeyAlgorithms { get ; set ; }
14
+ public string KexAlgorithms { get ; set ; }
15
+ public string MACs { get ; set ; }
16
+
12
17
public override string ToString ( )
13
18
{
14
19
var builder = new StringBuilder ( ) ;
@@ -22,6 +27,12 @@ public override string ToString()
22
27
builder . AppendLine ( "HostKey /etc/ssh/ssh_host_ed25519_key" ) ;
23
28
builder . AppendLine ( "HostKey /etc/ssh/ssh_host_rsa_key" ) ;
24
29
builder . AppendLine ( ) ;
30
+ builder . AppendLine ( "# Cryptographic policy" ) ;
31
+ if ( ! string . IsNullOrWhiteSpace ( Ciphers ) ) builder . AppendLine ( $ "Ciphers { Ciphers } ") ;
32
+ if ( ! string . IsNullOrWhiteSpace ( HostKeyAlgorithms ) ) builder . AppendLine ( $ "HostKeyAlgorithms { HostKeyAlgorithms } ") ;
33
+ if ( ! string . IsNullOrWhiteSpace ( KexAlgorithms ) ) builder . AppendLine ( $ "KexAlgorithms { KexAlgorithms } ") ;
34
+ if ( ! string . IsNullOrWhiteSpace ( MACs ) ) builder . AppendLine ( $ "MACs { MACs } ") ;
35
+ builder . AppendLine ( ) ;
25
36
builder . AppendLine ( "# Disable DNS for fast connections" ) ;
26
37
builder . AppendLine ( "UseDNS no" ) ;
27
38
builder . AppendLine ( ) ;
Original file line number Diff line number Diff line change @@ -62,7 +62,14 @@ private async Task UpdateConfiguration()
62
62
var sftpConfig = await _mediator . Send ( new SftpConfigurationRequest ( ) ) ;
63
63
_loggingIgnoreNoIdentificationString = sftpConfig . Global . Logging . IgnoreNoIdentificationString ;
64
64
65
- var sshdConfig = new SSHConfiguration ( ) ;
65
+ var sshdConfig = new SSHConfiguration
66
+ {
67
+ Ciphers = sftpConfig . Global . Ciphers ,
68
+ HostKeyAlgorithms = sftpConfig . Global . HostKeyAlgorithms ,
69
+ KexAlgorithms = sftpConfig . Global . KexAlgorithms ,
70
+ MACs = sftpConfig . Global . MACs ,
71
+ } ;
72
+
66
73
var exceptionalUsers = sftpConfig . Users . Where ( s => s . Chroot != null ) . ToList ( ) ;
67
74
68
75
var standardDeclarations = new [ ]
You can’t perform that action at this time.
0 commit comments