-
Notifications
You must be signed in to change notification settings - Fork 4
[BE] 프로메테우스 도입 #183
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
[BE] 프로메테우스 도입 #183
Changes from 2 commits
d407589
7982a47
8250ef1
34653d2
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -85,6 +85,21 @@ services: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max-size: "10m" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max-file: "3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cadvisor: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: gcr.io/cadvisor/cadvisor:v0.47.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| container_name: cadvisor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restart: unless-stopped | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "8080:8080" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /:/rootfs:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /var/run:/var/run:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /sys:/sys:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /var/lib/docker/:/var/lib/docker:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /dev/disk/:/dev/disk:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| networks: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - backend-network | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+88
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's look at the docker-compose.yml file to understand the full context
find . -type f -name "docker-compose.yml" | head -20Repository: boostcampwm2025/web10-beastcamp Length of output: 221 🏁 Script executed: # Once we find the file, let's examine it
cat -n backend/docker-compose.yml | head -120Repository: boostcampwm2025/web10-beastcamp Length of output: 3166 🌐 Web query:
💡 Result: cAdvisor
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cadvisor: | |
| image: gcr.io/cadvisor/cadvisor:v0.47.2 | |
| container_name: cadvisor | |
| restart: unless-stopped | |
| ports: | |
| - "8080:8080" | |
| volumes: | |
| - /:/rootfs:ro | |
| - /var/run:/var/run:ro | |
| - /sys:/sys:ro | |
| - /var/lib/docker/:/var/lib/docker:ro | |
| - /dev/disk/:/dev/disk:ro | |
| networks: | |
| - backend-network | |
| cadvisor: | |
| image: gcr.io/cadvisor/cadvisor:v0.47.2 | |
| container_name: cadvisor | |
| restart: unless-stopped | |
| ports: | |
| - "${CADVISOR_BIND_IP:-127.0.0.1}:8080:8080" | |
| volumes: | |
| - /:/rootfs:ro | |
| - /var/run:/var/run:ro | |
| - /sys:/sys:ro | |
| - /var/lib/docker/:/var/lib/docker:ro | |
| - /dev/disk/:/dev/disk:ro | |
| networks: | |
| - backend-network |
🤖 Prompt for AI Agents
In `@backend/docker-compose.yml` around lines 88 - 101, The cadvisor service
currently exposes 8080 to all interfaces via the ports mapping "8080:8080",
which is insecure; update the cadvisor service (service name: cadvisor,
container_name: cadvisor) to bind the host-side port to a private IP by
replacing the ports entry with a host-IP-prefixed mapping that uses an env var
(e.g., ${CADVISOR_BIND_IP:-127.0.0.1}:8080:8080) so you can set CADVISOR_BIND_IP
to a private address in production, or remove the ports mapping entirely and
restrict access via host firewall rules or network configuration instead.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,10 +42,28 @@ services: | |
| max-size: '10m' | ||
| max-file: '3' | ||
|
|
||
| prometheus: | ||
| image: prom/prometheus:v2.45.0 | ||
| container_name: prometheus | ||
| volumes: | ||
| - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml | ||
| - prometheus_data:/prometheus | ||
| command: | ||
| - '--config.file=/etc/prometheus/prometheus.yml' | ||
| - '--storage.tsdb.path=/prometheus' | ||
| - '--web.console.libraries=/usr/share/prometheus/console_libraries' | ||
| - '--web.console.templates=/usr/share/prometheus/consoles' | ||
| ports: | ||
| - "9090:9090" | ||
| networks: | ||
| - monitoring-network | ||
| restart: unless-stopped | ||
|
Comment on lines
+45
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result:
Sources: [1] [2] [3] 🌐 Web query:
💡 Result: Prometheus v2.45.0 — known CVE status1) CVEs in Prometheus server itself (upstream advisories)The Prometheus upstream repo currently lists two Prometheus-server security advisories with CVEs, but neither affects v2.45.0:
2) CVEs commonly flagged in Prometheus 2.45.0 builds/images (dependency / packaging findings)Even if Prometheus 2.45.0 isn’t directly vulnerable per upstream advisories, security scanners often report CVEs coming from bundled Go modules and/or container base images. For example, a Trivy scan report for Prometheus v2.45.0 shows CVE-2023-2253 (via Additionally, some downstream “prometheus-2.45” packages/images track multiple CVEs and advisories (package-specific), with fixed versions shown as newer package revisions (example: fixes in 3) Related (but separate) component CVE you may be seeingIf your environment also runs Alertmanager, note CVE-2023-40577 (XSS in Alertmanager; fixed in Alertmanager 0.25.1 per NVD). This is not a Prometheus-server CVE, but it often appears in monitoring stack scans. [5] What to do
Sources: [1] GitHub advisory GHSA-4v48-4q5m-8vx4 (CVE-2022-46146) • [2] GitHub advisory GHSA-vx57-7f4q-fpc7 (CVE-2021-29622) • [3] prometheus/prometheus issue Prometheus 버전을 v3.8.1(최신 안정 버전)로 업그레이드해야 합니다.
최신 안정 버전 🤖 Prompt for AI Agents |
||
|
|
||
| networks: | ||
| monitoring-network: | ||
| driver: bridge | ||
|
|
||
| volumes: | ||
| loki_data: | ||
| grafana_data: | ||
| prometheus_data: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| global: | ||
| scrape_interval: 15s | ||
|
|
||
| scrape_configs: | ||
| - job_name: 'backend-metrics' | ||
| static_configs: | ||
| - targets: ['192.168.0.7:8080'] # ticket-server, api-server instance | ||
|
|
||
| - job_name: 'queue-metrics' | ||
| static_configs: | ||
| - targets: ['192.168.0.8:8080'] # queue-server instance | ||
|
Comment on lines
+1
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 고정 IP 타겟은 운영 리스크가 큽니다. 호스트 IP 변경 시 스크랩이 바로 깨집니다. 운영 유연성을 위해 DNS 기반 타겟 또는 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -56,6 +56,21 @@ services: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max-size: '10m' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max-file: '3' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cadvisor: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: gcr.io/cadvisor/cadvisor:v0.47.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| container_name: cadvisor-queue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restart: unless-stopped | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '8080:8080' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /:/rootfs:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /var/run:/var/run:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /sys:/sys:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /var/lib/docker/:/var/lib/docker:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - /dev/disk/:/dev/disk:ro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| networks: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - queue-network | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+59
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Key point: cAdvisor’s built-in Web UI auth does not secure
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cadvisor: | |
| image: gcr.io/cadvisor/cadvisor:v0.47.2 | |
| container_name: cadvisor-queue | |
| restart: unless-stopped | |
| ports: | |
| - '8080:8080' | |
| volumes: | |
| - /:/rootfs:ro | |
| - /var/run:/var/run:ro | |
| - /sys:/sys:ro | |
| - /var/lib/docker/:/var/lib/docker:ro | |
| - /dev/disk/:/dev/disk:ro | |
| networks: | |
| - queue-network | |
| cadvisor: | |
| image: gcr.io/cadvisor/cadvisor:v0.47.2 | |
| container_name: cadvisor-queue | |
| restart: unless-stopped | |
| ports: | |
| - '127.0.0.1:8080:8080' | |
| volumes: | |
| - /:/rootfs:ro | |
| - /var/run:/var/run:ro | |
| - /sys:/sys:ro | |
| - /var/lib/docker/:/var/lib/docker:ro | |
| - /dev/disk/:/dev/disk:ro | |
| networks: | |
| - queue-network |
🤖 Prompt for AI Agents
In `@queue-backend/docker-compose.yml` around lines 59 - 72, The cadvisor service
exposes port 8080 publicly; restrict binding to localhost or a private interface
and/or remove public port mapping: update the cadvisor service (the cadvisor
block and its ports entry) to bind to 127.0.0.1 (e.g., change the ports mapping
from "8080:8080" to "127.0.0.1:8080:8080") or remove the ports section entirely
and instead set the CADVISOR_BIND_IP environment variable to a private IP to
limit exposure; ensure the cadvisor container remains on the internal
queue-network only if remote access is required via a secured bastion.
Uh oh!
There was an error while loading. Please reload this page.