Il nostro sito sta sperimentando un attacco di denial of service, spam, o viene hackerato. Come bloccare gli indirizzi IP nel Apache HTTP Server (AEM Dispatcher)?
La maggior parte dei firewall per applicazioni web (WAF), ad esempio mod security, può essere costituita da elenchi Bloccati di indirizzi IP. Tuttavia, se si esegue Apache HTTP Server e desidera bloccare gli IP seguendo immediatamente questi passaggi(Non applicabile AEM as a Cloud Service):
block-offending-ips.conf
sul serverA. Se la richiesta è proxy (tramite CDN, Load Balancer, ecc.) e l’IP dell’utente remoto si trova solo in un’intestazione come X-Forwarded-For
allora questa configurazione può essere utilizzata. Tieni presente che questa configurazione non si applica se la remoteip_module
è configurato.
LocationMatch "/.*" Order Allow,DenyAllow from allSetEnvif X-Forwarded-For "10\.42\.137\.123" DenyAccessSetEnvif X-Forwarded-For "122\.6\.218\.101" DenyAccess#Repeat the "SetEnvlf X-Forwarded-For ..." for each IP you want to blockDeny from env=DenyAccess /LocationMatch
B. In alternativa, se l'utente remoto accede direttamente Apache o si utilizza remoteip_module
(vedi 1) per estrarlo e impostarlo in Apache quindi puoi utilizzare mod_authz_core
Funzione Richiedi direttamente (Apache 2.4).
LocationMatch "/.*" RequireAllRequire all grantedRequire not ip 10.42.137.123Require not ip 122.6.218.101#Repeat the "Require not ip ..." for each IP you want to block /RequireAll /LocationMatch
1
# Extract true client IP from header added by load balancer/CDN IfModule remoteip_module # valid for ELB or ELB+CloudFront RemoteIPHeader X-Forwarded-For /IfModule |
---|
Rilascia il file block-offending-ips.conf
in /etc/conf.d
cartella Apache Server web.
Riavvia Apache HTTP Server.