본문 바로가기
⚙️백엔드/아파치

아파치 - 클라우드플레어 IP Ranges 화이트리스트 설정

by Janger 2023. 4. 14.
728x90
반응형

 

https://www.cloudflare.com/ko-kr/ips/

 

IP Ranges

This page is intended to be the definitive source of Cloudflare’s current IP ranges.

www.cloudflare.com

위에 클라우드플레어의 IP Ranges 페이지에 들어가 클라우드플레어의 아이피 대역만 아파치 서버에 접속이 가능하도록 설정한다. 

이는 공격자가 클라우드플레어를 거치지 않고 직접 실제 서버 아이피를 알아내서 DDoS 공격의 피해력을 줄이기 위해서다. 

 

 

.htaccess

 

#path to your website
<Directory "/var/www/html">
    #ipv4
    Require ip 173.245.48.0/20
    Require ip 103.21.244.0/22
    Require ip 103.22.200.0/22
    Require ip 103.31.4.0/22
    Require ip 141.101.64.0/18
    Require ip 108.162.192.0/18
    Require ip 190.93.240.0/20
    Require ip 188.114.96.0/20
    Require ip 197.234.240.0/22
    Require ip 198.41.128.0/17
    Require ip 162.158.0.0/15
    Require ip 104.16.0.0/12
    Require ip 172.64.0.0/13
    Require ip 131.0.72.0/22
    #ipv6
    Require ip 2400:cb00::/32
    Require ip 2606:4700::/32
    Require ip 2803:f800::/32
    Require ip 2405:b500::/32
    Require ip 2405:8100::/32
    Require ip 2a06:98c0::/29
    Require ip 2c0f:f248::/32
</Directory>

 

 

https://stackoverflow.com/questions/65448093/allowing-only-cloudflare-i-p-range-through-htaccess-giving-403-error

 

Allowing only cloudflare i.p range through .htaccess giving 403 error

I've been trying to allow only cloudflares i.p ranges on my server but I keep getting 403 errors, 403 is what people bypassing cloudfare should see I have tried #cloudflare order deny,allow...

stackoverflow.com

 

 

 

 

참고: 

https://xetown.com/tips/253152

 

클라우드플레어 사용시 서버 IP 노출 방지 체크리스트

요즘 클라우드플레어를 사용하는 사이트가 부쩍 늘었죠? 서버의 트래픽을 절약해 주기 때문에 사용하시는 분들이 제일 많지만, 공격을 차단해 주고 실제 서버의 IP를 숨겨주기 때문에 사용하시

xetown.com

 

https://xetown.com/questions/415978

 

CloudFlare IP Range는 왜 필요한건지요?

안녕하세요. 또 클플 관련 질문을 올립니다 ㅎㅎ 클플 사이트에 보면 IP Ranges라는게 있는데, 이건 뭐할 때 활용하는 건지 궁금합니다. (https://www.cloudflare.com/ips/) 해당 ip들을 오리진 서버에서 허용

xetown.com

 

728x90
반응형