@@ -12,7 +12,7 @@ iptables -t nat -F
1212iptables -t nat -X
1313iptables -t mangle -F
1414iptables -t mangle -X
15- ipset destroy github-anthropic 2> /dev/null || true
15+ ipset destroy general 2> /dev/null || true
1616ipset destroy google-all-ips 2> /dev/null || true
1717ipset destroy google-customer-ips 2> /dev/null || true
1818
@@ -32,7 +32,7 @@ iptables -A INPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
3232iptables -A INPUT -i lo -j ACCEPT
3333iptables -A OUTPUT -o lo -j ACCEPT
3434
35- ipset create github-anthropic hash:net
35+ ipset create general hash:net
3636ipset create google-all-ips hash:net
3737ipset create google-customer-ips hash:net
3838
@@ -53,11 +53,13 @@ while read -r cidr; do
5353 exit 1
5454 fi
5555 echo " Adding GitHub range $cidr "
56- ipset add github-anthropic " $cidr "
56+ ipset add general " $cidr "
5757done < <( echo " $gh_ranges " | jq -r ' (.web + .api + .git)[]' | aggregate -q)
5858
5959for domain in \
6060 " api.anthropic.com" \
61+ " api.openai.com" \
62+ " auth.openai.com" \
6163 " generativelanguage.googleapis.com" \
6264 " googleapis.l.google.com" ; do
6365 echo " Resolving $domain ..."
@@ -73,7 +75,7 @@ for domain in \
7375 exit 1
7476 fi
7577 echo " Adding $ip for $domain "
76- ipset add github-anthropic " $ip " || continue
78+ ipset add general " $ip " || continue
7779 done < <( echo " $ips " )
7880done
7981
@@ -127,10 +129,10 @@ iptables -P OUTPUT DROP
127129iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
128130iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
129131
130- # Allow GitHub and Anthropic
131- iptables -A OUTPUT -m set --match-set github-anthropic dst -j ACCEPT
132+ # Allow the general set of IPs
133+ iptables -A OUTPUT -m set --match-set general dst -j ACCEPT
132134# Block all gcloud customer IPs
133- # since this rule is after github-anthropic ACCEPT it shouldn't block any IPs in both sets
135+ # since this rule is after general ACCEPT it shouldn't block any IPs in both sets
134136iptables -A OUTPUT -m set --match-set google-customer-ips dst -j REJECT --reject-with icmp-admin-prohibited
135137# Allow complement set of all gcloud IPs and customer gcloud IPs
136138# since this rule is after google-customer-ips REJECT
0 commit comments