[AWS GuardDuty] ์—ฌ๋Ÿฌ ๊ณ„์ •์˜ AWS GuardDuty ๊ด€๋ฆฌํ•˜๊ธฐ(+S3 Logging)

2022. 9. 19. 00:29ใ†AWS

AWS Docs: Managing multiple accounts in Amazon GuardDuty๋ฅผ ์ฝ๊ณ  ์ •๋ฆฌํ•œ ๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ž‘์„ฑํ•œ ํฌ์ŠคํŒ…์ž…๋‹ˆ๋‹ค.
์ž‘์„ฑ ๋‚ ์งœ : 22-09-18

 

AWS GuardDuty

๐ŸŸฉ GuardDuty๋ž€?

๋ณด์•ˆ ๋ชจ๋‹ˆํ„ฐ๋ง ์„œ๋น„์Šค. ์•„๋ž˜๋Š” GuardDuty๊ฐ€ ๋ชจ๋‹ˆํ„ฐ๋ง ๊ฐ€๋Šฅํ•œ AWS ๋ฆฌ์†Œ์Šค์ด๋‹ค.

  • S3 logs์— ์Œ“์ด๋Š” CloudTrail ์ด๋ฒคํŠธ
  • CloudTrail ๊ด€๋ฆฌ ์ด๋ฒคํŠธ ๋กœ๊ทธ
  • DNS ๋กœ๊ทธ
  • EBS ๋ณผ๋ฅจ ๋ฐ์ดํ„ฐ
  • EKS audit log
  • VPC flow log

AWS GuardDuty๋Š” ์•…์˜์ ์ธ IP์™€ ๋„๋ฉ”์ธ ๋ฆฌ์ŠคํŠธ์™€ ๊ฐ™์€ ์œ„ํ˜‘ ์ธํ…”๋ฆฌ์ „์Šค ํ”ผ๋“œ์™€ AWS ํ™˜๊ฒฝ ๋‚ด ์˜ˆ์ธกํ•˜์ง€ ๋ชปํ•˜๊ณ  ์ธ์ฆ๋˜์ง€ ์•Š์€ ์•…์˜์ ์ธ ํ™œ๋™์„ ์‹๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด ๋จธ์‹ ๋Ÿฌ๋‹์„ ์ด์šฉํ•œ๋‹ค.

ex) GuardDuty๋Š” ๋ฉ€์›จ์–ด๋ฅผ ์„œ๋น„์Šคํ•˜๊ฑฐ๋‚˜ ๋น„ํŠธ์ฝ”์ธ์„ ์ฑ„๊ตดํ•˜๋Š” ec2 ์ธ์Šคํ„ด์Šค๋‚˜ ์ปจํ…Œ์ด๋„ˆ ์›Œํฌ๋กœ๋“œ๋ฅผ ํƒ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค.


๐ŸŸฉ ์—ฌ๋Ÿฌ ๊ณ„์ •์˜ AWS GuardDuty ๊ด€๋ฆฌํ•˜๊ธฐ

Amazon Gurdduty์—์„œ ๋‹ค์ˆ˜์˜ ๊ณ„์ •์„ ๊ด€๋ฆฌํ•˜๋ ค๋ฉด GuardDuty Administrator ๊ณ„์ •์œผ๋กœ ํ•œ AWS Account๋ฅผ ์„ ํƒํ•ด์•ผ๋งŒ ํ•œ๋‹ค. ์ด GuardDuty Administrator ๊ณ„์ •์— ๋ฉค๋ฒ„ ๊ณ„์ •์œผ๋กœ ๋‹ค๋ฅธ ๊ณ„์ •์„ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฐฉ๋ฒ•์€ ๋‘ ๊ฐ€์ง€์ด๋‹ค.

  1. ๊ฐ™์€ AWS Organizations์— ์†ํ•œ ๊ฒฝ์šฐ AWS Organizations์„ ํ†ตํ•ด ๊ณ„์ • ์—ฐ๊ฒฐ (AWS recommend)
  2. GuardDuty๋ฅผ ํ†ตํ•ด ์ดˆ๋Œ€

GuardDuty Administrator ๊ณ„์ •์€ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ฉค๋ฒ„ ๊ณ„์ •์„ ๊ด€๋ฆฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ๋‹ค.

  • ์—ฐ๊ฒฐ๋œ ๋ฉค๋ฒ„ ๊ณ„์ •์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์ œ๊ฑฐํ•  ์ˆ˜ ์žˆ๋‹ค. ํ”„๋กœ์„ธ์Šค๋Š” ์ดˆ๋Œ€์ธ์ง€ ๋˜๋Š” organization์„ ํ†ตํ•œ ์—ฐ๊ฒฐ์ธ์ง€์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง„๋‹ค.
  • GuardDuty๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ณ  ์ค‘์ง€ํ•˜๋Š” ๊ฒƒ์„ ํฌํ•จํ•˜์—ฌ ์—ฐ๊ฒฐ๋œ ๋ฉค๋ฒ„ ๊ณ„์ •์˜ GuardDuty ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค.
    • AWS Organizations์œผ๋กœ๋ถ€ํ„ฐ ์œ„์ž„๋œ ๊ด€๋ฆฌ์ž ๊ณ„์ •(1๋ฒˆ ๋ฐฉ๋ฒ•์œผ๋กœ ๊ณ„์ • ์—ฐ๊ฒฐํ•œ ๊ฒฝ์šฐ)์€ ์ž๋™์œผ๋กœ ๋ฉค๋ฒ„๋กœ ์ถ”๊ฐ€๋œ ๊ณ„์ •์—์„œ GuardDuty๋ฅผ ํ™œ์„ฑํ™”ํ•œ๋‹ค.
  • ์ค‘์ง€ ๊ทœ์น™, ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” IP ๋ชฉ๋ก, threat list๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์„ ํ†ตํ•ด GuardDuty network ๋‚ด์—์„œ ๊ฒฐ๊ณผ๋ฅผ ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‹ค์ค‘ account ํ™˜๊ฒฝ์—์„œ ๋ฉค๋ฒ„ ๊ณ„์ •์€ ์ด๋Ÿฐ ๊ธฐ๋Šฅ์ด ์ œํ•œ๋œ๋‹ค.

๋ฐฉ๋ฒ• 1. AWS Organizations๋ฅผ ์ด์šฉํ•˜์—ฌ ๋‹ค์ˆ˜์˜ GuardDuty Accont ๊ด€๋ฆฌํ•˜๊ธฐ

  • Organization management ๊ณ„์ •์ด GurdDuty์˜ ์œ„์ž„๋ฐ›์€ ๊ด€๋ฆฌ์ž๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • Organizaion management ๊ณ„์ •์œผ๋กœ๋ถ€ํ„ฐ GuardDuty ๊ด€๋ฆฌ์ž๋กœ ์œ„์ž„๋ฐ›์€ ๊ณ„์ •์€ GuardDuty Administrator Account๊ฐ€ ๋œ๋‹ค.

1-1. ๊ณ ๋ ค์‚ฌํ•ญ

  1. ์œ„์ž„๋ฐ›์€ administrator๋Š” ์ตœ๋Œ€ 5000๊ฐœ์˜ ๋ฉค๋ฒ„ ๊ณ„์ •์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค.
  2. ์œ„์ž„๋ฐ›์€ administrator๋Š” ์ง€์—ญ์— ๊ท€์†ํ•œ๋‹ค.
    • GuardDuty๋Š” Regional Service์ด๋‹ค. (Organizations๋Š” global service)
    • ๋”ฐ๋ผ์„œ ์œ„์ž„๋ฐ›์€ administrator๋Š” ๋ณธ์ธ์ด ์†ํ•œ region์˜ member account๋งŒ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค.
  3. Organization์€ ํ•˜๋‚˜์˜ ์œ„์ž„๋ฐ›์€ administrator๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋‹ค.
  4. ์œ„์ž„๋ฐ›์€ administrator์„ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ์€ member account์˜ GuardDuty๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜์ง€ ์•Š๋Š”๋‹ค.
    • ์œ„์ž„๋ฐ›์€ administrator๋ฅผ ์ œ๊ฑฐํ•˜๋ฉด, ๋ชจ๋“  ์—ฐ๊ด€๋œ member accounts๋Š” GuardDuty member๋กœ ์ œ๊ฑฐ๋˜์ง€๋งŒ ๊ฐ ๊ณ„์ •์—์„œ GuardDuty๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜์ง€๋Š” ์•Š๋Š”๋‹ค.

๋ฐฉ๋ฒ• 2. ์ดˆ๋Œ€๋ฅผ ํ†ตํ•ด ๋‹ค์ˆ˜์˜ GuardDuty Accont ๊ด€๋ฆฌํ•˜๊ธฐ

[GuardDuty Administrator ๊ณ„์ •] AWS GuardDuty Console > Settings > Accounts

  • ์—ฐ๊ฒฐํ•˜๊ณ ์ž ํ•˜๋Š” ๊ณ„์ •์ด AWS Organization์— ์†ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ GuardDuty์—์„œ Administrator account๋ฅผ specifyํ•˜๊ณ  ๊ทธ administrator ๊ณ„์ •์„ ์ด์šฉํ•˜์—ฌ ๋‹ค๋ฅธ AWS ๊ณ„์ •์„ ๋ฉค๋ฒ„ ๊ณ„์ •์œผ๋กœ ์ดˆ๋Œ€ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ดˆ๋Œ€๊ฐ€ ์Šน๋‚™๋˜๋ฉด ๊ทธ ๊ณ„์ •์€ GuardDuty administrator ๊ณ„์ •์— ์—ฐ๊ฒฐ๋œ ๋ฉค๋ฒ„ ๊ณ„์ •์ด ๋œ๋‹ค.
  • ์—ฐ๊ฒฐํ•˜๊ณ ์ž ํ•˜๋Š” ๊ณ„์ •์ด AWS Organization์— ์†ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ์ดˆ๋Œ€ ๋ฐฉ๋ฒ•์„ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.
  • AWS Account๋Š” GuardDuty administrator ๊ณ„์ •์ด๋ฉด์„œ ๋™์‹œ์— member ๊ณ„์ •์ผ ์ˆ˜ ์—†๋‹ค.
  • ์ดˆ๋Œ€๋กœ ์ธํ•ด ์—ฐ๊ฒฐ๋˜๋Š” administrator ๊ณ„์ •๊ณผ member ๊ณ„์ • ๊ฐ„์˜ ๊ด€๊ณ„๋Š” Organization ๋‚ด์—์„œ ์œ„์ž„๋ฐ›์€ administrator ๊ณ„์ •๊ณผ member ๊ณ„์ • ๊ฐ„์˜ ๊ด€๊ณ„์™€ ๊ฐ™๋‹ค. ํ•˜์ง€๋งŒ ์ดˆ๋Œ€์— ์˜ํ•œ administrator ๊ณ„์ •์˜ ์œ ์ €๋Š” member ๊ณ„์ •์„ ๋Œ€์‹ ํ•˜์—ฌ GuardDuty๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ฑฐ๋‚˜ Organiztaions์— ์†ํ•œ ๋‹ค๋ฅธ member๊ฐ€ ์•„๋‹Œ ๊ณ„์ •์„ ๋ณด์ง€ ๋ชปํ•œ๋‹ค.

2-1. AWS GuardDuty Console์—์„œ ๋‹ค๋ฅธ Account ์ดˆ๋Œ€ํ•˜๊ธฐ

1) AWS GuardDuty Console > Settings > Accounts > ์ขŒ์ธก ์ƒ๋‹จ์˜ [Add accounts] ๋ฒ„ํŠผ ํด๋ฆญ

AWS GuardDuty Console > Settings > Accounts

2) ์ถ”๊ฐ€ํ•œ ๊ณ„์ •์„ ์„ ํƒํ•˜๊ณ  ์ขŒ์ธก ์ƒ๋‹จ์˜ ์ž‘์—…(Actions) > ์ดˆ๋Œ€(Invite) ํด๋ฆญ

3) ์ดˆ๋Œ€ํ•œ ๋ฉค๋ฒ„ ๊ณ„์ •์œผ๋กœ ์ ‘์†ํ•˜์—ฌ, ์ดˆ๋Œ€ ์ˆ˜๋ฝ

2-2. ์ฃผ์˜ํ•  ์  โš ๏ธ

์ดˆ๋Œ€๋กœ ์ธํ•ด GuardDuty๊ฐ€ ๋ฉค๋ฒ„ ๊ณ„์ •์„ ๋งŒ๋“ค ๋•Œ cross-regional ๋ฐ์ดํ„ฐ ์ „์†ก์ด ๋ฐœ์ƒ๋œ๋‹ค. ๋ฉค๋ฒ„ ๊ณ„์ •์˜ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ์ธ์ฆํ•˜๊ธฐ ์œ„ํ•ด GuardDuty๊ฐ€ US East(N. Virginia)์—์„œ ์ด๋ฉ”์ผ ์ธ์ฆ ์„œ๋น„์Šค๋ฅผ ์ˆ˜ํ–‰ํ•œ๋‹ค.


๐ŸŸฉ ์—ฌ๋Ÿฌ ๊ณ„์ •์˜ GuardDuty findings๋ฅผ S3์— ๋กœ๊น…ํ•˜๊ธฐ

GuardDuty๋Š” findings๋ฅผ CloudWatch Events ๋ฐ AWS S3 ๋ฒ„ํ‚ท์œผ๋กœ exportํ•  ์ˆ˜ ์žˆ๋‹ค. GuardDuty๊ฐ€ ์ƒ์„ฑํ•˜๋Š” ์‹ ๊ทœ findings๋Š” ์ƒ์„ฑ๋œ ํ›„ ์•ฝ 5๋ถ„ ์ด๋‚ด์— ์ž๋™์œผ๋กœ ๋ณด๋‚ด์งˆ ์ˆ˜ ์žˆ๋‹ค. findings์— ๋Œ€ํ•œ ์—…๋ฐ์ดํŠธ๋ฅผ CloudWatch ์ด๋ฒคํŠธ๋กœ export ํ•˜๋Š” ๋นˆ๋„๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

์œ„ ๊ธฐ๋Šฅ์„ ์ด์šฉํ•˜์—ฌ S3์— findings๋ฅผ ์ž๋™์œผ๋กœ exportํ•˜๋Š” ๊ฒฝ์šฐ, S3 ๋ฒ„ํ‚ท ๋ฐ ๋™์ผํ•œ ๋ฆฌ์ „์— KMS ํ‚ค๊ฐ€ ํ•„์š”ํ•˜๋‹ค.

 

[AWS Kinesis Data Firehose] Cross-Account ํ™˜๊ฒฝ์—์„œ ๋‹ค๋ฅธ ๊ณ„์ •์˜ S3 Bucket์— ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐํ•˜๊ธฐ

โ˜„๏ธ To-Be Architecture Cross-Account ํ™˜๊ฒฝ์—์„œ Firehose Data Stream์„ ์ด์šฉํ•˜์—ฌ S3 ๋ฒ„ํ‚ท์— ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ง์ ‘ ์ „์†ก(Direct PUT) ๋ฐ ์ €์žฅํ•ด๋ณด์ž. ๐Ÿ’ก Amazon Kinesis Data Firehose๋ž€? ์•„๋ž˜์˜ ๋ชฉ์ ์ง€๋กœ..

hyeon-joo.tistory.com

์—ฌ๋Ÿฌ ๊ณ„์ •์„ ํ†ตํ•ฉํ•˜๋Š” GuardDuty Administrator ๊ณ„์ •์—์„œ ๋กœ๊น…์„ ์„ค์ •ํ•˜๋ฉด Member ๊ณ„์ •์˜ findings๋„ ํ•จ๊ป˜ ๋กœ๊น…๋œ๋‹ค.

์‹ค์‹œ๊ฐ„ GuardDuty ๋กœ๊น…์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ, GuardDuty Administrator Account ๊ณ„์ •์—์„œ Kinesis Data Firehose๋ฅผ ์ด์šฉํ•˜์—ฌ S3์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋‹ค. (์ฐธ๊ณ : [AWS Kinesis Data Firehose] Cross-Account ํ™˜๊ฒฝ์—์„œ ๋‹ค๋ฅธ ๊ณ„์ •์˜ S3 Bucket์— ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐ ํ•˜๊ธฐ) ์ด ๊ฒฝ์šฐ, EventBridge๋ฅผ ํ†ตํ•ด GuardDuty์— ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด Kinesis Data Firehose Delivery Stream์„ trigger ํ•˜๋„๋ก ํ•˜๋Š” ์ถ”๊ฐ€ ๊ตฌ์„ฑ์ด ํ•„์š”ํ•˜๋‹ค.

 

 


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

  1. AWS Docs: Managing multiple accounts in Amazon GuardDuty
  2. AWS Docs: Exporting findings
  3. ๊ธฐ์ˆ  ๋ธ”๋กœ๊ทธ: [AWS Kinesis Data Firehose] Cross-Account ํ™˜๊ฒฝ์—์„œ ๋‹ค๋ฅธ ๊ณ„์ •์˜ S3 Bucket์— ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐ ํ•˜๊ธฐ