Azure SQL Database 위협 탐지 설정 점검

감사 기록과 별도로 필요한 위협 탐지를 활성화하세요.

설명

데이터베이스의 위협 탐지는 의심스러운 로그인 등 이상 활동을 알립니다. 감사 정책은 조사에 쓸 기록을 저장하며, 감사 로그만 저장해도 위협 탐지가 켜지는 것은 아닙니다.

잠재적 영향

해당 데이터베이스가 Defender for SQL로 보호되지 않으면 이상 활동에 대한 경고를 놓칠 수 있습니다.

해결 방법

threat_detection_policy의 state를 Enabled로 설정하고 Defender for SQL이 대상 데이터베이스를 보호하는지 확인하세요. 테스트 알림을 이용할 수 있다면 담당자에게 도착하는지 확인하고, 감사 대상으로 선택한 작업의 기록은 별도로 저장소에서 확인하세요.

예시

두 예시 모두 Blob Storage에 데이터베이스 감사 로그를 6일간 보존합니다. 두 번째에서 달라지는 값은 위협 탐지 상태입니다. 조사에 필요한 기간에 맞게 로그를 보존하세요.

변경 전

hcl
resource "azurerm_mssql_database" "example" {
  name                = "myexamplesqldatabase"
  server_id           = azurerm_mssql_server.example.id

  threat_detection_policy {
    state = "Disabled"
  }

}

resource "azurerm_mssql_database_extended_auditing_policy" "example" {
  database_id = azurerm_mssql_database.example.id
  blob_storage_endpoint                        = azurerm_storage_account.example.primary_blob_endpoint
  storage_account_access_key              = azurerm_storage_account.example.primary_access_key
  storage_account_access_key_is_secondary = false
  retention_in_days                       = 6
}

변경 후

hcl
resource "azurerm_mssql_database" "example" {
  name                = "myexamplesqldatabase"
  server_id           = azurerm_mssql_server.example.id

  threat_detection_policy {
    state = "Enabled"
  }

}

resource "azurerm_mssql_database_extended_auditing_policy" "example" {
  database_id = azurerm_mssql_database.example.id
  blob_storage_endpoint                        = azurerm_storage_account.example.primary_blob_endpoint
  storage_account_access_key              = azurerm_storage_account.example.primary_access_key
  storage_account_access_key_is_secondary = false
  retention_in_days                       = 6
}

참조