Atlas ๊ถํ ๋ถ์ฌ ๋ฐ ์ธ์ฆ์ ๋ํ ์ง์นจ
์ด ํ์ด์ง์ ๋ด์ฉ
- Atlas ์ธ์ฆ ๊ธฐ๋ฅ
- Atlas ์ธ์ฆ์ ๋ํ ๊ถ์ฅ ์ฌํญ
- Atlas UI ์ธ์ฆ
- Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ธ์ฆ
- Atlas ๊ด๋ฆฌ API ์ธ์ฆ
- ๋ฐฐํฌ
- Atlas ๊ถํ ๋ถ์ฌ์ ๋ํ ๊ถ์ฅ ์ฌํญ
- Atlas UI ๋ฐ Atlas ๊ด๋ฆฌ API(์ ์ด ํ๋ฉด) ๊ถํ ๋ถ์ฌ
- ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ถํ ๋ถ์ฌ
- ์๋ํ ์์ : Atlas ์ธ์ฆ ๋ฐ ๊ถํ ๋ถ์ฌ
์ธ์ฆ์ ์ฌ์ฉ์์ ์ ์์ ํ์ธํ๋ ํ๋ก์ธ์ค ์ ๋๋ค. Atlas ์ก์ธ์ค ๊ฒฐ์ ํ๊ธฐ ์ํด ๋ชจ๋ ์ฌ์ฉ์์๊ฒ ์์ ์ ์ธ์ฆํ๋๋ก ์๊ตฌํฉ๋๋ค.
์ธ์ฆ๊ณผ ๊ถํ ๋ถ์ฌ๋ ๋ฐ์ ํ๊ฒ ์ฐ๊ฒฐ๋์ด ์์ง๋ง, ์ธ์ฆ์ ๊ถํ ๋ถ์ฌ์ ๊ตฌ๋ณ๋ฉ๋๋ค.
์ธ์ฆ์ ์ฌ์ฉ์์ ์ ์์ ํ์ธํฉ๋๋ค.
Atlas ๊ธฐ์กด ID ์์คํ ๊ณผ ์ํํ๊ฒ ํตํฉ๋๋ ๊ฐ๋ ฅํ ์ธ์ฆ ๋ฉ์ปค๋์ฆ์ ์ ๊ณตํ์ฌ ๊ฐ๋ ฅํ ID ํ๋๋ ์ด์ ์ ํตํด UI, ๋ฐ์ดํฐ๋ฒ ์ด์ค,API์ ์์ ํ๊ฒ ์ก์ธ์ค ์๋๋ก ํฉ๋๋ค. ์ธ์ฆ ๊ตฌ์ฑํ์ฌ MongoDB Atlas ํด๋ฌ์คํฐ์ ๋ํ ์ก์ธ์ค ๊ด๋ฆฌ ํ ์ ์์ต๋๋ค.
๊ถํ ๋ถ์ฌ๋ ๋ฆฌ์์ค ๋ฐ ์์ ์ ๋ํ ํ์ธ๋ ์ฌ์ฉ์์ ์ก์ธ์ค๋ฅผ ๊ฒฐ์ ํฉ๋๋ค.
Atlas๋ Atlas์ ๋ํ ์ก์ธ์ค๋ฅผ ๊ด๋ฆฌํ๊ธฐ ์ํด ์ญํ ๊ธฐ๋ฐ ์ก์ธ์ค ์ ์ด(RBAC)๋ฅผ ์ ๊ณตํฉ๋๋ค. ์ฌ์ฉ์์๊ฒ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ฆฌ์์ค ๋ฐ ์์ ์ ๋ํ ์ฌ์ฉ์์ ์ก์ธ์ค๋ฅผ ๊ฒฐ์ ํ๋ ์ญํ ์ด ํ๋ ์ด์ ํ ๋น๋์ด์ผ ํฉ๋๋ค. ์ญํ ์ด ํ ๋น๋์ง ์์ ์ฌ์ฉ์๋ ์์คํ ์ ์ก์ธ์คํ ์ ์์ต๋๋ค.
Atlas ์ธ์ฆ ๊ธฐ๋ฅ
MongoDB Atlas ๊ฐ๋ ฅํ ๋ณด์์ ๋ณด์ฅํ๊ธฐ ์ํด ๋ค์ํ ์ธ์ฆ ๋ฐฉ๋ฒ์ ์ง์ํฉ๋๋ค.
์ฌ์ฉ์ Atlas ์ธ์ฆ์ ๊ถ์ฅ์ฌํญ์ OIDC(OpenID Connect) ๋๋ SAML 2.0์ ํตํ ์ฐํฉ ์ธ์ฆ์ ์ฌ์ฉํ์ฌ Atlas์ ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์๋ฅผ ์ํํ๊ฒ ํตํฉํ๊ณ , ๋ค์ค์์์ธ์ฆ(MFA)์ผ๋ก ๋ณด์์ ๊ฐํํ์ฌ ํ๋์ ์ธ ์ธ์ฆ ๋ฐ ๋ณด์ ํ์ธ๋ฅผ ๋ณด์ฅํ๋ ๊ฒ์ ๋๋ค.
์ํฌ๋ก๋ ์ธ์ฆ ์ ๊ฒฝ์ฐ Atlas OAuth2.0 ๋ฅผ ์ง์ํ๋ฏ๋ก ๊ถํ ๋ถ์ฌ ์๋น์ค์์ ์ํํ ํธํ์ฑ์ ์ ๊ณตํ๊ณ ํ๋๋ ์ด์ ๋ IdP์ ํตํฉํ ์ ์์ต๋๋ค.
Atlas ์์๋ ๋ชจ๋ ์ฌ์ฉ์๊ฐ ์ธ์ฆ์ ๋ฐ์์ผ Atlas UI, Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ฐ Atlas ๊ด๋ฆฌ API ์ก์ธ์ค . ๊ฐ Atlas ๋ฆฌ์์ค ์ ๋ํ ๋ค์ ์ธ์ฆ ๋ฐฉ๋ฒ์ ์ธ์ฆ ์์ ํ๊ณ ์ ์ํ ์ ์๋๋ก ๋ณด์ฅํฉ๋๋ค. Atlas ๋ค์๊ณผ ๊ฐ์ ์ธ์ฆ ๋ฉ์ปค๋์ฆ์ ์ ๊ณตํฉ๋๋ค.
Atlas ์ธ์ฆ์ ๋ํ ๊ถ์ฅ ์ฌํญ
Atlas UI ์ธ์ฆ
Atlas UI ์ก์ธ์ค ์๋ ํ๋๋ ์ด์ ์ธ์ฆ ๊ถ์ฅํฉ๋๋ค. ํ๋๋ ์ด์ ์ธ์ฆ ๊ตฌ์ฑํ๋ ค๋ฉด Atlas ์๊ฒฉ ์ฆ๋ช ์์ฑํ๊ฑฐ๋ Google ๋๋ Github ๋ก ๋ก๊ทธ์ธ ํด์ผ ํฉ๋๋ค.
Atlas ์๊ฒฉ ์ฆ๋ช ์ ๊ฒฝ์ฐ, ์์ฒด ์ธ์๊ณผ ๊ฐ์ ํผ์ฑ ๋ฐฉ์ง MFA์ ํจ๊ป ๊ฐ๋ ฅํ ๋น๋ฐ๋ฒํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๊ณ์ ์ ๊ธ์ ๋ฐฉ์งํ๋ ค๋ฉด ์ธ์ปจ๋๋ฆฌ MFA ์์๋ฅผ ์ค์ ํ๋ค ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. Atlas ์๊ฒฉ ์ฆ๋ช ์ ๋ํ MFA ์ก์ธ์ค ๋ณด์ฅํ๋ ค๋ฉด ์กฐ์ง ์ค์ ์์ MFA ์ํ์ ์ผ์ธ์. ๋๋ฉ์ธ์ ๋ํ ํ๋๋ ์ด์ ์ ์ค์ ํ๋ค ํ ํ์๋ ํ๋๋ ์ด์ ์ธ์ฆ ์ค๋จ๋ ๊ธด๊ธ Break-Glass ์๋๋ฆฌ์ค์์๋ง Atlas ์๊ฒฉ ์ฆ๋ช ์ฌ์ฉํ์ฌ ์ธ์ฆํด์ผ ํฉ๋๋ค.
์ฐํฉ ์ธ์ฆ
์ฐํฉ ์ธ์ฆ์ ์ฌ์ฉํ๋ฉด ํ๋์ ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์๋ฅผ ํตํด ์ฌ๋ฌ ์์คํ ๊ณผ ์ ํ๋ฆฌ์ผ์ด์ ์์ Atlas UI์ ๋ํ ๋ชจ๋ ์ธ์ฆ์ ํตํฉํ์ฌ ๊ด๋ฆฌํ ์ ์์ต๋๋ค. UI ์ก์ธ์ค๋ฅผ ์ํด Atlas๋ SAML 2.0์ ์ฌ์ฉํ์ฌ ์ง์ ID ์ฐํฉ์ ์ง์ํฉ๋๋ค. Okta, Microsoft Entra ID, Ping Identity์ ๊ฐ์ SAML ํธํ ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์๋ฅผ ์ฌ์ฉํ๋ฉด ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์ ๋ด์์ ๋น๋ฐ๋ฒํธ ๋ณต์ก์ฑ, ์๊ฒฉ ์ฆ๋ช ํ์ , MFA ๋ฑ์ ๋ณด์ ์ ์ฑ ์ ์ํํ ์ ์์ต๋๋ค.
์ฌ์ฉ์ ๋ฐ ์ ํ๋ฆฌ์ผ์ด์ ์๋ฒ๋ฅผ ํฌํจํ๋ IP ๋ฒ์์ ์ฐ๊ฒฐ๋ง ํ์ฉํ๋๋ก Atlas UI ์์ IP ์ก์ธ์ค ๋ชฉ๋ก ๊ตฌ์ฑํด์ผ ํฉ๋๋ค.
์์ธํ ํ์ต ์ ํ๋๋ ์ด์ ์ธ์ฆ ๊ตฌ์ฑ์ ์ฐธ์กฐํ์ธ์.
๋ค๋จ๊ณ ์ธ์ฆ
Atlas ์ปจํธ๋กค ํ๋ ์ธ์ ์ก์ธ์ค ํ ์ ์๋ ๋ชจ๋ ์ธ๊ฐ ์ฌ์ฉ์์ ๊ฒฝ์ฐ ๋ณด์ ๊ฐํ๋ฅผ ์ํด MFA๋ฅผ ์๊ตฌํ๋ ๊ฒ์ด ์ข์ต๋๋ค. MFA๊ฐ ํ์ฑํ๋๋ฉด Atlas ๋ ๊ฐ์ง ํํ์ ์๋ณ์ด ํ์ํฉ๋๋ค.
์ฌ์ฉ์์ ์๊ฒฉ ์ฆ๋ช
๋ค์ ๊ถ์ฅ ์์ธ ์ค ํ๋์ ๋๋ค.
๋ณด์ ํค
์์ฒด ์ธ์
OTP ์ธ์ฆ์
ํธ์ ์๋ฆผ
SMS( ํ๋ผ์ด๋จธ๋ฆฌ ์์๋ก ๊ถ์ฅ๋์ง ์์)
์ด๋ฉ์ผ(๊ธฐ๋ณธ ์์๋ก ๊ถ์ฅ๋์ง ์์)
์์ธํ ๋ด์ฉ์ ๋ค์ค ์ธ์ฆ ์ต์ ๊ด๋ฆฌํ๊ธฐ ํญ๋ชฉ์ ์ฐธ์กฐํ์ธ์.
Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ธ์ฆ
Atlas ๋ค์ํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ธ์ฆ ๋ฉ์ปค๋์ฆ์ ์ง์ํฉ๋๋ค.
MongoDB Shell ๋ฐ Compass ์ ๊ฐ์ ๋๊ตฌ๋ฅผ ํตํด Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ ๋ํ ์ํฌํฌ์ค(ํด๋จผ ์ฌ์ฉ์) ์ก์ธ์ค ๊ตฌ์ฑํ๋ ค๋ฉด OIDC์ํจ๊ป Workforce Identity Federation์ ์ฌ์ฉํฉ๋๋ค.
MongoDB ๋๋ผ์ด๋ฒ๋ฅผ ์ฌ์ฉํ์ฌ Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ํ ์ํฌ๋ก๋(์ ํ๋ฆฌ์ผ์ด์ ) ์ก์ธ์ค๋ฅผ ๊ตฌ์ฑํ๋ ค๋ฉด ์ํฌ๋ก๋ ์์ด๋ดํฐํฐ ํ๋๋ ์ด์ , AWS-IAM ์ธ์ฆ ๋๋ X.509 ์ธ์ฆ์ ์ธ์ฆ์ ์ฌ์ฉํ์ธ์. SCRAM ์ธ์ฆ์ ๊ฐ๋ฐ ๋๋ ํ ์คํธ ํ๊ฒฝ์์๋ง ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
Atlas๋ ๋ค์๋ ์ง์ํฉ๋๋ค:
JIT(Just-In-Time) ๋ฐ์ดํฐ๋ฒ ์ด์ค์ก์ธ์ค ๊ฐ์ง ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์ ์์ฑ
Workforce Identity Federation
Workforce Identity Federation์ ์ฌ์ฉํ๋ฉด ID ์ ๊ณต์ ํตํด Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ ๋ํ ๋ชจ๋ ์ธ์ฆ ๊ด๋ฆฌ ํ ์ ์์ต๋๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ก์ธ์ค ์ ๊ฒฝ์ฐ, Okta, Microsoft Entra ID ๋๋ Ping Identity์ ๊ฐ์ OIDCํธํ ID ์ ๊ณต์๋ฅผ ์ฌ์ฉํ์ฌ ID ์ ๊ณต์ ๋ด์์ ๋น๋ฐ๋ฒํธ ๋ณต์ก์ฑ, ์๊ฒฉ ์ฆ๋ช ์ํ, MFA์ ๊ฐ์ ๋ณด์ ์ ์ฑ ์ ์ํํ๋ค ์ข์ต๋๋ค.
์์ธํ ๋ด์ฉ์ OIDC๋ก Workforce Identity Federation ์ค์ ์ ์ฐธ์กฐํ์ธ์.
Workload Identity Federation ๋ฐ Amazon Web Services IAM ์ญํ ์ธ์ฆ
Workload Identity Federation์ ์ฌ์ฉํ๋ฉด Azure ๋ฐ Google Cloud์ ๊ฐ์ cloud ํ๊ฒฝ์์ ์คํ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ณ๋์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์ ์๊ฒฉ ์ฆ๋ช ๊ด๋ฆฌ ํ ํ์ ์์ด Atlas ๋ก ์ธ์ฆํ ์ ์์ต๋๋ค. Workload Identity Federation์ ์ฌ์ฉํ๋ฉด Azure ๊ด๋ฆฌํ ID, Google ์๋น์ค ๊ณ์ ๋๋ ๋ชจ๋ OAuth ํธํ ์๋น์ค๋ฅผ ์ฌ์ฉํ์ฌ Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์๋ฅผ ๊ด๋ฆฌ ํ ์ 2.0์์ต๋๋ค. ์ด๋ฌํ ์ธ์ฆ ๋ฉ์ปค๋์ฆ์ Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ ์ํธ ์๋ ์ก์ธ์ค ์ ์๋๋ก ํ์ฌ ๊ด๋ฆฌ ๊ฐ์ํํ๊ณ ๋ณด์์ ๊ฐํํฉ๋๋ค.
ํ๋ก๋์ ํ๊ฒฝ์์ ์คํ๋๋ ๋ชจ๋ ์ํฌ๋ก๋ ์ ํ๋ฆฌ์ผ์ด์ ์ Workload Identity Federation์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋ฐ๋์ ํ์ํ ๋น์ ์ํฉ ์ธ์๋ ์ฌ์ฉ์์ ์ฐ๊ฒฐ์ ํ์ฉํ์ง ์์์ผ ํฉ๋๋ค.
AWS IAM ์ญํ ์ ํตํด ์ธ์ฆํ ์๋ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์.
X.509 ํด๋ผ์ด์ธํธ ์ธ์ฆ์ ๋ฐ SCRAM
๋ณด์ ๋ฐ ๋ชจ๋ Atlas ์ ์ด ๋ฐ ๋ฐ์ดํฐ ํ๋ฉด์ ๋ํ ์ก์ธ์ค๋ฅผ ์ฝ๊ฒ ํ๋ ค๋ฉด ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์๋ฅผ ํตํด Workforce ๋๋ Workload Identity Federation์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
ํ๋๋ ์ด์ ์ฉ ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์๊ฐ ์๋ ๊ฒฝ์ฐ Atlas ํด๋ฌ์คํฐ๋ ์ฌ์ฉ์ ์ธ์ฆ์ ์ํ X.509 ํด๋ผ์ด์ธํธ ์ธ์ฆ์๋ ์ง์ํฉ๋๋ค. X.509 ์ธ์ฆ์๋ ์ํธ TLS์ ๋ณด์์ ์ ๊ณตํ์ฌ ์คํ ์ด์ง ๋ฐ ํ๋ก๋์ ํ๊ฒฝ์ ์ ํฉํ๋ฉฐ, X.509์ ํจ๊ป ์ฌ์ฉํ ์์ฒด ์ธ์ฆ ๊ธฐ๊ด์ ๊ฐ์ ธ์ฌ ์๋ ์์ต๋๋ค. X.509์ ๋จ์ ์ ์ ํ๋ฆฌ์ผ์ด์ ์ธก์์ ์ธ์ฆ์์ ๊ทธ ๋ณด์์ ๊ด๋ฆฌํด์ผ ํ๋ค๋ ์ ์ ๋๋ค. ๋ฐ๋ฉด Workload Identity Federation์ ์ฌ์ฉํ๋ฉด ์ํธ ์๋ ์ก์ธ์ค๊ฐ ๊ฐ๋ฅํ๊ณ ์ ํ๋ฆฌ์ผ์ด์ ๋ณด์์ด ๋ ๊ฐํธํด์ง๋๋ค.
Atlas ํด๋ฌ์คํฐ๋ ์ฌ์ฉ์ ์ธ์ฆ์ ์ํด SCRAM ๋น๋ฐ๋ฒํธ ์ธ์ฆ์ ์ง์ํ์ง๋ง, ๊ฐ๋ฐ ๋ฐ ํ ์คํธ ํ๊ฒฝ์์๋ง SCRAM์ ์ฌ์ฉํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
X.509 ๋๋ SCRAM ์ธ์ฆ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, HashiCorp Vault ๋๋ AWS Secrets Manager์ ๊ฐ์ ํ์ฌ ๋น๋ฐ ๊ด๋ฆฌ์๋ฅผ ์ฌ์ฉํ์ฌ ๋ณต์กํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๊ฒฉ ์ฆ๋ช ์ ์์ฑํ๊ณ ์ ์ฅํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
์์ธํ ๋ด์ฉ์ ์์๋ณด๋ ค๋ฉด ๋ค์ ๋งค๋ด์ผ ํ์ด์ง๋ฅผ ์ฐธ์กฐํ์ธ์.
์ ์ ์ก์ธ์ค
Atlas๋ ๋ฏธ๋ฆฌ ์ ์๋ ์๊ฐ์ด ์ง๋๋ฉด ์๋์ผ๋ก ๋ง๋ฃ๋๋ ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์ ์์ฑ์ ์ง์ํฉ๋๋ค. ์ฌ์ฉ์๋ ๋ค์ ๊ธฐ๊ฐ ๋์ ์์ฑํ ์ ์์ต๋๋ค:
6์๊ฐ
1์ผ
1์ฃผ
์์ธํ ๋ด์ฉ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์ ๊ตฌ์ฑ์ ์ฐธ์กฐํ์ธ์.
๋น๋ฐ ๊ด๋ฆฌ
HashiCorp Vault ๋๋ AWS Secrets Manager๋ฅผ ์ฌ์ฉํ์ฌ ๋ณต์กํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๊ฒฉ ์ฆ๋ช ์ ์์ฑํ๊ณ ์ ์ฅํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. ๋น๋ฐ ๊ด๋ฆฌ์๋ Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ํด ์ค์ ๋ ์ญํ ์ ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค ์๊ฒฉ ์ฆ๋ช ์ ๋์ ์ผ๋ก ์์ฑํ ์ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ MongoDB Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋น๋ฐ์ HashiCorp Vault์์ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ํ ๋ธ๋ก๊ทธ๋ฅผ ์ฐธ์กฐํ์ธ์.
Atlas ๊ด๋ฆฌ API ์ธ์ฆ
Atlas๋ Atlas Administration API์ ์ธ์ฆํ ์ ์๋ ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค.
์๋น์ค ๊ณ์ (ํ์ฌ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ ๊ธฐ๋ฅ์ผ๋ก ์ ๊ณต)
API ํค
์๋น์ค ๊ณ์
์๋น์ค ๊ณ์ ์ ์ ๊ณ ํ์ค OAuth ๋ฅผ2.0 ์ฌ์ฉํ์ฌ Atlas Administration API ํตํด Atlas ์ ์์ ํ๊ฒ ์ธ์ฆํฉ๋๋ค. ์๋น์ค ๊ณ์ ์ ๋จ๊ธฐ ์ก์ธ์ค ํ ํฐ์ ์ฌ์ฉํ๊ณ ํ์ ์๊ฒฉ ์ฆ๋ช ๋กํ ์ด์ ์ ํตํด ๋ณด์์ ๊ฐํํ๋ฏ๋ก ๊ฐ๋ฅํ๋ฉด API ํค ๋์ ์๋น์ค ๊ณ์ ์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
์๋น์ค ๊ณ์ ์ Preview ๊ธฐ๋ฅ ์ผ๋ก ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, Atlas UI ๋๋ Atlas Administration API ํตํด์๋ง ์๋น์ค ๊ณ์ ์ ๋ํ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ ์ก์ธ์ค ๊ด๋ฆฌ ํ ์ ์์ต๋๋ค. Atlas CLI ๋๋ Terraform์ ํตํด ์๋น์ค ๊ณ์ ์ ๋ํ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ ์ก์ธ์ค ๊ด๋ฆฌ ํ ์ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ ์๋น์ค ๊ณ์ ๊ฐ์๋ฅผ ์ฐธ์กฐํ์ธ์.
API ํค
์๋น์ค ๊ณ์ ์ ์ฌ์ฉํ์ง ์๋ ๊ฒฝ์ฐ API ํค ๊ธฐ๋ฐ ์ธ์ฆ์ ์ฌ์ฉํ์ฌ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์ ์ก์ธ์ค๋ฅผ ์์ ํ๊ฒ ๊ด๋ฆฌํ ์ ์์ต๋๋ค. API ํค ๊ธฐ๋ฐ ์ธ์ฆ์ HTTP ๋ค์ด์ ์คํธ ์ธ์ฆ์ ์ฌ์ฉํ์ฌ ์์ฒญ์ ๋ณดํธํฉ๋๋ค. API ๊ณต๊ฐ ํค๋ ์ฌ์ฉ์ ์ด๋ฆ์ผ๋ก, ํด๋น ๊ฐ์ธ ํค๋ ๋น๋ฐ๋ฒํธ๋ก ์๋ํฉ๋๋ค. ์ด ํค๋ AWS Secrets Manager ๋๋ HashiCorp Vault์ ๊ฐ์ ํ์ฌ ๋น๋ฐ ๊ด๋ฆฌ ์์คํ ์ ์ ์ฅํด์ผ ํฉ๋๋ค. HashiCorp Vault์ ์ด๋ฌํ ํค๋ฅผ ์์ ํ๊ฒ ์ ์ฅํ๋ ๋ฐฉ๋ฒ์ ์์๋ณด๋ ค๋ฉด HashiCorp Vault์์ MongoDB Atlas ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋น๋ฐ์ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ํ ๋ธ๋ก๊ทธ๋ฅผ ์ฐธ์กฐํ์ธ์.
๋ณด์์ ๋์ฑ ๊ฐํํ๊ณ ๋ฌด๋จ ์ก์ธ์ค์ ์ํ์ ์ต์ํํ๋ ค๋ฉด:
์ ๊ธฐ์ ์ผ๋ก API ํค๋ฅผ ๊ต์ฒดํ๊ธฐ ์ํ ๊ถ์ฅ์ฌํญ์ ๋ฐ๋ฅด์ธ์. ์๋ฅผ ๋ค์ด HashiCorp Vault๋ฅผ ์ฌ์ฉํ์ฌ ์ด๋ฌํ ํค๋ฅผ ํ์ ํ๋ ๋ฐฉ๋ฒ์ ์์๋ณด๋ ค๋ฉด Hashicorp ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์.
API ํค์ IP ์ก์ธ์ค ๋ชฉ๋ก์ ์ฌ์ฉํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ Atlas ๊ด๋ฆฌ API์ ๋ํ IP ์ก์ธ์ค ๋ชฉ๋ก ์๊ตฌ๋ฅผ ์ฐธ์กฐํ์ธ์.
์์ธํ ๋ด์ฉ์ Atlas ๊ด๋ฆฌ API ์ธ์ฆ์ ์ฐธ์กฐํ์ธ์.
๋ฐฐํฌ
๋ฐฐํฌ์ ๊ดํ ๊ถ์ฅ์ฌํญ์ ์ธ์ฆ๊ณผ ๊ด๋ จ๋ Atlas ์กฐ์ง, ํ๋ก์ ํธ ๋ฐ ํด๋ฌ์คํฐ์ ๋ํ ์ง์นจ์ ์ฐธ์กฐํ์ธ์.
Atlas ๊ถํ ๋ถ์ฌ์ ๋ํ ๊ถ์ฅ ์ฌํญ
๋ชจ๋ ๋ฆฌ์์ค์ ๋ํ ์ก์ธ์ค ํจ๊ณผ์ ์ผ๋ก ๊ด๋ฆฌ ํ๋ ค๋ฉด Atlas์ ๊ฐ๋ ฅํ ์ญํ ๊ธฐ๋ฐ ์ก์ธ์ค ์ ์ด(RBAC)๋ฅผ ๊ตฌํ ํด์ผ ํฉ๋๋ค. Atlas ์๋ Atlas ์ปจํธ๋กค ํ๋ ์ธ์ ๊ด๋ฆฌํ๋ ๋ฐ ์ผ๋ฐ์ ์ผ๋ก ํ์ํ ๋ค์ํ ์์ค์ ์ก์ธ์ค ์ ๊ณตํ๋ ๋ด์ฅ ์ญํ ์ด ํฌํจ๋์ด ์์ต๋๋ค. ๋ฐ์ดํฐ ์์ญ์์ Atlas cluster์ ์ฐ๊ฒฐํ๋ ค๋ฉด ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ธ๋ถํ๋ ์ฌ์ฉ์ ์ง์ ์ญํ ์ ์ฌ์ฉํ์ฌ ์ญํ ์ด ๊ธฐ๋ฅ์ ์ํํ๋ ๋ฐ ํ์ํ ๋ฐ์ดํฐ ์ก์ธ์ค ์ ๋ํ ์ก์ธ์ค ๊ธฐ๋ฐ์ผ๋ก ์ธ๋ถํ๋ ๋ฒ์๋ฅผ ์ ๊ณตํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ด ์ ๊ทผ ๋ฐฉ์์ ์ฌ์ฉํ๋ฉด ์ต์ ๊ถํ ์์น์ ๋ฐ๋ฅผ ์ ์์ต๋๋ค.
๋ํ, Atlas๋ฅผ ์ฐํฉ ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์์ ํตํฉํ๋ฉด ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์ ๊ทธ๋ฃน์ Atlas ์ญํ ์ ๋งคํํ์ฌ ํ๋ก๋น์ ๋์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ ์ก์ธ์ค ๊ด๋ฆฌ๋ฅผ ๊ฐ์ํํ๊ณ ํ๋ซํผ ์ ๋ฐ์ ๊ฑธ์ณ ์์ ํ๊ณ ์ฒด๊ณ์ ์ธ ์ญํ ํ ๋น์ ์ง์ํฉ๋๋ค. ์ค์ผ์คํธ๋ ์ด์ ๊ณ์ธต์ ํ๋ก๋น์ ๋ ํ๋ก์ธ์ค๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ผ๋ก ์ก์ธ์ค ๊ถํ์ ๋ถ์ฌํ ์ ์์ต๋๋ค.
์ผ๋ฐ์ ์ผ๋ก ๋ณด์ ๋ฐ ๊ฒฐ์ ๋ก ์ ๊ฒฐ๊ณผ์ ๋ํด ํ ์คํธ๋ ์คํฌ๋ฆฝํธ๊ฐ ์๋ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์ ์๋น์ค ๊ณ์ ์ผ๋ก๋ง ์์ ํ๊ฒฝ์ ๋ํ ์ก์ธ์ค ํญ์ ์ ํํ๋ ๊ฒ์ด ๊ฐ์ฅ ์ข์ต๋๋ค. ๊ฐ๋ฐ ๋ฐ ํ ์คํธ ์ค์๋ ํ์ ํ๊ฒฝ์์๋ง ์ฌ๋์ ์ก์ธ์ค ํ์ฉํด์ผ ํฉ๋๋ค.
Atlas UI ๋ฐ Atlas ๊ด๋ฆฌ API(์ ์ด ํ๋ฉด) ๊ถํ ๋ถ์ฌ
์ฌ์ฉ์, ์๋น์ค ๊ณ์ , API ํค๋ฅผ ์ฌ์ ์ ์๋ ์ญํ ์ ํ ๋นํ์ฌ Atlas ์กฐ์ง, ํ๋ก์ ํธ ๋๋ ๋ ๋ค ๋ด์์ ์ํํ ์ ์๋ ์์ ์ ์ง์ ํ ์ ์์ต๋๋ค. Identity Federation์ ์ฌ์ฉํ๋ฉด ๊ทธ๋ฃน-์ญํ ๋งคํ์ ํตํด ID ์ ๊ณต์ ๊ทธ๋ฃน์ Atlas ์ญํ ์ ์ฐ๊ฒฐํ์ฌ ์ก์ธ์ค ๊ด๋ฆฌ .
Azure Entra ID, Okta ๋๋ Ping Identity์ ๊ฐ์ SAML์ ์ง์ํ๋ ์ต์ ์ฐํฉ ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์(IdP)๋ฅผ ์ฌ์ฉํ๋ฉด ๊ถํ ๋ถ์ฌ ํ๋ก์ธ์ค๊ฐ ๋ ์์ ํด์ง๊ณ , ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์ ๊ทธ๋ฃน์ Atlas ์ญํ ์ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ผ๋ก ํ ๋นํ๋ ๋ฐ ํ์ํ ์ ์ฐ์ฑ์ ํ๋ณดํ ์ ์์ต๋๋ค. ํ์ฌ์ ๋๋ฉ์ธ์ ์ ํํ์ฌ ์ก์ธ์ค ๊ถํ์ด ์๋ ์ฌ์ฉ์๊ฐ Atlas์ ๋ก๊ทธ์ธํ์ง ๋ชปํ๋๋ก ํด์ผ ํฉ๋๋ค. ์ด๋ฅผ ์ํด์๋ ์ฐํฉ ์ธ์ฆ์ ์ํ ๋๋ฉ์ธ ๋งคํ ๊ด๋ฆฌ ์ ์ฐจ๋ฅผ ๋ฐ๋ฅด์ธ์. ์ฌ๊ธฐ์์ ์ญํ ๋งคํ ํ๋ก์ธ์ค์ ํ์๋ ๋๋ก ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์ ๊ทธ๋ฃน์ Atlas ์ญํ ์ ๋งคํํ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
๊ฐ BU ๋๋ ๋ถ์๋ณ๋ก ์ฐ๊ฒฐ๋ ์กฐ์ง์ด ์๋ ๋จ์ผ ์ฒญ๊ตฌ ์กฐ์ง์ ํ์ค Atlas ๊ณ์ธต ๊ตฌ์กฐ๋ฅผ ๋ฐ๋ฅด๋ ๊ฒฝ์ฐ์๋ ์กฐ์ง ์ฌ์ฉ์๋ฅผ ์ด์ ๋๋ ํ๋ซํผ ํ ๊ด๋ฆฌ์๋ก ์ ํํด์ผ ํฉ๋๋ค. ๋ฐ๋ฉด ์ ํ๋ฆฌ์ผ์ด์ ๊ตฌ์ถ์ ๋ด๋นํ๋ ๊ฐ๋ฐ ํ ๋๋ ์ ํ ํ์๋ ํ๋ก์ ํธ ์ญํ ์ ํ ๋นํด์ผ ํฉ๋๋ค. ์์ ํ๊ฒฝ์์๋ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ ์ ๊ทผ๋ง ํ์ฉ๋์ด์ผ ํฉ๋๋ค. ๊ฐ์ฅ ์ผ๋ฐ์ ์ผ๋ก ์ฌ์ฉ๋๋ ์ญํ ์ ๋ํ ๋ค์ ๊ถ์ฅ์ฌํญ์ ์ผ๋ฐ์ ์ธ ์ง์นจ์ผ๋ก ์ ๊ณต๋ ์ ์์ต๋๋ค.
Organization Owner
์ญํ ์กฐ์ง ์ ์ฒด์ ์ค์ ์ ๋ณ๊ฒฝํ๊ณ ๊ตฌ์ฑ์ ์ญ์ ๊ธฐ๋ฅ ์์ผ๋ฏ๋ก ์๊ฒฉํ๊ฒ ์ ํํด์ผ ํ๋ฉฐ ์ฌ๋์๊ฒ ํ ๋นํ์ง ์์์ผ ํฉ๋๋ค. ์ด ์ญํ ์ฒ์์ ์กฐ์ง ์ค์ ํ๋ค ํ๊ณ ๊ตฌ์ฑํ๋ ๋ฐ๋ง ์ฌ์ฉํ๋ ์๋น์ค ๊ณ์ ์ ํ ๋น๋์ด์ผ ํฉ๋๋ค. ์ด๊ธฐ ์์ฑ ํ ๊ตฌ์ฑ ๋ณ๊ฒฝ์ ์ต์ํํฉ๋๋ค. ๊ณ์ ์ ๊ธ์ ๋ฐฉ์งํ๋ ค๋ฉด ๋ค์ ํญ๋ชฉ์ ์์ฑํ ์ ์์ต๋๋ค.JIT(Just-in-Time) ์ก์ธ์ค ๊ถํ์ด ์๋SAML ์กฐ์ง ์์ ์ ๊ทธ๋ฃน .
์กฐ์ง ์์ ์ ์ญํ ์๋ API ํค์ ๋๋ค. Break-Glass ๊ธด๊ธ ์๋๋ฆฌ์ค์ ๋๋นํ ๊ฐ๋ ฅํ ์ก์ธ์ค ๊ด๋ฆฌ ํตํด ์์ ํ ์ฅ์์ ๋ณด๊ดํ์ธ์.
Organization Member
์ญํ ์ ์กฐ์ง์ ์ค์ ๋ฐ ๊ตฌ์ฑ์ ๋ณผ ์ ์๋ ์ด์ ๋ฐ ํ๋ซํผ ํ์ ๊ด๋ฆฌ์์๊ฒ ํ ๋น๋์ด์ผ ํฉ๋๋ค.Organization Project Creator
์ญํ ๊ฐ๋ฐ ๋ฐ ์ ํ ํ์ ์ํ ์ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋์ ํ์ฌ ํ๋ก์ ํธ๋ฅผ ๋ง๋๋ ๋ฐ ์ฌ์ฉ๋๋ ํ๋ก๊ทธ๋๋งคํฑ ์๋น์ค ๊ณ์ ์ด์ด์ผ ํฉ๋๋ค.Organization Billing Admin
์ญํ Billing API ์์ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ผ๋ก ์ฒญ๊ตฌ์๋ฅผ ๊ฐ์ ธ์์ ์ฌ๋ฌด ์ด์ ๋๊ตฌ์ ์ ๊ณตํ๋ ๋ฐ ์ฌ์ฉ๋๋ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์ ์๋น์ค ๊ณ์ ์ด์ด์ผ ํฉ๋๋ค. ์ด ๋์ผํ ์๋น์ค ๊ณ์ ์ ์ฌ์ฉ ๋ณด๊ณ ๋ด๋นํ๋ ๋ชจ๋ ์ฐ๊ฒฐ๋ ์กฐ์ง์ ์ก์ธ์ค ํ ์ ์์ด์ผ ํฉ๋๋ค.Project Owner
์ญํ ์ด์ ๋ฐ ํ๋ก๋น์ ๋ ํ ์์ ์ํํ๋ ๊ฑฐ๋ฒ๋์ค ์ ์ฌ์ฉํด์ผ ํฉ๋๋ค. ์ด ์ญํ ํด๋ฌ์คํฐ๋ฅผ ๋ง๋ค๊ณ ์ญ์ ๊ธฐ๋ฅ ์๋ ํ๋ก๊ทธ๋๋งคํฑ ์๋น์ค ๊ณ์ ์ ํ ๋นํ์ธ์. ์๋๋ฐ์ค ํ๊ฒฝ์ ๊ฒฝ์ฐ ์ฌ์ฉ์์๊ฒProject Owner
์ก์ธ์ค ๋ถ์ฌํ์ฌ ์ค์ผ์คํธ๋ ์ด์ ๋ฐฐํฌ์๋ฒ ํ์ดํ๋ผ์ธ ๊ฑฐ์น์ง ์๊ณ ๋ ์ฝ๋ ๋ฐ ์ฌ์ฉ ์ฌ๋ก ํ ์คํธ๋ฅผ ์ํ ํด๋ฌ์คํฐ๋ฅผ ๋น ๋ฅด๊ฒ ํ๋ก๋น์ ๋ํ ํ์ฑํ ํ ์ ์์ต๋๋ค.ํ์ ํ๊ฒฝ์์๋ ๊ฐ๋ฐ ํ์ด ๊ฐ๋ฐ ๋ฐ ํ ์คํธ ์ค์ ํด๋ฌ์คํฐ์ ์ฟผ๋ฆฌ ๋ฐ ์ฑ๋ฅ ์งํ์ ์ก์ธ์คํ ์ ์๋๋ก
Project Data Access Admin
์ญํ ์ ๋ถ์ฌํฉ๋๋ค. ์ด ์ก์ธ์ค๋ฅผ ํตํด ๋ฐ์ดํฐ ํ์๊ธฐ์์ ๋ฐ์ดํฐ ๋ฌธ์ ๋ฅผ ๋๋ฒ๊น ํ ์ ์์ต๋๋ค. ํ๋ก๋์ ํ๊ฒฝ์์ ์ด ์ญํ ์ ํ์ฉํ์ง ๋ง์ญ์์ค. ํด๋ฌ์คํฐ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค, ์ปฌ๋ ์ , ์ธ๋ฑ์ค๋ฅผ ์์ฑ ๋ฐ ์ ๊ฑฐํ๋ ๊ฒ์ ํฌํจํ์ฌ ๋ฐ์ดํฐ๋ฅผ ๋ณด๊ณ ํธ์งํ๋ ๊ธฐ๋ฅ์ด ์์ด ์ ์ํ ์คํ๊ณผ ๊ฐ๋ฐ์ ์ ์ฉํฉ๋๋ค. ๊ฐ๋ฐ ํ๊ฒฝ์์ ๊ฐ๋ฐ ํ์๊ฒ ์ด ์์ค์ ์ก์ธ์ค ๊ถํ์ ๋ถ์ฌํ๋ ๊ฒ์ด ๋ถํธํ ๊ฒฝ์ฐProject Data Access Read Only
์ญํ ์ ์ฌ์ฉํ์ฌ ํด๋ฌ์คํฐ์ ๋ฐ์ดํฐ ๋ฐ ์ฑ๋ฅ ํต๊ณ์ ๋ํ ์ฝ๊ธฐ ์ ์ฉ ์ก์ธ์ค ๊ถํ์ ๋ถ์ฌํ ์ ์์ต๋๋ค.ํ๋ก๋์ ํ๊ฒฝ์์ ํด๋ฌ์คํฐ์ ๋ฐ์ดํฐ์ ์ฝ๊ธฐ ์ ์ฉ ์ก์ธ์ค๋ฅผ ๋ถ์ฌํ๋ ค๋ฉด
Project Observability Viewer
์ญํ ์ ์ฌ์ฉํฉ๋๋ค.
์์ธํ ๋ด์ฉ์ Atlas ์ฌ์ฉ์ ์ญํ ์ ์ฐธ์กฐํ์ธ์.
๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ถํ ๋ถ์ฌ
์ง์ ๋ฐ ์ํฌ๋ก๋ ์ฌ์ฉ์์๊ฒ๋ ํน์ ํ๋ก์ ํธ๋ ๊ฐ๋ณ ํด๋ฌ์คํฐ์ ๋ง์ถ ๊ถํ์ ๊ฐ์ง ์ธ๋ถํ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ญํ (์ฌ์ ์ ์ ๋๋ ์ฌ์ฉ์ ์ง์ )์ ํ ๋นํ ์ ์์ต๋๋ค. ์คํ ์ด์ง ๋ฐ ํ๋ก๋์ ํ๊ฒฝ์์๋ Identity Federation์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ด๋ฅผ ํตํด ์๊ฒฉ ์ฆ๋ช ๊ณต๊ธ์(IdP)๋ฅผ Atlas์ ์ฐ๋ํ์ฌ ๋ฐ์ดํฐ ์ก์ธ์ค๋ฅผ ์ํ ์ธ์ฆ ๋ฐ ๊ถํ ๋ถ์ฌ ๊ณผ์ ์ ๋ณด๋ค ํ๋์ ์ด๊ณ ํจ์จ์ ์ผ๋ก ๊ด๋ฆฌํ ์ ์์ต๋๋ค.
์๊ฒฉ ์ฆ๋ช
๊ณต๊ธ์์์ ๊ทธ๋ฃน ๋ฉค๋ฒ์ญ์ ๊ตฌ์ฑํ๋ฉด ๊ทธ๋ฃน์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์์ ๋งคํํ์ฌ ์๊ฒฉ ์ฆ๋ช
๊ณต๊ธ์ ๋ด์์ ์ก์ธ์ค ์ ์ด๋ฅผ ๊ฐ์ํํ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ํฌ๋ก๋ ID์ ๊ฒฝ์ฐ groups
๋์ users
ํด๋ ์์ ์ฌ์ฉํ์ฌ ์ง์ ์ญํ ์ ํ ๋นํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๊ฐ๋ฐ ๋ฐ ํ
์คํธ ํ๊ฒฝ์์๋ ์ฌ์ ์ ์๋ readWriteAny
์ญํ ์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ํ์ฌ ๊ฐ๋ฐ ๋ฐ ํ
์คํธ ํ๋ก์ธ์ค๋ฅผ ๊ฐ์ํํ ์ ์์ต๋๋ค. ์ ํ๋ฆฌ์ผ์ด์
์ ์์ ํ๊ฒฝ์ผ๋ก ์ด๋ํ ๋๋ ์ต์ ๊ถํ ์์น์ ๋ฐ๋ผ ์ ํ๋ฆฌ์ผ์ด์
์๋ฒ์ ์ ๊ทผ์ ์ ํํ๋ ์ฌ์ฉ์ ์ ์ ์ญํ ์ ๋ง๋ค์ด์ผ ํฉ๋๋ค.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์.
์๋ํ ์์ : Atlas ์ธ์ฆ ๋ฐ ๊ถํ ๋ถ์ฌ
GitHub์์ ๋ชจ๋ ์์ญ์ ๊ฑธ์ณ ์คํ ์ด์ง/ํ๋ก๋์ ๊ถ์ฅ ์ฌํญ์ ์ ์ฉํ๋ Terraform ์์๋ฅผ ํ์ธํ์ธ์.
๋ค์ ์์์์๋ ์๋ํ ์ํด Atlas ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์ธ์ฆ ๋ฐ ์ฌ์ฉ์ ์ง์ ์ญํ ์ ๊ตฌ์ฑํฉ๋๋ค.
์ง์ ๋ ํด๋ฌ์คํฐ์ ๋ํ ์ฌ์ฉ์ ์ธ์ฆ์ ์์ฑํ๋ ค๋ฉด IAM ์๊ฒฉ ์ฆ๋ช ์ ์ฌ์ฉํด ๋ค์ ๋ช ๋ น์ ์คํํ์ธ์.
atlas dbusers create \ --projectId "6698000acf48197e089e4085" \ --username "MyRoleARN" \ --awsIAMType "ROLE" \ --role "clusterMonitor" \ --scope "myCluster"
๋ค์ ๋ช ๋ น์ ์คํํ์ฌ SCRAM ์ธ์ฆ ์ฌ์ฉํ์ฌ ์์ ์ฌ์ฉ์๋ฅผ ์์ฑํฉ๋๋ค.
atlas dbusers create \ --projectId 6698000acf48197e089e4085 \ --username "tempUser" \ --password "securePassword" \ --role "readWrite" \ --scope "myCluster" \ --deleteAfter "2025-02-01T12:00:00Z"
๋ค์ ๋ช ๋ น์ ์คํํ์ฌ OIDC๋ฅผ ์ฌ์ฉํ์ฌ Workforce Identity Federation์ ๊ตฌ์ฑํฉ๋๋ค.
atlas federatedAuthentication federationSettings identityProvider create oidc Azure \ --audience "https://management.azure.com/" \ --authorizationType "USER" \ --desc "oidc-for-azure" \ --federationSettingsId "5d1113b25a115342acc2d1aa" \ --groupsClaim "groups" \ --idpType "WORKFORCE" \ --issuerUri "https://sts.windows.net/" \ --userClaim "sub"
๋ค์ ์์๋ ์ธ์ฆ ๋ฐ ๊ถํ ๋ถ์ฌ๋ฅผ ๊ตฌ์ฑํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. Terraform์ผ๋ก ๋ฆฌ์์ค๋ฅผ ์์ฑํ๋ ค๋ฉด:
๊ฒฐ์ ์กฐ์ง์ ์์ฑํ๊ณ ํด๋น ๊ฒฐ์ ์กฐ์ง์ ๋ํ API ํค๋ฅผ ์์ฑํฉ๋๋ค. ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํ์ฌ API ํค๋ฅผ ํ๊ฒฝ ๋ณ์๋ก ์ ์ฅํ์ธ์.
export MONGODB_ATLAS_PUBLIC_KEY="<insert your public key here>" export MONGODB_ATLAS_PRIVATE_KEY="<insert your private key here>"
๊ณต์ฉ ํ์ผ
๊ฐ ์์ ์ ๋ํด ๋ค์ ํ์ผ์ ๋ง๋ค์ด์ผ ํฉ๋๋ค. ๊ฐ ์์ ์ ๋ํ ํ์ผ์ ์์ฒด ๋๋ ํ ๋ฆฌ ์ ๋ฐฐ์นํฉ๋๋ค. ๊ฐ์ ์ฌ์ฉํ๋ ค๋ฉด ID์ ์ด๋ฆ์ ๋ณ๊ฒฝํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์ ๋ช ๋ น์ ์คํ Terraform์ ์ด๊ธฐํํ๊ณ , Terraform ๊ณํ์ ํ์ธํ ๋ค์ ๋ณ๊ฒฝ ์ฌํญ์ ์ ์ฉ .
azure.tf
locals { tags = { CreatedBy = "Terraform" Owner = var.owner Module = "tf-example-oidc-azure" Name = var.project_name } } resource "azurerm_resource_group" "this" { name = var.project_name location = var.location tags = local.tags } resource "azurerm_virtual_network" "this" { name = var.project_name address_space = ["10.0.0.0/16"] location = azurerm_resource_group.this.location resource_group_name = azurerm_resource_group.this.name tags = local.tags } resource "azurerm_subnet" "internal" { name = "internal" resource_group_name = azurerm_resource_group.this.name virtual_network_name = azurerm_virtual_network.this.name address_prefixes = ["10.0.2.0/24"] } resource "azurerm_public_ip" "vm-public-ip" { name = "public-ip-${var.project_name}" location = var.location resource_group_name = azurerm_resource_group.this.name allocation_method = "Dynamic" domain_name_label = var.project_name tags = local.tags } resource "azurerm_network_interface" "this" { name = "ip-${var.project_name}" location = var.location resource_group_name = azurerm_resource_group.this.name tags = local.tags ip_configuration { subnet_id = azurerm_subnet.internal.id name = "public" private_ip_address_allocation = "Dynamic" public_ip_address_id = azurerm_public_ip.vm-public-ip.id } } resource "azurerm_user_assigned_identity" "this" { location = var.location name = var.project_name resource_group_name = azurerm_resource_group.this.name tags = local.tags } resource "azurerm_linux_virtual_machine" "this" { name = var.project_name resource_group_name = azurerm_resource_group.this.name location = var.location size = "Standard_F2" admin_username = var.vm_admin_username custom_data = data.cloudinit_config.this.rendered network_interface_ids = [azurerm_network_interface.this.id] tags = local.tags admin_ssh_key { username = var.vm_admin_username public_key = var.ssh_public_key } source_image_reference { publisher = "Canonical" offer = "0001-com-ubuntu-server-jammy" sku = "22_04-lts" version = "latest" } os_disk { storage_account_type = "Standard_LRS" caching = "ReadWrite" disk_size_gb = 30 } identity { type = "UserAssigned" identity_ids = [azurerm_user_assigned_identity.this.id] } }
variables.tf
variable "user" { description = "MongoDB Atlas User" type = list(string) default = ["dbuser1", "dbuser2"] } variable "database_name" { description = "The Database in the cluster" type = list(string) } variable "org_id" { description = "MongoDB Organization ID" type = string } variable "project_id" { description = "MongoDB Atlas Project ID" type = string } variable "connection_strings" { description = "List of MongoDB connection strings to the cluster" type = list(string) } variable "token_audience" { description = "The token audience used by the OIDC identity provider" type = string default = "https://management.azure.com/" # Example audience } variable "trusted_domains" { description = "List of associated domains to trust" type = list(string) default = ["myOrg.com", "another-trusted-domain.org"] # Example domains }
terraform.tfvars
org_id = "32b6e34b3d91647abb20e7b8" project_id = "67212db237c5766221eb6ad9" user = ["testUser"] database_name = ["myTestDb"] connection_strings = ["mongodb+srv://cluster0.mongodb.net"] token_audience = "https://management.azure.com/" trusted_domains = ["myOrg.com", "example-domain.org"]
์ธ์ฆ ์์
๋ค์์ ์ฌ์ฉํ์ฌ ์ฌ์ฉ์ ์ด๋ฆ ๋ฐ ๋น๋ฐ๋ฒํธ ์ธ์ฆ ํตํด Atlas user ์์ฑํฉ๋๋ค.
main.tf
locals { test_user_password = random_password.password.result } Generates 12 characters long random password without special characters resource "random_password" "password" { length = 12 special = false } resource "mongodbatlas_database_user" "user1" { username = var.user[0] password = local.test_user_password project_id = var.project_id auth_database_name = "admin" scopes = var.clusters[0] roles { role_name = "readWriteAny" database_name = var.database_name[0] } } output "user1" { value = mongodbatlas_database_user.user1.username } output "userpwd" { value = mongodbatlas_database_user.user1.password sensitive = true }
๋ค์ ์์ ์ฌ์ฉํ์ฌ Azure ์์ ์ฌ์ฉํ๊ธฐ ์ํด Atlas ์์ OIDC ํ๋๋ ์ด์ ID ์ ๊ณต์ ์ค์ ํ๋ค ํ ๋ค์,OIDC ํ๋๋ ์ด์ ์ธ์ฆ ์ฌ์ฉ์๋ฅผ ์์ฑํฉ๋๋ค. Azure Active Directory์์ ๋ฐ๊ธํ OIDC ํ ํฐ์ ์ฌ์ฉํ์ฌ ์ก์ธ์ค ํ์ฉํฉ๋๋ค.
main.tf
# Connection string to use in this configuration locals { mongodb_uri = var.connection_strings[0] } # Fetch MongoDB Atlas Federated Settings data "mongodbatlas_federated_settings" "this" { org_id = var.org_id } # Configure an identity provider for federated authentication resource "mongodbatlas_federated_settings_identity_provider" "oidc" { federation_settings_id = data.mongodbatlas_federated_settings.this.id associated_domains = var.trusted_domains audience = var.token_audience authorization_type = "USER" description = "OIDC Identity Provider for Azure AD" # Replace with actual Azure Tenant ID issuer_uri = "https://sts.windows.net/${data.azurerm_client_config.current.tenant_id}/" idp_type = "WORKFORCE" name = "OIDC-for-azure" protocol = "OIDC" user_claim = "sub" # Claim to extract the user's principal identity } resource "mongodbatlas_federated_settings_org_config" "this" { federation_settings_id = data.mongodbatlas_federated_settings.this.id org_id = var.org_id domain_restriction_enabled = false domain_allow_list = [] data_access_identity_provider_ids = [mongodbatlas_federated_settings_identity_provider.oidc.idp_id] } # Create an OIDC-authenticated Database User resource "mongodbatlas_database_user" "oidc" { project_id = var.project_id username = "${mongodbatlas_federated_settings_identity_provider.oidc.idp_id}/${data.azurerm_client_config.current.client_id}" oidc_auth_type = "USER" auth_database_name = "$external" # Required when using OIDC for USER authentication roles { role_name = "atlasAdmin" database_name = "admin" } } # Azure-specific data source needed for Tenant ID and Client ID data "azurerm_client_config" "current" {}
outputs.tf
output "vm_fqdn" { value = azurerm_public_ip.vm-public-ip.fqdn description = "Fully Qualified Domain Name (FQDN) of the Virtual Machine (VM)" } output "ssh_connection_string" { value = "ssh ${var.vm_admin_username}@${azurerm_public_ip.vm-public-ip.fqdn}" description = "Useful for connecting to the instance" } output "user_test_conn_string" { value = "mongodb+srv://${var.user[0]}:<password>@${replace(local.mongodb_uri, "mongodb+srv://", "")}/?retryWrites=true" description = "Connection string for testing regular database user access" sensitive = true } output "user_oidc_conn_string" { value = "mongodb+srv://${mongodbatlas_database_user.oidc.username}:<OIDCToken>@${replace(local.mongodb_uri, "mongodb+srv://", "")}/?authMechanism=MONGODB-OIDC&retryWrites=true" description = "Connection string for OIDC-authenticated user" sensitive = true }
๊ถํ ๋ถ์ฌ ์์
๋ค์์ ์ฌ์ฉํ์ฌ ์ฌ์ฉ์์๊ฒ ํด๋ฌ์คํฐ ์ ๋ํ ๊ด๋ฆฌ์ ๊ถํ ๋ฐ ํด๋ฌ์คํฐ ์ ํ๋ก์ ํธ์ ๋ํ ํ๋ก์ ํธ ๋ฉค๋ฒ ๊ถํ์ ๋ถ์ฌํฉ๋๋ค.
main.tf
resource "mongodbatlas_database_user" "admin_user" { project_id = "6698000acf48197e089e4085" username = "adminUser" password = "securePassword" # Use a secure password auth_database_name = "admin" roles { role_name = "atlasAdmin" # Admin role for the cluster database_name = "admin" } roles { role_name = "readWriteAnyDatabase" # Project member rights database_name = "admin" } }
๋ค์ ๋ช
๋ น์ ์คํํ์ฌ ID ์ ๊ณต์์ ํน์ ๊ทธ๋ฃน ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ์๋ฅผ ์์ฑํฉ๋๋ค. ID ์ ๊ณต์ Okta๋ฅผ ํตํด ์ฌ์ฉ์ ์ธ์ฆ ๋ฐ ๊ถํ ๋ถ์ฌ ๊ด๋ฆฌ ํ ์ ์์ต๋๋ค. ์ด ๋ช
๋ น์ ๋ํ ID ์ ๊ณต์ ๊ทธ๋ฃน ์ ์ฌ์ฉ์์๊ฒ Atlas cluster ์ ๋ํ dbAdmin
๋ฐ readWrite
๊ถํ์ ๋ถ์ฌํฉ๋๋ค.
atlas dbusers create \ --projectId "6698000acf48197e089e4085" \ --username "okta/my-idp-group" \ --role "readWrite,dbAdmin" \ --oidcType "IDP_GROUP"
๋ค์ ๋ช ๋ น์ ์คํํ์ฌ ํ๋๋ ์ด์ ์ค์ ์์ OIDC ํธํ ID ์ ๊ณต์๋ฅผ ์์ฑํฉ๋๋ค.
atlas federatedAuthentication federationSettings identityProvider create oidc IDPName \ --audience "api://12345678-1234-1234-1234-123456789abc" \ --authorizationType "GROUP" \ --clientId "abcdef12-3456-7890-abcd-ef1234567890" \ --desc "MyOIDCProvider test" \ --federationSettingsId "5d1113b25a115342acc2d1aa" \ --groupsClaim "groups" \ --idpType "WORKLOAD" \ --issuerUri "https://sts.windows.net/12345678-1234-1234-1234-123456789abc/" \ --userClaim "sub" \ --associatedDomain "example.com"
๋ค์ ์์๋ ์ธ์ฆ ๋ฐ ๊ถํ ๋ถ์ฌ๋ฅผ ๊ตฌ์ฑํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. Terraform์ผ๋ก ๋ฆฌ์์ค๋ฅผ ์์ฑํ๋ ค๋ฉด:
๊ฒฐ์ ์กฐ์ง์ ์์ฑํ๊ณ ํด๋น ๊ฒฐ์ ์กฐ์ง์ ๋ํ API ํค๋ฅผ ์์ฑํฉ๋๋ค. ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํ์ฌ API ํค๋ฅผ ํ๊ฒฝ ๋ณ์๋ก ์ ์ฅํ์ธ์.
export MONGODB_ATLAS_PUBLIC_KEY="<insert your public key here>" export MONGODB_ATLAS_PRIVATE_KEY="<insert your private key here>"
๊ณต์ฉ ํ์ผ
๊ฐ ์์ ์ ๋ํด ๋ค์ ํ์ผ์ ๋ง๋ค์ด์ผ ํฉ๋๋ค. ๊ฐ ์์ ์ ๋ํ ํ์ผ์ ์์ฒด ๋๋ ํ ๋ฆฌ ์ ๋ฐฐ์นํฉ๋๋ค. ๊ฐ์ ์ฌ์ฉํ๋ ค๋ฉด ID์ ์ด๋ฆ์ ๋ณ๊ฒฝํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์ ๋ช ๋ น์ ์คํ Terraform์ ์ด๊ธฐํํ๊ณ , Terraform ๊ณํ์ ํ์ธํ ๋ค์ ๋ณ๊ฒฝ ์ฌํญ์ ์ ์ฉ .
azure.tf
locals { tags = { CreatedBy = "Terraform" Owner = var.owner Module = "tf-example-oidc-azure" Name = var.project_name } } resource "azurerm_resource_group" "this" { name = var.project_name location = var.location tags = local.tags } resource "azurerm_virtual_network" "this" { name = var.project_name address_space = ["10.0.0.0/16"] location = azurerm_resource_group.this.location resource_group_name = azurerm_resource_group.this.name tags = local.tags } resource "azurerm_subnet" "internal" { name = "internal" resource_group_name = azurerm_resource_group.this.name virtual_network_name = azurerm_virtual_network.this.name address_prefixes = ["10.0.2.0/24"] } resource "azurerm_public_ip" "vm-public-ip" { name = "public-ip-${var.project_name}" location = var.location resource_group_name = azurerm_resource_group.this.name allocation_method = "Dynamic" domain_name_label = var.project_name tags = local.tags } resource "azurerm_network_interface" "this" { name = "ip-${var.project_name}" location = var.location resource_group_name = azurerm_resource_group.this.name tags = local.tags ip_configuration { subnet_id = azurerm_subnet.internal.id name = "public" private_ip_address_allocation = "Dynamic" public_ip_address_id = azurerm_public_ip.vm-public-ip.id } } resource "azurerm_user_assigned_identity" "this" { location = var.location name = var.project_name resource_group_name = azurerm_resource_group.this.name tags = local.tags } resource "azurerm_linux_virtual_machine" "this" { name = var.project_name resource_group_name = azurerm_resource_group.this.name location = var.location size = "Standard_F2" admin_username = var.vm_admin_username custom_data = data.cloudinit_config.this.rendered network_interface_ids = [azurerm_network_interface.this.id] tags = local.tags admin_ssh_key { username = var.vm_admin_username public_key = var.ssh_public_key } source_image_reference { publisher = "Canonical" offer = "0001-com-ubuntu-server-jammy" sku = "22_04-lts" version = "latest" } os_disk { storage_account_type = "Standard_LRS" caching = "ReadWrite" disk_size_gb = 30 } identity { type = "UserAssigned" identity_ids = [azurerm_user_assigned_identity.this.id] } }
variables.tf
# Azure Variables variable "token_audience" { type = string default = "https://management.azure.com/" description = "Used as resource when getting the access token. See more in the [Azure documentation](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/how-to-use-vm-token#get-a-token-using-http)" } # MongoDB Atlas variables variable "org_id" { type = string description = "MongoDB Atlas Organization ID" } variable "project_id" { type = string description = "MongoDB Atlas Project ID" } variable "project_name" { type = string description = "MongoDB Atlas Project Name" } variable "connection_strings" { type = list(string) description = "MongoDB Atlas Cluster Standard Connection Strings" }
terraform.tfvars
org_id = "32b6e34b3d91647abb20e7b8" project_id = "67212db237c5766221eb6ad9" project_name = "My Project" connection_strings = token_audience = "https://management.azure.com/"
outputs.tf
output "vm_fqdn" { value = azurerm_public_ip.vm-public-ip.fqdn description = "Fully Qualified Domain Name (FQDN) of the Virtual Machine (VM)" } output "ssh_connection_string" { value = "ssh ${var.vm_admin_username}@${azurerm_public_ip.vm-public-ip.fqdn}" description = "Useful for connecting to the instance" } output "user_test_conn_string" { value = "mongodb+srv://${local.test_user_username}:${local.test_user_password}@${replace(mongodbatlas_advanced_cluster.this.connection_strings[0].standard_srv, "mongodb+srv://", "")}/?retryWrites=true" sensitive = true description = "Useful for connecting to the database from Compass or other tool to validate data" } output "user_oidc_conn_string" { value = local.mongodb_oidc_uri sensitive = true description = "Useful to see the format of the OIDC connection string" }
ID ์ ๊ณต์์ ๋ํ ํ๋๋ ์ด์ ์ค์ ๊ตฌ์ฑ
๋ค์์ ์ฌ์ฉํ์ฌ Azure ์์ ์ฌ์ฉํ๊ธฐ ์ํด Atlas ์์ OIDC ํ๋๋ ์ด์ ID ์ ๊ณต์ ์ค์ ํ๋ค ํฉ๋๋ค.Azure Active Directory์์ ๋ฐ๊ธํ OIDC ํ ํฐ์ ์ฌ์ฉํ์ฌ ์ก์ธ์ค ํ ์ ์์ต๋๋ค.
# Connection string to use in this configuration locals { mongodb_uri = var.connection_strings[0] } # Atlas organization details to use in the configuration data "mongodbatlas_federated_settings" "this" { org_id = var.org_id name = var.project_name project_id = var.project_id } # Configure an identity provider for federated authentication resource "mongodbatlas_federated_settings_identity_provider" "oidc" { federation_settings_id = data.mongodbatlas_federated_settings.this.id audience = var.token_audience authorization_type = "USER" description = "oidc-for-azure" # e.g. "https://sts.windows.net/91405384-d71e-47f5-92dd-759e272cdc1c/" issuer_uri = "https://sts.windows.net/${azurerm_user_assigned_identity.this.tenant_id}/" idp_type = "WORKLOAD" name = "OIDC-for-azure" protocol = "OIDC" # groups_claim = null user_claim = "sub" } resource "mongodbatlas_federated_settings_org_config" "this" { federation_settings_id = data.mongodbatlas_federated_settings.this.id org_id = var.org_id domain_restriction_enabled = false domain_allow_list = [] data_access_identity_provider_ids = [mongodbatlas_federated_settings_identity_provider.oidc.idp_id] }
๋ค์์ ์ฌ์ฉํ์ฌ OIDC ์ฐํฉ ์ธ์ฆ ์ฌ์ฉ์๋ฅผ ์์ฑํฉ๋๋ค.
resource "mongodbatlas_database_user" "oidc" { project_id = var.project_id username = "${mongodbatlas_federated_settings_identity_provider.oidc.idp_id}/${azurerm_user_assigned_identity.this.principal_id}" oidc_auth_type = "USER" auth_database_name = "$external" # required when using OIDC USER authentication roles { role_name = "atlasAdmin" database_name = "admin" } }
์ฌ์ฉ์ ์ง์ ์ญํ ๊ตฌ์ฑ
๋ค์์ ์ฌ์ฉํ์ฌ ์ด๋ฆ์ด myDb
์ธ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ ๋ชจ๋ ์ปฌ๋ ์
์ ๋ํด ์
๋ฐ์ดํธ, ์ถ๊ฐ ๋ฐ ์ญ์ ์์
์ ํ์ฉํ๋ my_custom_role
(์ด)๋ผ๋ ์ฌ์ฉ์ ์ง์ ์ญํ ๋ง๋ญ๋๋ค.
resource "mongodbatlas_custom_db_role" "create_role" { project_id = var.project_id role_name = "my_custom_role" actions { action = "UPDATE" resources { database_name = "myDb" } } actions { action = "INSERT" resources { database_name = "myDb" } } actions { action = "REMOVE" resources { database_name = "myDb" } } }
ํน์ ๊ทธ๋ฃน์ Atlas ์ญํ ํ ๋น๋ Atlas ํ๋ก์ ํธ์ ์์๋ ์์ ๋ฅผ ์ฐธ์กฐํ์ธ์.