Skip to content

Commit a459eb7

Browse files
author
Wiktor Maj
authored
Enable Swarm overlay network encryption (#122)
1 parent 67f3e34 commit a459eb7

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Dependabot updates for `github-actions` and `terraform` ecosystems. (#29)
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
18+
* Swarm overlay network encryption via IPsec and explicit data path port. (#92)
1819
* MySQL slow query log for queries exceeding 10 seconds or not using indexes. (#76)
1920
* Strengthen MySQL superset password: secrets module, expanded charset, 24 chars. (#89)
2021
* SQL Lab query row limits, timeout caps, and validation timeout. (#81)

docs/ARCHITECTURE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Redis and Superset run on the `superset-network` overlay network, which provides
133133

134134
* Service discovery: Superset connects to Redis using the hostname `redis`.
135135
* Port publishing: Swarm publishes port 443 on all Swarm nodes via VIP-based routing.
136+
* IPsec encryption: all inter-container traffic is encrypted at the network level (`encrypted: true`).
136137

137138
| Port | Protocol | Service | Scope |
138139
|------|----------|---------|-------|

docs/SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ sources.
116116
- Only port **443** (HTTPS) is intended to be exposed externally on the management nodes.
117117
- MySQL (port 3306) and MySQL Router (port 6446) communicate over the internal network only.
118118
- Redis (port 6379) is accessible only within the Docker Swarm overlay network (`superset-network`).
119+
- The `superset-network` overlay is created with `encrypted: true`, enabling IPsec ESP encryption for all
120+
inter-container traffic (Superset ↔ Redis). The Swarm data path uses port 4789 (VXLAN).
119121
- Gunicorn (port 8088) binds to `localhost` only, accessible exclusively through the Nginx reverse proxy.
120122
- IPv6 should be disabled or configured to be non-routable to prevent unintended network exposure.
121123
- DNS resolution between nodes is required for InnoDB Cluster group replication and SSH connectivity.

src/container.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,18 @@ def __init__(self, client: docker.client.DockerClient, virtual_ip_address: str)
387387
self.healthcheck_retries = 5
388388

389389
def initialize_swarm(self) -> None:
390-
self.client.swarm.init(advertise_addr=self.virtual_ip_address)
390+
self.client.swarm.init(
391+
advertise_addr=self.virtual_ip_address,
392+
data_path_port=4789
393+
)
391394

392395
def create_network(self) -> None:
393-
self.client.networks.create(name='superset-network', driver='overlay', attachable=True)
396+
self.client.networks.create(
397+
name='superset-network',
398+
driver='overlay',
399+
attachable=True,
400+
options={"encrypted": "true"}
401+
)
394402

395403
def run(self) -> None:
396404
self.initialize_swarm()

0 commit comments

Comments
 (0)