snow · 2026.5.15 10:32 · 조회 3
Grafana 보안 및 인증
기본 보안 설정
/etc/grafana/grafana.ini 또는 환경 변수로 설정합니다.
[security]
# 기본 관리자 계정 설정
admin_user = admin
admin_password = strong-password
# 익명 접근 비활성화
[auth.anonymous]
enabled = false
# 사용자 셀프 가입 비활성화
[users]
allow_sign_up = false
allow_org_create = false
HTTPS 설정
Grafana 자체 SSL
[server]
protocol = https
cert_file = /etc/grafana/certs/grafana.crt
cert_key = /etc/grafana/certs/grafana.key
Nginx 리버스 프록시 (권장)
server {
listen 443 ssl;
server_name grafana.example.com;
ssl_certificate /etc/ssl/certs/grafana.crt;
ssl_certificate_key /etc/ssl/private/grafana.key;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
OAuth 연동
GitHub OAuth
- GitHub → Settings → OAuth Apps → New OAuth App
- Callback URL:
https://grafana.example.com/login/github
[auth.github]
enabled = true
client_id = your-client-id
client_secret = your-client-secret
scopes = user:email,read:org
allowed_organizations = your-org
allow_sign_up = true
Google OAuth
[auth.google]
enabled = true
client_id = your-client-id
client_secret = your-client-secret
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
allowed_domains = example.com
allow_sign_up = true
LDAP 연동
[auth.ldap]
enabled = true
config_file = /etc/grafana/ldap.toml
allow_sign_up = true
/etc/grafana/ldap.toml
[[servers]]
host = "ldap.example.com"
port = 389
use_ssl = false
bind_dn = "cn=admin,dc=example,dc=com"
bind_password = "password"
search_filter = "(uid=%s)"
search_base_dns = ["dc=example,dc=com"]
[servers.attributes]
name = "givenName"
email = "mail"
[[servers.group_mappings]]
group_dn = "cn=grafana-admin,ou=groups,dc=example,dc=com"
org_role = "Admin"
[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"
API Key & Service Account 관리
Administration → Service accounts
- 서비스 계정별 최소 권한 원칙 적용
- 토큰 만료일 설정 권장
- 정기적으로 미사용 토큰 삭제
보안 체크리스트
- 기본
admin비밀번호 변경 -
allow_sign_up = false설정 - HTTPS 적용
- 익명 접근 비활성화
- 외부 접근 시 방화벽으로 포트 3000 제한
- 정기적인 Grafana 버전 업데이트
- 미사용 API 토큰 및 서비스 계정 삭제
- 데이터 소스 읽기 전용 계정 사용
댓글
아직 댓글이 없습니다.
댓글을 작성하려면 로그인이 필요합니다.