curlをつかってHTTPヘッダーを変えてアクセスしてみる

サーバーへのあやしいアクセス対策後、テストするため
curlをつかって特定のHTTPヘッダーをはじくか確認してみました
※アクセス先はダミーです

特定のUser-agentを防ぐ場合

まずは正常なもの

$ curl --user-agent 'OK-agent' --head http://sample.com
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2015 12:27:20 GMT
Server: Apache
Last-Modified: Wed, 21 Jan 2015 16:10:10 GMT
ETag: "413ee-2fd-50d2bca2d5ba6"
Accept-Ranges: bytes
Content-Length: 765
Connection: close
Content-Type: text/html; charset=UTF-8

200で正常です

次にGoogle App Engineからのアクセスを弾く想定(プロキシとか)

$ curl --user-agent 'AppEngine-Google' --head http://sample.com                                                                                                                     
HTTP/1.1 403 Forbidden
Date: Fri, 26 Jun 2015 12:27:45 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 4954
Connection: close
Content-Type: text/html; charset=UTF-8

403で弾かれてます
できてそうです