Cloud Provider IP Blocking¶
DjangoAPI Guard can automatically detect and block requests from major cloud providers.
Supported Providers¶
- Amazon Web Services (AWS)
- Google Cloud Platform (GCP)
- Microsoft Azure
Basic Configuration¶
IP Range Updates¶
Cloud IP ranges are refreshed automatically at a configurable interval (default: 1 hour):
GUARD_SECURITY_CONFIG = SecurityConfig(
block_cloud_providers={"AWS", "GCP", "Azure"},
cloud_ip_refresh_interval=1800, # Refresh every 30 minutes
)
You can also manually trigger a refresh:
Provider Status¶
from djangoapi_guard import cloud_handler
for provider in ("AWS", "GCP", "Azure"):
updated = cloud_handler.last_updated[provider]
if updated:
print(f"{provider}: last updated {updated.isoformat()}")