Many organizations face legitimate needs to restrict cloud storage access - whether for compliance (HIPAA/GDPR), IP protection, or bandwidth management. While blanket HTTPS blocking works technically, it's the nuclear option that breaks modern web functionality. Let's explore surgical alternatives.
Basic but effective first line of defense:
# Example iptables rule blocking major cloud providers
iptables -A OUTPUT -p tcp -m set --match-set cloud_providers dst -j DROP
# Cloudflare gateway example DNS policy
{
"policies": [
{
"name": "BlockCloudStorage",
"domains": ["*.dropbox.com","*.googleapis.com","*.onedrive.live.com"],
"action": "block"
}
]
}
Limitation: Easy to bypass with personal hotspots or alternative DNS.
For HTTPS filtering, you'll need:
- Enterprise firewall (Palo Alto, FortiGate)
- SSL decryption certificates deployed to endpoints
- CA certificate installed on all devices
# Squid proxy config snippet for HTTPS inspection
ssl_bump server-first all
sslproxy_cert_error allow all
sslproxy_flags DONT_VERIFY_PEER
Combine network controls with endpoint DLP solutions:
// PowerShell to detect running cloud sync clients
Get-Process | Where-Object {
$_.ProcessName -match "dropbox|googledrivesync|onedrive"
} | Stop-Process -Force
# macOS MDM profile example
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.apple.applicationaccess</string>
<key>allowCloudDocumentSync</key>
<false/>
</dict>
</array>
</dict>
Instead of blocking, implement granular controls:
# Sample OPA (Open Policy Agent) rule
package cloudstorage
default allow = false
allow {
input.user.department == "Engineering"
input.request.host == "s3.amazonaws.com"
input.request.method == "GET"
}
Supplement blocks with traffic analysis:
# Zeek script to detect cloud uploads
event file_transferred(c: connection, prefix: string, descr: string, mime_type: string)
{
if (c$id$resp_h in cloud_provider_ips && c$id$resp_p == 443) {
NOTICE([$note=Cloud_Upload,
$msg=fmt("Cloud upload detected: %s", mime_type)]);
}
}
In enterprise environments, uncontrolled access to public cloud services (Dropbox, Google Drive, etc.) poses significant data exfiltration risks. While HTTPS encryption makes traditional filtering challenging, several technical solutions exist.
The most effective approach involves deploying a transparent proxy with SSL inspection capabilities. Here's a basic Python example using mitmproxy:
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
if "dropbox.com" in flow.request.pretty_host:
flow.response = http.Response.make(
403,
b"Cloud storage blocked by corporate policy",
{"Content-Type": "text/html"}
)
For simpler implementations, DNS filtering can block known cloud domains:
# /etc/pihole/custom.list
0.0.0.0 dropbox.com
0.0.0.0 drive.google.com
0.0.0.0 onedrive.live.com
Modern firewalls like pfSense can perform TLS SNI filtering:
# pfSense CLI commands
set system webgui certcreate
set system webgui certcreate_authority
set system webgui certcreate_authority_method imported
For Windows environments, Group Policy can disable cloud storage providers:
# registry modification
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
"DisablePerUserFileHistory"=dword:00000001
Combine blocking with network monitoring using tools like Zeek:
module HTTP;
redef HTTP::log_uri = T;
event http_request(c: connection, method: string, uri: string)
{
if (/cloud-storage|dropbox|drive/.test(uri)) {
print fmt("Cloud upload attempt: %s", c$id$orig_h);
}
}