설명
Web App 배포에 FTP를 쓰지 않으면 site_config.ftps_state를 Disabled로 설정하세요. FTP 게시가 필요하면 FtpsOnly로 제한하세요.
잠재적 영향
AllAllowed에서는 평문 FTP도 허용됩니다. 이 방식으로 파일을 전송하면 게시 자격 증명과 배포 파일이 노출되거나 변조될 수 있습니다.
해결 방법
FtpsOnly를 사용하려면 앱의 최소 인바운드 TLS 버전을 1.2 이상으로 설정하세요. FTPS를 사용하려면 FTP와 SCM의 기본 게시 인증이 모두 허용되어야 합니다. 게시 권한을 제한하고 클라이언트가 서버 인증서를 검증한 뒤 FTPS로 전송하는지 확인하세요. 평문 FTP가 거부되는지도 시험하세요. 다른 배포 방식을 택했다면 그 경로의 인증과 전송 암호화를 확인하세요.
예시
AzureRM 3.x의 azurerm_app_service에서 AllAllowed를 FtpsOnly로 바꾸는 예시입니다. 현재 Linux·Windows Web App도 같은 설정을 지원합니다. 웹 요청의 HTTPS 적용과 사용자 인증은 별도로 구성하세요.
변경 전
hcl
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
site_config {
dotnet_framework_version = "v4.0"
scm_type = "LocalGit"
ftps_state = "AllAllowed"
}
}
변경 후
hcl
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
site_config {
dotnet_framework_version = "v4.0"
scm_type = "LocalGit"
ftps_state = "FtpsOnly"
}
}