forked from admin/ansible
feat(hermes_squid): drop TLS and secrets from brencher-state-proxy
The previous commit added a sidecar that listened on TLS port 8443
with two docker secrets for the cert and key. That required the operator
to run openssl + docker secret create out of band before the stack
would deploy.
For a private internal API that hermes-agent consumes over the swarm
overlay, all of that is unnecessary:
- the overlay network is already isolated
- no host port is published, so the sidecar isn't reachable from
outside the swarm anyway
- hermes-agent doesn't need TLS to authenticate to the sidecar
This commit removes:
- listen 8443 ssl + ssl_certificate/ssl_protocols/ssl_ciphers in
brencher-state-proxy.conf
- the secrets: block in the brencher-state-proxy service definition
- the ports: block (no host publish)
- the top-level secrets: declaration in stack-compose.yml
After this change:
- sidecar listens on plain HTTP port 8080
- hermes-agent can reach it as
http://brencher-state-proxy:8080/state and
http://brencher-state-proxy:8080/state2
- the stack deploys with zero manual prerequisites (no openssl,
no docker secret create)
Verified locally (no docker daemon):
- YAML parse of stack-compose.yml via PyYAML: ok, no secrets block,
no ports block, extra_hosts and networks still present
- nginx -t: syntax is ok, test is successful
- Live nginx + 9 path tests against two fake upstreams: all 9 pass
(/state -> primary 200, /state2 -> secondary 200, query strings
forwarded to the correct upstream, /state/ /state2/ / /stateX
all 403, /healthz 200)
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
# host-level allowlist (which can't see inside TLS) and without exposing
|
||||
# the rest of brencher's surface area.
|
||||
#
|
||||
# Listen on 8443 with a self-signed cert (mounted via docker secrets
|
||||
# 'brencher_state_tls_cert' / 'brencher_state_tls_key'). Clients connect
|
||||
# with `curl -k` or accept the cert via a trusted CA bundle.
|
||||
# Listen on 8080 (plain HTTP). No TLS -- this is a private internal
|
||||
# API on the admin overlay, reachable only from inside the swarm. No
|
||||
# host port is published.
|
||||
#
|
||||
# Upstream is the public URL on purpose -- the sidecar reaches the public
|
||||
# brencher.rudolf.keenetic.link through the nginx-ingress overlay the same
|
||||
@@ -18,14 +18,9 @@
|
||||
# brencher container's private networks.
|
||||
|
||||
server {
|
||||
listen 8443 ssl;
|
||||
listen 8080;
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /run/secrets/brencher_state_tls_cert;
|
||||
ssl_certificate_key /run/secrets/brencher_state_tls_key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# Tiny access log; default nginx format
|
||||
access_log /var/log/nginx/brencher-state-access.log;
|
||||
error_log /var/log/nginx/brencher-state-error.log warn;
|
||||
@@ -45,8 +40,9 @@ server {
|
||||
proxy_pass https://brencher.rudolf.keenetic.link/state;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
# The upstream is HTTPS; the sidecar trusts the LE-issued cert
|
||||
# via the system CA bundle.
|
||||
# Upstream is HTTPS; the sidecar trusts the LE-issued cert via
|
||||
# the system CA bundle. SNI explicitly named so any future
|
||||
# transparent-proxy middlebox doesn't break the handshake.
|
||||
proxy_ssl_server_name on;
|
||||
proxy_ssl_name brencher.rudolf.keenetic.link;
|
||||
|
||||
|
||||
@@ -174,15 +174,6 @@ services:
|
||||
configs:
|
||||
- source: brencher_state_proxy_conf
|
||||
target: /etc/nginx/conf.d/brencher-state-proxy.conf
|
||||
secrets:
|
||||
- source: brencher_state_tls_cert
|
||||
target: brencher_state_tls_cert
|
||||
- source: brencher_state_tls_key
|
||||
target: brencher_state_tls_key
|
||||
ports:
|
||||
- target: 8443
|
||||
published: 8443
|
||||
protocol: tcp
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
@@ -221,9 +212,3 @@ volumes:
|
||||
squid_reports:
|
||||
hermes_gateway_data:
|
||||
hermes_agent_data:
|
||||
|
||||
secrets:
|
||||
brencher_state_tls_cert:
|
||||
external: true
|
||||
brencher_state_tls_key:
|
||||
external: true
|
||||
|
||||
Reference in New Issue
Block a user