Skip to content
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

[feat] #290 - Prometheus actuator 설정 완료 #301

Merged
merged 4 commits into from
Jan 5, 2025
Merged

Conversation

hoonyworld
Copy link
Member

@hoonyworld hoonyworld commented Jan 5, 2025

Related issue 🛠

Work Description ✏️

https://techblog.woowahan.com/9232/

밑의 설명을 이해하기 위해서는 위의 블로그를 보고 오시는 것을 추천합니다.

1. actuator path 및 port 변경(Actuator는 서비스 운영에 사용되는 포트와 다른 포트를 사용한다. Actuator Default 경로를 사용하지 않고, 경로를 변경하여 운영한다.)

  • 보안을 위해서 actuator path와 actuator port를 환경변수 처리했습니다.
  • actuator path와 port는 github secret에 추가했고, 노션에도 업로드 해두었습니다.

2. Actuator endpoint는 all disable 상태에서 필요한 것만 include하여 화이트리스트 형태로 운영

  • 불필요한 endpoint가 활성화되어 추후 잠재적 위험이 될 수 있어, 기본 설정을 따르지 않겠다는 설정을 해주었습니다.

3. HTTP(WEB) 엔드포인트 설정

  • HTTP(WEB)은 health endpoint만이 유일하게 기본적으로 expose되어 있기에 info, health, prometheus를 추가해주었습니다.

4. JMX형태로 Actuator 사용이 필요하지 않을 경우, 반드시 disable한다.

  • JMX는 Default로 expose되어있는 endpoint가 많기 때문에, 사용하지 않음에도 enable 시켜두면 잠재적 위험이 될 수 있어서 비활성화 해두었습니다.

5. Actuator에 접근할 때에는, 인증되었으며 권한이 있는 사용자만이 접근가능하도록 제어한다?

  • 이 부분은 적용하지 않았습니다.
  • 설정을 하면 보안상 이점이 있을 수 있지만, 이미 Actuator 포트와 경로를 환경변수로 처리했기 때문에 굳이 설정을 추가하지 않아도 될 것 같다고 판단했습니다. (이에 대해 혜린님의 의견도 궁금합니다!)
  • 또한, 저희는 헤더에 토큰이 포함된 요청에 대해 현재 로그를 많이 찍고 있습니다. 예를 들어, 프로메테우스가 15초마다 요청을 보낸다면 로그의 개수가 급격히 늘어나고, 이는 사용자의 액션과 관계없는 의미 없는 로그이기 때문에 도입하기 부적절하다고 판단했습니다.

Trouble Shooting ⚽️

Related ScreenShot 📷

보안상의 이유로 스크린샷을 첨부하지는 못하지만, 바뀐 actuator path와 port로 heatlh와 prometheus 요청이 잘 성공한 것을 확인했습니다.

머지 후 그라파나 연동 확인 완료

image

Uncompleted Tasks 😅

To Reviewers 📢

Copy link
Collaborator

@hyerinhwang-sailin hyerinhwang-sailin left a comment

Choose a reason for hiding this comment

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

Actuator 관련 보안 강화 및 모니터링 구축 좋네요!!
동훈님이 말씀하신 것처럼 actuator 포트와 경로를 환경변수 처리했기에 노출 위험이 적으므로 권한 있는 사용자만 접근하도록 제어할 필요는 없는 것 같습니다~ actuator 관련 로그가 불필요하게 많이 늘어나는 것도 그렇구요! 고생하셨습니다~

@hoonyworld hoonyworld merged commit 3cfc11c into develop Jan 5, 2025
1 check passed
@hoonyworld hoonyworld deleted the feat/#290 branch January 5, 2025 10:26
@ckkim817
Copy link

ckkim817 commented Jan 6, 2025

덕분에 좋은 거 알고 갑니다 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Prometheus & Grafana 모니터링 툴 구축
3 participants