Skip to content

fix(infra): rabbitmq-tls-unify-insecure-skip-verify#3595

Open
sunghyun1000 wants to merge 1 commit into
mainfrom
fix/rabbitmq-tls-unify-insecure-skip-verify
Open

fix(infra): rabbitmq-tls-unify-insecure-skip-verify#3595
sunghyun1000 wants to merge 1 commit into
mainfrom
fix/rabbitmq-tls-unify-insecure-skip-verify

Conversation

@sunghyun1000
Copy link
Copy Markdown
Member

Description

RabbitMQ TLS 연결 방식을 모든 서비스에서 통일합니다.

기존 PR #3445에서 iris/consumer는 CA cert 파일을 직접 읽는 방식, 나머지(iris/producer, plag/consumer, plag/producer, backend)는 InsecureSkipVerify를 사용하는 방식으로 구현이 혼재되어 있었습니다. CA cert 파일을 읽는 방식은 cert-manager 인증서 발급 → reflector 복제 완료 전에 Pod가 뜨면 파일을 찾지 못해 crash가 발생하는 race condition이 있었고, 이로 인해 release 브랜치 머지 시 서비스 장애가 발생했습니다.

클러스터 내부 통신에서는 CA cert 검증의 실질적인 보안 이득이 크지 않으므로, 전 서비스를 InsecureSkipVerify 방식으로 통일합니다. TLS 암호화는 그대로 유지되며, rabbitmq-ca-cert Secret 및 reflector 의존성이 제거됩니다.

변경 사항

  • iris/consumer: CA cert 파일 읽기 → InsecureSkipVerify
  • iris/producer, plag/consumer, plag/producer: 무조건 적용 → RABBITMQ_SSL=true 조건부 적용
  • amqp.module.ts: readFileSync(ca.crt)rejectUnauthorized: false
  • 각 서비스 deployment에서 rabbitmq-ca-cert volume mount 제거
  • rabbitmq-ca-cert.yaml 및 kustomization 참조 제거

Additional context

closes #3445 관련 장애 원인 수정


Before submitting the PR, please make sure you do the following

@sunghyun1000 sunghyun1000 requested a review from tasoo-oos May 27, 2026 15:02
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes local CA certificate reading and mounting configurations across several services (including admin-api, client-api, iris, and plag) and configures RabbitMQ TLS connections to skip verification when SSL is enabled. The reviewer correctly points out that hardcoding insecure TLS configurations (such as rejectUnauthorized: false and InsecureSkipVerify: true) exposes the services to Man-in-the-Middle (MitM) attacks. They suggest introducing a RABBITMQ_SSL_SKIP_VERIFY environment variable to dynamically control TLS verification instead of disabling it unconditionally.

Comment thread apps/backend/libs/amqp/src/amqp.module.ts
Comment thread apps/iris/src/connector/rabbitmq/consumer.go
Comment thread apps/iris/src/connector/rabbitmq/producer.go
Comment thread apps/plag/src/connector/rabbitmq/consumer.go
Comment thread apps/plag/src/connector/rabbitmq/producer.go
@tasoo-oos
Copy link
Copy Markdown
Contributor

몇 가지 후속으로 정리하면 좋을 부분이 있어 보입니다.

  1. RABBITMQ_SSL 판정 기준이 Go 코드 내에서 일관되지 않습니다. main.go에서는 env 값이 비어 있지 않으면 amqps://를 사용하지만, connector 쪽에서는 값이 정확히 "true"일 때만 TLS 설정을 적용합니다. 따라서 RABBITMQ_SSL=false 같은 값이 들어오면 amqps://로 접속하면서 TLS 설정은 적용되지 않는 상태가 될 수 있습니다. 양쪽 모두 == "true" 기준으로 맞추는 편이 안전해 보입니다.

  2. infra/k8s/rabbitmq/base/tls-certificate.yaml에는 여전히 rabbitmq-server-certs Secret reflection 허용 설정이 남아 있습니다. 이번 변경으로 각 서비스 네임스페이스의 rabbitmq-ca-cert 리소스와 마운트가 제거되었으므로, 해당 reflection annotation도 더 이상 필요 없다면 함께 정리하는 것이 좋겠습니다.

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.

2 participants