Skip to content

cluster_backend_zeromq: Automatically enable encryption for multi-node clusters#106

Open
awelzel wants to merge 1 commit intomasterfrom
topic/awelzel/4432-zeromq-encryption
Open

cluster_backend_zeromq: Automatically enable encryption for multi-node clusters#106
awelzel wants to merge 1 commit intomasterfrom
topic/awelzel/4432-zeromq-encryption

Conversation

@awelzel
Copy link
Copy Markdown
Contributor

@awelzel awelzel commented Apr 1, 2026

This change introduces two new options for the ZeroMQ cluster backend:

cluster_backend_zeromq.use_curve_encryption = auto|0|1
cluster_backend_zeromq.curve_dir = ${SpoolDir}/zeromq/curve

The directory is used to persistently store the generated keys. Keys are generated by invoking Zeek and calling the ZeroMQ specific BiF generate_keypair(). To pre-provision keys, it's possible to populate the directory before invoking zeekctl.

By default, when a multi-node cluster is detected, encryption and key generation is implicitly enabled. Setting use_curve_encryption to "0" or "1" allows for explicit configuration. The default is "auto".

The keys are rendered verbatim into zeekctl-config.zeek. The assumption here is that if anyone manages to get access to the zeekctl-config.zeek file, they'll likely have a way to get to the keys in a different way already.

Copy link
Copy Markdown
Member

@ckreibich ckreibich left a comment

Choose a reason for hiding this comment

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

LGTM Arne, I just have a quick question here about the choice of spool for the key info.

(
"curve_dir",
"string",
"${SpoolDir}/zeromq/curve",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be possible to make this ${CfgDir}? At least historically the spool is a transient storage place for data awaiting processing, so not a great fit for fixed configs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I used SpoolDir because...

  • didn't want to auto-generate directories/files into CfgDir (this would be next to etc/node.cfg or so)
  • broker stores end/ended up in SpoolDir/stores and they already aren't transient.
  • ${SpoolDir}/state.db is also located there.
  • unless there's non-Zeekctl managed processes connecting: A re-deploy after deleting the keys will re-generate and re-distribute them to all cluster nodes, so they could be seen as somewhat transient.

I'll keep it there. The CfgDir seems less fitting (but certainly debatable and I see the point).

…e clusters

This change introduces two new options for the ZeroMQ cluster backend:

    cluster_backend_zeromq.use_curve_encryption = auto|0|1
    cluster_backend_zeromq.curve_dir = ${SpoolDir}/zeromq/curve

The directory is used to persistently store the generated keys. Keys are
generated by invoking Zeek and calling the ZeroMQ specific BiF
generate_keypair(). To pre-provision keys, it's possible to populate
the directory before invoking zeekctl.

By default, when a multi-node cluster is detected, encryption and key
generation is implicitly enabled. Setting use_curve_encryption to "0" or "1"
allows for explicit configuration. The default is "auto".

The keys are rendered verbatim into zeekctl-config.zeek. The assumption
here is that if anyone manages to get access to the zeekctl-config.zeek
file, they'll likely have a way to get to the keys in a different way
already.
@awelzel awelzel force-pushed the topic/awelzel/4432-zeromq-encryption branch from fdbc469 to bf1f8c5 Compare April 14, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants