Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b25327a
Add mutual TLS authentication support for DotNetty transport
Aaronontheweb Oct 2, 2025
ccde9a2
Update Akka.Remote security documentation
Aaronontheweb Oct 2, 2025
b5d3af9
Add proper code samples for TLS configuration documentation
Aaronontheweb Oct 2, 2025
55fc19c
feat(remote): implement mutual TLS authentication support
Aaronontheweb Oct 2, 2025
6716694
Fix markdown linting issues in security documentation
Aaronontheweb Oct 2, 2025
f23b042
Fix remaining markdown linting issues - convert bold text to proper h…
Aaronontheweb Oct 2, 2025
074ad4a
Merge branch 'dev' into feature/mutual-tls-enforcement
Aaronontheweb Oct 2, 2025
015d338
Fix title case issues in security.md documentation
Aaronontheweb Oct 2, 2025
d4c8a92
Add Tailscale and ZeroTier to cSpell dictionary
Aaronontheweb Oct 2, 2025
4cb9cab
Merge branch 'dev' into feature/mutual-tls-enforcement
Aaronontheweb Oct 3, 2025
7d57d19
Address PR review feedback on mutual TLS implementation
Aaronontheweb Oct 3, 2025
77e4a8e
Merge branch 'feature/mutual-tls-enforcement' of https://github.com/A…
Aaronontheweb Oct 3, 2025
46001ab
Add test for mutual TLS failure with different certificates
Aaronontheweb Oct 3, 2025
2c029b2
Add client certificate for mutual TLS testing
Aaronontheweb Oct 3, 2025
e284de2
fixed `RemoteConfigSpec`
Aaronontheweb Oct 3, 2025
7793879
Fix RemoteConfigSpec and add SSL defaults test
Aaronontheweb Oct 3, 2025
7a7f3ca
remove redundant tests
Aaronontheweb Oct 3, 2025
b23c3cd
Restore DotNettySslSetupSpec and add mutual TLS Setup API test
Aaronontheweb Oct 3, 2025
6503391
Fix DotNettySslSetupSpec compilation errors
Aaronontheweb Oct 3, 2025
0780301
Revert "Fix DotNettySslSetupSpec compilation errors"
Aaronontheweb Oct 3, 2025
0987073
Revert "Restore DotNettySslSetupSpec and add mutual TLS Setup API test"
Aaronontheweb Oct 3, 2025
ae9d0d6
Revert "remove redundant tests"
Aaronontheweb Oct 3, 2025
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
507 changes: 473 additions & 34 deletions docs/articles/remoting/security.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modernized the documentation quite a bit, but I'll need to do another PR that adds Mermaid support in order to get the handshake diagram to work.

Worth noting: the new Quic transports in Akka.NET v1.6 will, 100% always require a certificate in order to work. That is baked into how Quic works and is an unavoidable requirement.

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"Stannard",
"substream",
"substreams",
"Tailscale",
"testkit",
"threadedness",
"threadpool",
Expand All @@ -83,7 +84,8 @@
"userspace",
"watchee",
"Webcrawler",
"Xunit"
"Xunit",
"ZeroTier"
],
"ignoreWords": [
"Hanselminutes",
Expand Down
84 changes: 84 additions & 0 deletions src/core/Akka.Docs.Tests/Configuration/TlsConfigurationSample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//-----------------------------------------------------------------------
// <copyright file="TlsConfigurationSample.cs" company="Akka.NET Project">
// Copyright (C) 2009-2022 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2025 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using Akka.Configuration;

namespace Akka.Docs.Tests.Configuration
{
/// <summary>
/// TLS configuration examples for Akka.Remote documentation
/// </summary>
public class TlsConfigurationSample
{
#region MutualTlsConfig
public static Config MutualTlsConfiguration = ConfigurationFactory.ParseString(@"
akka.remote.dot-netty.tcp {
enable-ssl = true
ssl {
suppress-validation = false
require-mutual-authentication = true # Both client and server authenticate
certificate {
path = ""path/to/certificate.pfx""
password = ""certificate-password""
}
}
}
");
#endregion

#region StandardTlsConfig
public static Config StandardTlsConfiguration = ConfigurationFactory.ParseString(@"
akka.remote.dot-netty.tcp {
enable-ssl = true
ssl {
suppress-validation = false
require-mutual-authentication = false # Server authentication only
certificate {
path = ""path/to/certificate.pfx""
password = ""certificate-password""
}
}
}
");
#endregion

#region WindowsCertStoreConfig
public static Config WindowsCertificateStoreConfiguration = ConfigurationFactory.ParseString(@"
akka.remote.dot-netty.tcp {
enable-ssl = true
ssl {
suppress-validation = false
require-mutual-authentication = true
certificate {
use-thumbprint-over-file = true
thumbprint = ""2531c78c51e5041d02564697a88af8bc7a7ce3e3""
store-name = ""My""
store-location = ""local-machine"" # or ""current-user""
}
}
}
");
#endregion

#region DevTlsConfig
// WARNING: Development only - never use suppress-validation = true in production!
public static Config DevelopmentTlsConfiguration = ConfigurationFactory.ParseString(@"
akka.remote.dot-netty.tcp {
enable-ssl = true
ssl {
suppress-validation = true # INSECURE: Accepts any certificate
require-mutual-authentication = false
certificate {
path = ""self-signed-dev-cert.pfx""
password = ""password""
}
}
}
");
#endregion
}
}
4 changes: 4 additions & 0 deletions src/core/Akka.Remote.Tests/Akka.Remote.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

<None Include="Resources\akka-client-cert.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>

<None Update="test-files\SerializedException-Net6.0.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
27 changes: 26 additions & 1 deletion src/core/Akka.Remote.Tests/RemoteConfigSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Akka.Configuration;
using Akka.Remote.Transport.DotNetty;
using Akka.TestKit;
using Akka.Util.Internal;
Expand Down Expand Up @@ -113,13 +114,37 @@ public void Remoting_should_contain_correct_heliosTCP_values_in_ReferenceConf()
Assert.False(s.EnableSsl);
}

[Fact]
public void SSL_should_have_secure_defaults_when_enabled()
{
// Simple test - just enable SSL and check the defaults from reference.conf
var certPath = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Resources", "akka-validcert.pfx");
var config = ConfigurationFactory.ParseString($@"
akka.remote.dot-netty.tcp.enable-ssl = true
akka.remote.dot-netty.tcp.ssl.certificate {{
path = ""{certPath.Replace("\\", "\\\\")}""
password = ""password""
}}
").WithFallback(RARP.For(Sys).Provider.RemoteSettings.Config);

var c = config.GetConfig("akka.remote.dot-netty.tcp");
var s = DotNettyTransportSettings.Create(c);

// Verify SSL is enabled
Assert.True(s.EnableSsl);

// Verify secure defaults
Assert.True(s.Ssl.RequireMutualAuthentication, "Mutual TLS should be enabled by default");
Assert.False(s.Ssl.SuppressValidation, "Certificate validation should not be suppressed by default");
}

[Fact]
public void When_remoting_works_in_Mono_ip_enforcement_should_be_defaulted_to_true()
{
if (!IsMono) return; // skip IF NOT using Mono
var c = RARP.For(Sys).Provider.RemoteSettings.Config.GetConfig("akka.remote.dot-netty.tcp");
var s = DotNettyTransportSettings.Create(c);

Assert.True(s.EnforceIpFamily);
}

Expand Down
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a second cert to TLS verification specs.

Binary file not shown.
Loading
Loading