AWS

[AWS Client VPN Enpoint] Open VPN ์ด์šฉํ•˜์—ฌ ์™ธ๋ถ€ ๋„คํŠธ์›Œํฌ์—์„œ AWS ํด๋ผ์šฐ๋“œ ๋‚ด๋ถ€ ๋„คํŠธ์›Œํฌ์— ์ ‘๊ทผํ•˜๊ธฐ

์•ˆ๋ƒ์„ธ์šค 2022. 6. 5. 23:42

๐Ÿ™‹‍โ™€๏ธ AWS Client VPN Endpoint๋ž€?

  • ์‚ฌ๋‚ด ๋„คํŠธ์›Œํฌ์˜ AWS ๋ฆฌ์†Œ์Šค ๋ฐ ๋ฆฌ์†Œ์Šค์— ์•ˆ์ „ํ•˜๊ฒŒ ์•ก์„ธ์Šค ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•˜๋Š” ํด๋ผ์ด์–ธํŠธ ๊ธฐ๋ฐ˜ managed VPN ์„œ๋น„์Šค.
  • Client VPN์„ ์‚ฌ์šฉํ•˜๋ฉด OpenVPN ๊ธฐ๋ฐ˜ VPN ํด๋ผ์ด์–ธํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋“  ์œ„์น˜์—์„œ ๋ฆฌ์†Œ์Šค์— ์•ก์„ธ์Šค ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • AWS ์™ธ๋ถ€์—์„œ AWS ํด๋ผ์šฐ๋“œ ๋‚ด๋ถ€ ๋„คํŠธ์›Œํฌ์— ์ ‘๊ทผํ•˜๊ณ ์ž ํ•˜๋Š”๋ฐ Client ์ชฝ VPN ์žฅ๋น„๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ, Client VPN Endpoint๋ฅผ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

 


๐Ÿ”จ To-Be Architecture

AWS Client VPN Endpoint๋ฅผ ์ด์šฉํ•˜์—ฌ ์™ธ๋ถ€์—์„œ ๋‚ด๋ถ€ ๋„คํŠธ์›Œํฌ ์ ‘๊ทผํ•˜๊ธฐ

 

 

1๏ธโƒฃ ์ƒ์„ฑ ์ „ ํ•„์ˆ˜ ์‚ฌ์ „ ์ž‘์—… - ์„œ๋ฒ„ ์ธ์ฆ์„œ ์ƒ์„ฑ ๋ฐ ACM ์—…๋กœ๋“œ

AWS Cloud๋กœ ๋“ค์–ด์˜ค๋Š” ์ฒซ๋ฒˆ์งธ ์ง„์ž…์ ์—์„œ Client ์ธ์ฆ์ด ์‹คํ–‰๋œ๋‹ค. ์ธ์ฆ์— ์„ฑ๊ณตํ•ด์•ผ client๋Š” Client VPN ์—”๋“œํฌ์ธํŠธ๋กœ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ๊ณ  VPN ์„ธ์…˜์ด ๋งบ์–ด์ง„๋‹ค. Client VPN Endpoint๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋ฐ˜๋“œ์‹œ AWS Certificate Manager์— server ์ธ์ฆ์„œ๊ฐ€ ์žˆ์–ด์•ผ ํ•œ๋‹ค.

  • Mutual Authentication
    • client์™€ server ๊ฐ„์˜ ์ธ์ฆ์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” certificate authority (CA)๋กœ๋ถ€ํ„ฐ ๋ฐœํ–‰๋ฐ›์€ ๋””์ง€ํ„ธ ์ฆ๋ช…์„œ์ธ ์ธ์ฆ์„œ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
    • mutual authentication์„ ์œ„ํ•ด์„œ๋Š”,
      1. server ์ธ์ฆ์„œ์™€ ํ‚ค & ํ•˜๋‚˜ ์ด์ƒ์˜ client ์ธ์ฆ์„œ์™€ ํ‚ค๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
        (easy RSA๋ฅผ ์ด์šฉํ•œ ์ธ์ฆ์„œ ์ƒ์„ฑ์„ ์œ„ํ•ด ์ฐธ๊ณ  : AWS Document, ๊ธฐ์ˆ  ๋ธ”๋กœ๊ทธ)
      2. AWS Certificate Manager (ACM)์— server ์ธ์ฆ์„œ์™€ ํ”„๋ผ์ด๋น— ํ‚ค, ๊ทธ๋ฆฌ๊ณ  CA์— ๋Œ€ํ•ด ์—…๋กœ๋“œํ•ด์•ผ ํ•œ๋‹ค.

ACM์— ์ธ์ฆ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ


2๏ธโƒฃ Client VPN Endpoint ์ƒ์„ฑํ•˜๊ธฐ

1. Client๊ฐ€ ํ• ๋‹นํ•  CIDR ๋ฒ”์œ„ ์„ ์ •

  • ์—ฐ๊ฒฐํ•  VPC์˜ CIDR ๋ฐ VPC์— ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š” ๋‹ค๋ฅธ ๋„คํŠธ์›Œํฌ ๋ฒ”์œ„์™€ ์ค‘๋ณต๋˜์–ด์„œ๋Š” ์•ˆ ๋œ๋‹ค.
  • /22 ~ /12 ์‚ฌ์ด์˜ ๋ฒ”์œ„๋กœ CIDR ์„ ์ • ๊ฐ€๋Šฅ. (ex: 10.0.0.0/22)
  • Client VPN ์—”๋“œํฌ์ธํŠธ๋ฅผ ์ƒ์„ฑํ•œ ํ›„์—๋Š” ํด๋ผ์ด์–ธํŠธ ์ฃผ์†Œ ๋ฒ”์œ„๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†๋‹ค.

2. ์ธ์ฆ ๋ฐฉ์‹ ์„ ํƒ

AWS CVPNE ์ƒ์„ฑ-์ธ์ฆ ์ •๋ณด ์„ ํƒ

  • ์„œ๋ฒ„ & ํด๋ผ์ด์–ธํŠธ ์ธ์ฆ์„œ ARN : ๋ชจ๋‘ ์‚ฌ์ „์— ACM์— import ํ–ˆ๋˜ ์ธ์ฆ์„œ๋ฅผ ์ž…๋ ฅํ•œ๋‹ค.
  • ์ธ์ฆ ์˜ต์…˜ : mutual authentication ์„ ํƒ

3. (์„ ํƒ) Connection Logging ํ™œ์„ฑํ™”

AWS CVPNE ์ƒ์„ฑ-์—ฐ๊ฒฐ ๋กœ๊น… ํ™œ์„ฑํ™”

  • Client VPN Endpoint์˜ ์—ฐ๊ฒฐ ๋กœ๊ทธ๋ฅผ ๊ธฐ๋กํ•œ๋‹ค.
  • ๋กœ๊น…์„ ์œ„ํ•ด์„œ๋Š” ํ•ด๋‹น ๊ณ„์ •์— CloudWatch Logs์— ์—ฐ๊ฒฐ๋กœ๊ทธ๋ฅผ ๊ธฐ๋กํ•  ๋กœ๊ทธ ๊ทธ๋ฃน์ด ์ƒ์„ฑ๋˜์–ด ์žˆ์–ด์•ผ ํ•œ๋‹ค.

4. (์„ ํƒ) Other Parameters

AWS CVPNE ์ƒ์„ฑ-๊ทธ ์™ธ ํŒŒ๋ผ๋ฏธํ„ฐ ์„ค์ •

  • ์ „์†ก ํ”„๋กœํ† ์ฝœ : UDP(default)
  • split-tunnel ํ™œ์„ฑํ™” : ํ™œ์„ฑํ™”(์ฐธ๊ณ : Split-tunnel on AWS Client VPN endpoints)
  • VPN ID : Client VPN Endpoint ์ƒ์„ฑ ์‹œ, VPC๋ฅผ ๋ช…์‹œํ•˜๋ฉด ํ•ด๋‹น VPC ๋‚ด์˜ Subnet๋“ค๊ณผ๋งŒ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ๋ช…์‹œํ•˜์ง€ ์•Š์œผ๋ฉด ๋ชจ๋“  VPC์™€ ์—ฐ๊ฒฐ ๊ฐ€๋Šฅํ•˜๋‹ค.

5. ์ƒ์„ฑ ์™„๋ฃŒํ•˜์˜€์œผ๋‚˜ Pending-associate ์ƒํƒœ(๊ตฌ์„ฑ ๋ฏธ์™„๋ฃŒ)

AWS CVPNE ์ƒ์„ฑ-Pending-associate ์ƒํƒœ

5-1. Target Network Association

AWS CVPNE ๊ตฌ์„ฑ-Target Network Association(1)

  • ์—ฐ๊ฒฐํ•  VPC ๋ฐ Subnet์„ ์„ ํƒํ•œ๋‹ค.

AWS CVPNE ๊ตฌ์„ฑ-Target Network Association(2)

5-2. Route Table

AWS CVPNE ๊ตฌ์„ฑ-Route Table

  • 5-1์˜ ์ž‘์—…๊นŒ์ง€ ์™„๋ฃŒ๋˜๋ฉด ์ƒ์„ฑํ•œ Client VPN ์—”๋“œํฌ์ธํŠธ์˜ ๋ผ์šฐํŒ… ํ…Œ์ด๋ธ”์— ์œ„์™€ ๊ฐ™์ด ๋ผ์šฐํŒ…์ด ํ™œ์„ฑํ™”๋œ๋‹ค.

5-3. Authorization rules

AWS CVPNE ๊ตฌ์„ฑ-Authorization rules

  • Client VPN Endpoint๋กœ ์ ‘๊ทผ์„ ํ—ˆ์šฉํ•  ๋„คํŠธ์›Œํฌ ๋Œ€์—ญ์„ ๋ช…์‹œํ•œ๋‹ค. ๋ฐฉํ™”๋ฒฝ์ฒ˜๋Ÿผ ์ž‘๋™ํ•œ๋‹ค.

6. AWS Client VPN Endpoint ๊ตฌ์„ฑ ์™„๋ฃŒ~!

AWS CVPNE ์ƒ์„ฑ-Available ์ƒํƒœ


3๏ธโƒฃ Client์—์„œ VPN Endpoint ์ ‘์†ํ•˜๊ธฐ

1. Client Configuration ํŒŒ์ผ(downloaded-client-config.ovpn)์„ ๋‹ค์šด๋กœ๋“œ

Client ๊ตฌ์„ฑ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ

2. downloaded-client-config.ovpn ํŽธ์ง‘

Client ๊ตฌ์„ฑ ํŒŒ์ผ ํŽธ์ง‘

  • <ca></ca> ํƒœ๊ทธ ์•„๋ž˜, <cert> ํƒœ๊ทธ์™€ <key> ํƒœ๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.
  • <cert> : ํด๋ผ์ด์–ธํŠธ ์ธ์ฆ์„œ
  • <key> : ํด๋ผ์ด์–ธํŠธ ํ”„๋ผ์ด๋น— ํ‚ค

3. Client์—์„œ Open VPN ์‹คํ–‰

  • 2์—์„œ ํŽธ์ง‘ํ•œ download-client-config.ovpn ํŒŒ์ผ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ
  • VPN ์—ฐ๊ฒฐ ํ›„ AWS์— ์œ„์น˜ํ•œ ์„œ๋ฒ„ ์‚ฌ์„ค IP๋ฅผ ํ†ตํ•ด ์ ‘์†์ด ๋˜๋Š”์ง€ ํ™•์ธ → ์„ฑ๊ณต~!

 


๐Ÿ”— ์ฐธ๊ณ  ๋งํฌ

  1. ๐ŸŒŸ[AWS] Client VPN ์„ค์ •๐ŸŒŸ
  2. https://musma.github.io/2019/11/04/aws-client-vpn-endpoint.html
  3. AWS Client VPN์ด๋ž€ ๋ฌด์—‡์ž…๋‹ˆ๊นŒ?
  4. Client VPN ์—”๋“œํฌ์ธํŠธ
  5. Client Authentication
  6. mutual authentication
  7. Split-tunnel on AWS Client VPN endpoints