This page describes cluster security in Atoti’s distributed architecture: how to control which JGroups nodes are allowed to join a cluster, and how to encrypt the JGroups traffic between cluster members. User authentication itself is unchanged in a distributed deployment; see the note at the end of this page. Throughout this page, the terms “distributed cube”, “cluster member”, and “node” are used interchangeably. They all refer to a single JGroups process participating in the cluster, in line with JGroups terminology.Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
Most of the material on this page is a distilled version of the JGroups 5.x security chapter, with Atoti-specific context added. The JGroups manual remains the authoritative reference for protocol-level details.
- preventing unauthorized JGroups nodes from joining the cluster;
- preventing an eavesdropper on the network from making sense of the JGroups messages exchanged between cluster members.
AUTH protocol and the second through its ENCRYPT family of protocols (SYM_ENCRYPT, ASYM_ENCRYPT). Both are already part of the JGroups library that Atoti uses for its distributed cluster management.
The AUTH protocol
TheAUTH element is placed in the JGroups protocol stack XML (by convention, protocol.xml). It intercepts JOIN_REQUEST messages and rejects any node whose token does not satisfy the configured criteria.
In JGroups 5.x, all token properties in the XML must be prefixed with auth_token.. The auth_class attribute identifies the AuthToken implementation to use.
The following snippet shows the RegexMembership token used in the Atoti sandbox configuration. It permits only nodes whose IP address matches the given regular expression:
127.x.x.x. It does not provide a shared secret and is not appropriate for production.
The JGroups 5.x AUTH reference is at http://www.jgroups.org/manual5/#AUTH.
JGroups built-in token types
| Token class | Description | Notes |
|---|---|---|
RegexMembership | Filters by IP address or logical node name using a regular expression | No shared secret; suitable for development only |
FixedMembershipToken | Allows an explicit list of addresses | Requires known, stable addresses |
X509Token | Asymmetric-key token backed by a keystore | Suitable for production |
Krb5Token | Kerberos-based token validated against a KDC | Suitable for Kerberos-backed infrastructures |
Writing a custom AuthToken
To create a custom token java class, follow these steps:- Extend
org.jgroups.auth.AuthToken. - Declare configurable properties using
@Property(name = "…")and setters. Thenamevalue must match the XML attribute name after theauth_token.prefix. - Implement
authenticate(AuthToken token, Message msg), returningtrueonly when the incoming token proves shared identity with the local node. - Implement
writeTo(DataOutput out)andreadFrom(DataInput in)to serialize the token across the wire. - Implement
size()to return the serialized byte length of the token. - Implement
getName()returninggetClass().getName()(required by JGroups).
Encrypting cluster traffic
TheAUTH protocol controls who may join. It does not protect the content of cluster messages, and it does not protect the auth token itself from replay if the transport is unencrypted. Adding an <ENCRYPT> protocol to the stack addresses both problems: the auth exchange is encrypted on the wire, and all subsequent cluster messages are encrypted.
JGroups provides two ENCRYPT variants:
SYM_ENCRYPT: all cluster members share the same symmetric key, loaded from a JCEKS keystore. The keystore must be distributed to each node by a secure means before startup.ASYM_ENCRYPT: the cluster coordinator generates a symmetric session key and distributes it to joining nodes using asymmetric encryption. No pre-shared keystore is needed, but joining members must accept the coordinator’s key, which requires a careful trust policy.
Protocol stack example with SYM_ENCRYPT and AUTH
JGroups XML files are written bottom-up; see Protocol stack basics for the full explanation. Whenever this page says a protocol is “below” another in the stack, it means the protocol appears earlier in the XML file.
AUTHsits directly belowpbcast.GMS.SYM_ENCRYPT(and equivalentlyASYM_ENCRYPT) sits directly belowpbcast.NAKACK2, so that retransmission buffers hold plaintext and each retransmission is re-encrypted bySYM_ENCRYPT.
<SYM_ENCRYPT> is declared immediately before <pbcast.NAKACK2>, and <AUTH> is declared immediately before <pbcast.GMS>. Even though SYM_ENCRYPT sits several layers below AUTH in the stack, the auth token is still encrypted on the wire: on outgoing messages AUTH adds its header, the reliability protocols process the message, and SYM_ENCRYPT then wraps the whole frame; on incoming messages, SYM_ENCRYPT decrypts first, before any higher protocol sees the plaintext.
NAKACK2, and GMS. A real deployment also needs reliable unicast (UNICAST3), stability (STABLE), merge recovery (MERGE3), view-change synchronization (BARRIER), failure detection (FD_SOCK, FD_HOST, VERIFY_SUSPECT, …), and possibly flow control and fragmentation (UFC, MFC, FRAG4). Refer to the JGroups manual for the full list and their recommended placements.
Using ASYM_ENCRYPT instead
ASYM_ENCRYPT requires no pre-shared keystore. Replace SYM_ENCRYPT with:
User authentication
User authentication is unchanged in a distributed deployment: each node runs the same Spring Security flow it would in a standalone setup. The only cross-node requirement is that every node resolves the same username to the same identity, typically by pointing all nodes at a shared directory service (LDAP, Active Directory) or by deploying an identicalIUserDetailsService configuration on each node.