Skip to main content
In this guide, you’ll secure all gossip traffic within an existing HashiCorp Consul cluster by enabling gossip encryption and message verification. By default, gossip communications are unencrypted. We’ll update each server’s agent configuration to use a shared encryption key and enable both incoming and outgoing verification.

Table of Contents

  1. Check Current Configuration
  2. Enable Gossip Encryption
  3. Validate Encryption
  4. Links and References

1. Check Current Configuration

First, verify that your cluster is using a shared encryption key but has message verification disabled.

On Consul Node A

You should see an HCL block similar to:
To generate or rotate a gossip encryption key, run:
Ensure the same key appears in every server’s encrypt field.

On Consul Node B

Confirm the encrypt value matches Node A and that both verification flags are set to false.

Restart Agents to View Current State

Expected log output:

2. Enable Gossip Encryption

Follow two steps to fully secure gossip traffic:

Step 1: Enable Outgoing Verification

Edit each node’s config.hcl:
Restart the agent:

Step 2: Enable Incoming Verification

Update both nodes again:
Restart to apply changes:
Restarting the Consul agent will momentarily interrupt cluster membership. Perform these steps during a maintenance window.

3. Validate Encryption

After enabling both flags, verify the cluster membership and confirm the encryption status in logs.

3.1 Check Cluster Membership

Expected output:

3.2 Confirm Gossip Encryption in Logs

Look for:
Once verified, all gossip communication is encrypted and integrity-checked. Any new agent joining the cluster must include the same encrypt key in its configuration.

Watch Video

Practice Lab