-
Notifications
You must be signed in to change notification settings - Fork 0
chore(release): promote develop to main after security hardening #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c35ee55
6de803f
e79bfde
0084110
6115e59
32c5f82
db53871
b6bd04c
4e24673
5d2d0b4
73354f0
ead31f2
78632cc
4e94b1b
2d52f09
8edb7ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| services: | ||||||
| kafka: | ||||||
| ports: | ||||||
| - "${KAFKA_BIND_HOST:-127.0.0.1}:${KAFKA_PORT:-9092}:9092" | ||||||
| volumes: | ||||||
| - ./docker/kafka/secrets:/etc/kafka/secrets:ro | ||||||
| environment: | ||||||
| KAFKA_LISTENERS: SASL_SSL://0.0.0.0:29092,SASL_SSL_HOST://0.0.0.0:9092 | ||||||
| KAFKA_ADVERTISED_LISTENERS: SASL_SSL://kafka:29092,SASL_SSL_HOST://localhost:9092 | ||||||
| KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: SASL_SSL:SASL_SSL,SASL_SSL_HOST:SASL_SSL | ||||||
| KAFKA_INTER_BROKER_LISTENER_NAME: SASL_SSL | ||||||
| KAFKA_SASL_ENABLED_MECHANISMS: SCRAM-SHA-512 | ||||||
| KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: SCRAM-SHA-512 | ||||||
| ZOOKEEPER_SASL_ENABLED: "false" | ||||||
| KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/kafka_server_jaas.conf -Dzookeeper.sasl.client=false | ||||||
| KAFKA_SSL_CLIENT_AUTH: required | ||||||
|
||||||
| KAFKA_SSL_CLIENT_AUTH: required | |
| KAFKA_SSL_CLIENT_AUTH: none |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Kafka Security Secrets (Local) | ||
|
|
||
| This directory stores local TLS/SASL materials used by `docker-compose.secure.yml`. | ||
|
|
||
| Do not commit private keys, truststores, or credentials. | ||
|
|
||
| Expected files: | ||
| - kafka.keystore.jks | ||
| - kafka.truststore.jks | ||
| - connect.truststore.jks | ||
| - backend.truststore.jks | ||
| - kafka_keystore_creds | ||
| - kafka_sslkey_creds | ||
| - kafka_truststore_creds | ||
|
|
||
| These files are ignored by `.gitignore` (except this README and `.gitkeep`). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,11 @@ It is designed to serve three audiences: | |
| - `docs/operations/README.md` - operations index | ||
| - `docs/operations/monitor-operations-runbook.md` - operational runbook | ||
|
|
||
| #### Security Reports | ||
|
|
||
| - `docs/reports/SECURITY-AUDIT.md` - baseline security assessment and findings catalog | ||
| - `docs/reports/SECURITY-HARDENING-READINESS.md` - current closure/readiness status for findings #8-#14 | ||
|
|
||
| ### Recommended Reading Paths | ||
|
|
||
| #### For executives or architects | ||
|
|
@@ -134,6 +139,11 @@ Esta dise�ado para tres audiencias: | |
| - `docs/operations/README.md` - indice operativo | ||
| - `docs/operations/monitor-operations-runbook.md` - runbook operativo | ||
|
|
||
| #### Reportes de Seguridad | ||
|
|
||
| - `docs/reports/SECURITY-AUDIT.md` - evaluacion base de seguridad y catalogo de hallazgos | ||
| - `docs/reports/SECURITY-HARDENING-READINESS.md` - estado actual de cierre/readiness para hallazgos #8-#14 | ||
|
|
||
|
Comment on lines
+142
to
+146
|
||
| ### Rutas de Lectura Recomendadas | ||
|
|
||
| #### Para ejecutivos o arquitectos | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,6 +22,9 @@ It is intended for developers, operators, and support engineers who need repeata | |||||||||||||
| ### Index | ||||||||||||||
|
|
||||||||||||||
| - `monitor-operations-runbook.md` - day-to-day operational procedures, smoke checks, and incident-oriented troubleshooting | ||||||||||||||
| - `kafka-sasl-ssl-quickstart.md` - secure Kafka enablement (TLS/SASL) with bootstrap scripts | ||||||||||||||
| - `kafka-sasl-ssl-troubleshooting.md` - failure patterns and diagnostics for Kafka secure mode | ||||||||||||||
| - `kafka-sasl-ssl-acceptance-checklist.md` - release checklist to close secure Kafka rollout | ||||||||||||||
|
|
||||||||||||||
| ### Scope | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -42,7 +45,7 @@ The operations set covers: | |||||||||||||
| ### Resumen Ejecutivo | ||||||||||||||
|
|
||||||||||||||
| Esta carpeta es el punto de entrada operativo para validar y diagnosticar `Monitor`. | ||||||||||||||
| Esta pensada para responder rapidamente una pregunta: **¿la plataforma esta sana, observable y conectada de extremo a extremo?** | ||||||||||||||
| Esta pensada para responder rapidamente una pregunta: **�la plataforma esta sana, observable y conectada de extremo a extremo?** | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
45
to
49
|
||||||||||||||
| ### Proposito | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -52,6 +55,9 @@ Esta pensada para desarrolladores, operadores y personal de soporte que necesite | |||||||||||||
| ### Indice | ||||||||||||||
|
|
||||||||||||||
| - `monitor-operations-runbook.md` - procedimientos operativos diarios, smoke checks y troubleshooting orientado a incidentes | ||||||||||||||
| - `kafka-sasl-ssl-quickstart.md` - habilitacion de Kafka seguro (TLS/SASL) con scripts de bootstrap | ||||||||||||||
| - `kafka-sasl-ssl-troubleshooting.md` - guia de diagnostico para fallas de Kafka en modo seguro | ||||||||||||||
| - `kafka-sasl-ssl-acceptance-checklist.md` - checklist de aceptacion para cierre operativo de Kafka seguro | ||||||||||||||
|
Comment on lines
+58
to
+60
|
||||||||||||||
| - `kafka-sasl-ssl-quickstart.md` - habilitacion de Kafka seguro (TLS/SASL) con scripts de bootstrap | |
| - `kafka-sasl-ssl-troubleshooting.md` - guia de diagnostico para fallas de Kafka en modo seguro | |
| - `kafka-sasl-ssl-acceptance-checklist.md` - checklist de aceptacion para cierre operativo de Kafka seguro | |
| - `kafka-sasl-ssl-quickstart.md` - habilitación de Kafka seguro (TLS/SASL) con scripts de bootstrap | |
| - `kafka-sasl-ssl-troubleshooting.md` - guía de diagnostico para fallas de Kafka en modo seguro | |
| - `kafka-sasl-ssl-acceptance-checklist.md` - checklist de aceptación para cierre operativo de Kafka seguro |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Kafka SASL/SSL Acceptance Checklist | ||
|
|
||
| Use this checklist to declare Hallazgo #12 operationally closed. | ||
|
|
||
| ## Preconditions | ||
| - [ ] `.env` contains secure Kafka credentials | ||
| - [ ] TLS artifacts exist under `docker/kafka/secrets/` | ||
| - [ ] Preflight passes: `./scripts/kafka-secure-preflight.sh` | ||
|
|
||
| ## Activation | ||
| - [ ] Secure mode applied: `./scripts/kafka-enable-secure-mode.sh` | ||
| - [ ] Overlay is active: `docker compose -f docker-compose.yml -f docker-compose.secure.yml ps` | ||
|
|
||
| ## Smoke validation | ||
| - [ ] `./scripts/kafka-secure-smoke.sh` exits with code 0 | ||
| - [ ] `kafka`, `kafka-connect`, `backend` are running | ||
| - [ ] Backend env has `KAFKA_SECURITY_PROTOCOL=SASL_SSL` | ||
| - [ ] Connect env has `CONNECT_SECURITY_PROTOCOL=SASL_SSL` | ||
| - [ ] Recent logs have no TLS/SASL handshake/auth failures | ||
|
|
||
| ## Functional validation | ||
| - [ ] Debezium connector stays healthy | ||
| - [ ] CDC events still arrive to backend pipeline | ||
| - [ ] No regression on SSE event delivery | ||
|
|
||
| ## Rollback validated | ||
| - [ ] Plaintext fallback works: `docker compose -f docker-compose.yml up -d` | ||
| - [ ] Services recover after rollback | ||
|
|
||
| ## Evidence to attach in PR/issue | ||
| - [ ] `docker compose ps` output (secure mode) | ||
| - [ ] `./scripts/kafka-secure-preflight.sh` output | ||
| - [ ] `./scripts/kafka-secure-smoke.sh` output | ||
| - [ ] relevant logs for kafka/connect/backend |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Kafka SASL/SSL Quickstart | ||
|
|
||
| ## Purpose | ||
| Enable encrypted and authenticated Kafka traffic using `docker-compose.secure.yml` on top of the default stack. | ||
|
|
||
| ## 1) Prepare secrets | ||
| Generate truststores/keystores and credential files automatically: | ||
|
|
||
| ```bash | ||
| ./scripts/kafka-generate-secrets.sh | ||
| ``` | ||
|
|
||
| Artifacts are written under: | ||
| - `docker/kafka/secrets/` | ||
|
|
||
| See required filenames in: | ||
| - `docker/kafka/secrets/README.md` | ||
|
|
||
| ## 2) Export required environment variables | ||
| Example: | ||
|
|
||
| ```bash | ||
| export KAFKA_CONNECT_USERNAME=connect-user | ||
| export KAFKA_CONNECT_PASSWORD=connect-password | ||
| export KAFKA_CONNECT_TRUSTSTORE_PASSWORD=changeit | ||
|
|
||
| export KAFKA_BACKEND_USERNAME=backend-user | ||
| export KAFKA_BACKEND_PASSWORD=backend-password | ||
| export KAFKA_BACKEND_TRUSTSTORE_PASSWORD=changeit | ||
| ``` | ||
|
|
||
| ## 3) Start secure stack | ||
|
|
||
| ```bash | ||
| docker compose up -d kafka zookeeper | ||
| ./scripts/kafka-bootstrap-scram-users.sh | ||
| docker compose -f docker-compose.yml -f docker-compose.secure.yml up -d | ||
| ``` | ||
|
|
||
| Or run the full flow in one command: | ||
|
|
||
| ```bash | ||
| ./scripts/kafka-enable-secure-mode.sh | ||
| ``` | ||
|
|
||
| ## Troubleshooting preflight | ||
|
|
||
| Run explicit prerequisite checks before secure activation: | ||
|
|
||
| ```bash | ||
| ./scripts/kafka-secure-preflight.sh | ||
| ``` | ||
|
|
||
| If preflight fails, fix missing env vars/files and rerun. | ||
|
|
||
| ## 4) Verify secure mode | ||
| - Kafka broker listener map includes `SASL_SSL` | ||
| - Backend starts with `KAFKA_SECURITY_PROTOCOL=SASL_SSL` | ||
| - Debezium connect worker starts with SASL settings | ||
|
|
||
|
Comment on lines
+56
to
+60
|
||
| Run automated smoke check: | ||
|
|
||
| ```bash | ||
| ./scripts/kafka-secure-smoke.sh | ||
| ``` | ||
|
|
||
| ## 5) Rollback to plaintext | ||
|
|
||
| ```bash | ||
| docker compose -f docker-compose.yml up -d | ||
| ``` | ||
|
|
||
| This removes secure override and returns to base plaintext mode. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base
docker-compose.ymlKafka healthcheck useskafka-topics --bootstrap-server localhost:9092 --list(PLAINTEXT). With this overlay,9092becomesSASL_SSL, so the inherited healthcheck will likely fail and keepkafkaunhealthy (blockingkafka-connectwhich depends onservice_healthy). Consider overriding the healthcheck here with a TLS/SASL-aware check (or a simple port-open check) for secure mode.