← 가이드

IIS 보안 조치 가이드

Windows IIS 에서 TLS 프로토콜 제한(Schannel), 보안 헤더, HTTPS 리다이렉트를 적용하는 단계별 절차

0단계 — 서버 확인 (모든 조치 공통)

① 서버 접속 — RDP 접속, 관리자 권한 PowerShell 사용.

② 버전 확인

Get-ItemProperty HKLM:\SOFTWARE\Microsoft\InetStp\ | Select-Object VersionString
[System.Environment]::OSVersion.Version    # Windows Server 버전

③ 사이트·바인딩·인증서 확인

Get-Website | Select-Object Name, State
Get-WebBinding -Protocol https | Select-Object bindingInformation, certificateHash

TLS 1.0/1.1 비활성

Server 2019 이하 — Schannel 레지스트리:

foreach ($v in "TLS 1.0","TLS 1.1") {
  $p = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$v\Server"
  New-Item -Path $p -Force | Out-Null
  Set-ItemProperty -Path $p -Name Enabled -Value 0 -Type DWord   # 0 = Disabled
}

TLS 1.3 — MS 공식: “Windows 11 및 Windows Server 2022 부터 지원. 그 이전 버전에서 TLS 1.3 활성화는 안전한 구성이 아님”. Server 2019 이하에서는 1.2 까지가 목표다.

보안 헤더

IIS 관리자 GUI: 사이트 → HTTP 응답 헤더 → 추가. 또는 사이트 루트 web.config:

<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains" />
        <add name="X-Content-Type-Options" value="nosniff" />
        <add name="X-Frame-Options" value="SAMEORIGIN" />
        <add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

web.config 저장 즉시 적용 — 재시작 불필요.

HTTP → HTTPS 리다이렉트

URL Rewrite 모듈 설치 후 web.config 에:

<rewrite>
  <rules>
    <rule name="https-redirect" stopProcessing="true">
      <match url="(.*)" />
      <conditions><add input="{HTTPS}" pattern="off" /></conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>

인증서 교체 (약한 키·서명)

Apache·IIS 인증서 교체 절차의 IIS 절 참조 — 저장소 임포트 + 바인딩 교체 2단계.

신규 도메인 인증서 설치

발급·파일 준비는 발급 공통 가이드 먼저 — IIS 는 PFX 필요.

① 저장소 임포트:

$pw = Read-Host -AsSecureString
Import-PfxCertificate -FilePath .\새도메인.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $pw

Cert:\LocalMachine\My(컴퓨터 계정)가 맞다 — CurrentUser 에 넣으면 IIS 가 못 본다.

② 사이트 바인딩 추가 — IIS 관리자 → 사이트 → 바인딩 → 추가: https / 443 / 호스트 이름 새도메인 / SNI 필요 체크 / 인증서 선택. PowerShell:

New-WebBinding -Name "사이트명" -Protocol https -Port 443 -HostHeader "새도메인" -SslFlags 1
$cert = Get-ChildItem Cert:\LocalMachine\My | Where-Object Subject -match "새도메인"
(Get-WebBinding -Name "사이트명" -Protocol https -HostHeader "새도메인").AddSslCertificate($cert.Thumbprint, "My")

바인딩 추가는 재시작 불필요 — 즉시 적용.

③ 확인 — 진단 툴. PFX 에 체인 미포함이면 체인 오류가 난다 — 교체 절차 글 의 IIS 절 참조.

최종 확인

진단 툴로 재검사 (캐시 최대 10분).

참조 문서 (공식)