Cloud Armor は、Google Cloud Platform (GCP) が提供するウェブアプリケーションファイアウォール(WAF)およびDDoS(分散型サービス拒否攻撃)保護サービスです。Google Cloud Load Balancingと統合され、インターネットに公開されたアプリケーションやサービスを様々なサイバー攻撃から保護します。Cloud Armorは、Googleのグローバルインフラストラクチャとセキュリティの専門知識を活用して、アプリケーションの可用性、セキュリティ、パフォーマンスを確保します。
Cloud Armorは以下の主要コンポーネントで構成されています:
コンポーネント | 説明 |
---|---|
セキュリティポリシー | セキュリティルールの集合。バックエンドサービスに適用される |
セキュリティルール | トラフィックをフィルタリングするための条件と対応するアクション |
エッジロケーション | 世界中に分散配置されたGoogleのデータセンター。攻撃をGoogleのネットワークエッジで検出・緩和 |
ロードバランサー | Cloud Armorと統合されるGlobal External HTTP(S) Load BalancerまたはClassic Application Load Balancer |
バックエンドサービス | 保護対象のアプリケーションやサービス。Compute Engine、GKE、Cloud Run、App Engineなど |
Cloud Armorと従来のWAF/DDoS保護ソリューションには以下のような違いがあります:
Cloud Armorは、Google Cloud Console、gcloud CLIツール、またはAPIを使用して設定できます。
gcloud compute security-policies create my-policy \
--description="My security policy"
gcloud compute security-policies rules create 1000 \
--security-policy=my-policy \
--description="Block specific IP ranges" \
--src-ip-ranges="192.0.2.0/24,198.51.100.0/24" \
--action=deny-403
gcloud compute security-policies rules create 2000 \
--security-policy=my-policy \
--description="Allow traffic from Japan only" \
--expression="origin.region_code != 'JP'" \
--action=deny-403
gcloud compute backend-services update my-backend-service \
--global \
--security-policy=my-policy
Cloud Armorでは、様々な種類のセキュリティルールを作成できます:
一般的なウェブ攻撃に対する事前構成されたルールを使用できます:
# SQLインジェクション対策ルール
gcloud compute security-policies rules create 1000 \
--security-policy=my-policy \
--description="Block SQL injection" \
--expression="evaluatePreconfiguredExpr('sqli-stable')" \
--action=deny-403
# XSS対策ルール
gcloud compute security-policies rules create 2000 \
--security-policy=my-policy \
--description="Block XSS attacks" \
--expression="evaluatePreconfiguredExpr('xss-stable')" \
--action=deny-403
# リモートファイルインクルージョン対策ルール
gcloud compute security-policies rules create 3000 \
--security-policy=my-policy \
--description="Block remote file inclusion" \
--expression="evaluatePreconfiguredExpr('rfi-stable')" \
--action=deny-403
Common Expression Language (CEL)を使用して、カスタムルールを作成できます:
# 特定のUser-Agentをブロック
gcloud compute security-policies rules create 4000 \
--security-policy=my-policy \
--description="Block bad bots" \
--expression="request.headers['user-agent'].contains('BadBot')" \
--action=deny-403
# 特定のURLパスへのアクセスを制限
gcloud compute security-policies rules create 5000 \
--security-policy=my-policy \
--description="Protect admin area" \
--expression="request.path.startsWith('/admin') && request.headers['cookie'].contains('admin=true') == false" \
--action=deny-403
# 特定のHTTPメソッドのみを許可
gcloud compute security-policies rules create 6000 \
--security-policy=my-policy \
--description="Allow only GET and POST methods" \
--expression="request.method != 'GET' && request.method != 'POST'" \
--action=deny-403
特定のクライアントからのリクエスト数を制限できます:
gcloud compute security-policies rules create 7000 \
--security-policy=my-policy \
--description="Rate limit by IP" \
--expression="true" \
--action=rate-based-ban \
--rate-limit-threshold-count=100 \
--rate-limit-threshold-interval-sec=60 \
--ban-duration-sec=300 \
--conform-action=allow \
--exceed-action=deny-403
再利用可能なIPアドレスリストやカスタムヘッダートランスフォーメーションを作成できます:
# IPアドレスリストの作成
gcloud compute security-policies add-custom-ip-list my-policy \
--name=trusted-ips \
--description="Trusted IP addresses" \
--ip-ranges="203.0.113.0/24,2001:db8::/32"
# IPアドレスリストを使用したルール
gcloud compute security-policies rules create 8000 \
--security-policy=my-policy \
--description="Allow trusted IPs" \
--expression="!inIpRange(origin.ip, resources.custom_ip_lists.trusted-ips)" \
--action=deny-403
Cloud Armorは、以下のようなDDoS攻撃からアプリケーションを保護します:
Cloud ArmorのDDoS保護は、以下の方法で機能します:
Cloud ArmorはGoogle Cloud Monitoringおよびロギングと統合されており、セキュリティイベントを監視できます:
Cloud Armorのログを分析して、セキュリティイベントを調査できます:
# Cloud Armorのログを表示
gcloud logging read 'resource.type="http_load_balancer" AND jsonPayload.enforcedSecurityPolicy.name="my-policy"'
# ブロックされたリクエストのログを表示
gcloud logging read 'resource.type="http_load_balancer" AND jsonPayload.enforcedSecurityPolicy.outcome="DENY"'
特定のセキュリティイベントに対するアラートを設定できます:
# ブロックされたリクエスト数が閾値を超えた場合のアラート
gcloud alpha monitoring policies create \
--display-name="Cloud Armor Blocked Requests Alert" \
--condition-filter='resource.type="http_load_balancer" AND metric.type="compute.googleapis.com/http/request_count" AND metric.labels.response_code_class="400" AND metric.labels.security_policy_name="my-policy"' \
--condition-threshold-value=100 \
--condition-threshold-comparison=COMPARISON_GT \
--condition-aggregations-alignment-period=300s \
--condition-aggregations-per-series-aligner=ALIGN_RATE \
--condition-aggregations-cross-series-reducer=REDUCE_SUM \
--condition-trigger-count=1 \
--notification-channels=projects/my-project/notificationChannels/1234567890
機械学習を使用して、通常のトラフィックパターンを学習し、異常を検出します:
# アダプティブプロテクションの有効化
gcloud compute security-policies update my-policy \
--adaptive-protection-config=enable=true
reCAPTCHA Enterpriseと統合して、ボット対策を強化できます:
# reCAPTCHA Actionの作成
gcloud recaptcha keys create my-recaptcha-key \
--display-name="My reCAPTCHA Key" \
--web \
--domains=example.com \
--integration-type=SCORE
# Cloud Armorとの統合
gcloud compute security-policies rules create 9000 \
--security-policy=my-policy \
--description="reCAPTCHA integration" \
--expression="token.recaptcha_action.score < 0.5" \
--action=deny-403 \
--recaptcha-options=action-token-key=my-recaptcha-key
高度なDDoS保護と専門家によるサポートを提供する有料サービス:
Cloud Armorは以下のようなユースケースに適しています:
Cloud Armorは他のGoogle Cloudサービスと統合して、より強力なセキュリティソリューションを構築できます:
サービス | 統合の利点 |
---|---|
Cloud Load Balancing | ロードバランサーと統合してトラフィックを保護し、可用性を確保 |
Cloud CDN | コンテンツ配信ネットワークと統合して、高速かつ安全なコンテンツ配信を実現 |
GKE | Kubernetesクラスタで実行されるアプリケーションを保護 |
Cloud Run | サーバーレスアプリケーションを保護 |
reCAPTCHA Enterprise | ボット対策を強化し、不正アクセスを防止 |
Cloud Monitoring | セキュリティイベントを監視し、アラートを設定 |
Cloud Logging | セキュリティイベントのログを収集・分析 |
# GKEクラスタの作成
gcloud container clusters create my-cluster \
--zone=asia-northeast1-a \
--num-nodes=3
# Ingressの作成
gcloud container clusters get-credentials my-cluster --zone=asia-northeast1-a
kubectl create deployment my-app --image=gcr.io/my-project/my-app:latest
kubectl expose deployment my-app --port=80 --target-port=8080 --name=my-service
kubectl create ingress my-ingress --rule="/*=my-service:80"
# バックエンドサービスの取得
BACKEND_SERVICE=$(gcloud compute backend-services list \
--filter="description~my-ingress" \
--format="value(name)")
# Cloud Armorポリシーの適用
gcloud compute backend-services update $BACKEND_SERVICE \
--global \
--security-policy=my-policy
# テストモードでルールを作成
gcloud compute security-policies rules create 10000 \
--security-policy=my-policy \
--description="Test rule for XSS protection" \
--expression="evaluatePreconfiguredExpr('xss-stable')" \
--action=deny-403 \
--preview
Cloud Armor は、Google Cloud Platform上でのウェブアプリケーションとサービスを保護するためのフルマネージドセキュリティサービスです。DDoS保護とウェブアプリケーションファイアウォール(WAF)機能を組み合わせて、様々なサイバー攻撃からアプリケーションを守ります。
Cloud Armorの主な利点は以下の通りです:
Cloud Armorを効果的に活用するには、多層防御アプローチの採用、適切なルールの設定、定期的なモニタリングと分析が重要です。また、他のGCPセキュリティサービスと組み合わせることで、包括的なセキュリティ対策を実現することができます。