관리 메뉴

진취적 삶

섹션 24 : AWS 모니터링 및 감사 :cloudWatch , CloudTrail 및 Config 본문

AWS SAA

섹션 24 : AWS 모니터링 및 감사 :cloudWatch , CloudTrail 및 Config

hp0724 2023. 7. 16. 14:16

cloudwatch Metrics

모든 서비스에 대한 지표를 알수 있다.

cloudWatch Logs

로그를 저장하는 최고의 장소

  • Log groups : usualyy representing an application
  • Log stream : instances within application

CloudWatch Logs Agent & Unified Agent

  • CloudWatch Logs Agent
    • old version of the agent
    • can only send to CloudWatch logs
  • CloudWatch Unified Agent
    • collect additional system-level metrics suha as RAM,processes ,etc
    • collect logs to send to CloudWatch Logs

기본 ec2 모니터링 의 경우 네트워크에 대한 지표를 얻을수 있지만

세부 지표를 얻고 싶을 경우 cloudwatch 에이전트를 이용하면 된다.

CloudWatch Alarms

지표에서 알림을 트리거할때 사용한다.

alarm targets

  1. ec2 인스턴스 동작
  2. auto scaling 동작
  3. SNS 서비스

Amazon EventBridge

  • Schedule : Cron jobs
  • Event Pattern : 특정 작업을 수행하는 서비스에 반응하는 이벤트 규칙이 있다.

cloudWatch Container Insights

컨테니어로부터 지표와 로그를 손쉽게 추출해서 cloudWatch 에 세분화된 대시보드를 만들수 있다.

cloudWatch Contributor insights

vpc flow logs → cloudwatch logs → cloudwatch contributor insights → top 10 IP addresses

cloudWatch application insights

automatic dashboard to troubleshoot your application and related AWS services

CloudTrail

aws 계정의 거버너스 ,감사 및 규정 준수를 돕는다.

aws 인프라 간의 작업과 관련된 계정 활동을 로그하고 지속적인 모니터링 및 유지를 가능하게 해준다.

cloudTrail은 계정 활동 내역을 제공해 준다

90일 지난 API 활동을 확인하고 싶은경우 Athena를 사용해 s3 버킷 내에 저장된 cloudTrail 로그 분석

CloudTrail insights

이벤트를 분석해서 계정 내의 특이한 활동을 탐지해 준다

관리 이벤트를 지속적으로 분석해서 뭔가를 탐지하면 인사이트 이벤트를 생성한다.

  • 서비스 한도 도달
  • aws IAM 작업 버스트
  • 주기적 유지 관리 작업 부재

Amazon EventBridge - Intercept API Calls

user (deleteTable API call) → DynamoDB → cloudTrail → amazon eventBridge → SNS

AWS Config

aws 내 리소스에 대한 감사와 규정 준수 여부를 기록할수 있게 해주는 서비스

보안 그룹을 올바른 상태로 자동으로 재구성

aws config 가 해결할수 있는 문제

  • is there unrestricted SSH access to my security groups?
  • do my buckets have any public access?
  • how has my ALB configuration changed over time?

cloudWatch vs CloudTrail vs Config

  • cloudwatch
    • performance monitoring & dashboards
    • events & alerting
    • log aggregation & analysis
  • cloudTrail
    • record API calls made within your account by everyone
    • can define trails for specific resources
  • config
    • record configuration changes
    • evaluate resources against compliance rules
    • get timeline of changes and compliance