第4章 Fuse Console のセキュア化
Spring Boot で Fuse Console をセキュアにするには、以下を行います。
AWS へのデプロイ時に Fuse Console のプロキシーサーブレットを無効化
スタンドアロン Fuse アプリケーションを Amazon Web Services (AWS) にデプロイする場合、
hawtio.disableProxyシステムプロパティーをtrueに設定して、Fuse Console のプロキシーサーブレットを無効にする必要があります。注記Fuse Console のプロキシーサーブレットを無効にすると、Fuse Console の Connect タブが無効になり、Fuse Console から他の JVM に接続できなくなります。AWS に複数の Fuse アプリケーションをデプロイする場合は、アプリケーションごとに Fuse Console をデプロイする必要があります。
必要なプロトコルとして HTTPS を設定する
hawtio.http.strictTransportSecurityプロパティーを使用すると、Web ブラウザーでセキュア HTTPS プロトコルを使用して Fuse Console にアクセスするよう要求できます。このプロパティーでは、HTTP を使用して Fuse Console へのアクセスを試みる Web ブラウザーは、要求を自動的に変換して HTTPS を使用する必要があることが指定されます。公開鍵を使用して応答をセキュアにする
特定の暗号の公開鍵を Fuse Console に関連付けし、偽造された証明書を使用した中間者攻撃のリスクを軽減するよう Web ブラウザーに要求すると、
hawtio.http.publicKeyPinsプロパティーを使用して HTTPS プロトコルをセキュアにすることができます。
手順
hawtio.http.strictTransportSecurityおよびhawtio.http.publicKeyPinsプロパティーを以下の例のように設定します。public static void main(String[] args) { System.setProperty("hawtio.http.strictTransportSecurity", "max-age=31536000; includeSubDomains; preload"); System.setProperty("hawtio.http.publicKeyPins", "pin-sha256=cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs"; max-age=5184000; includeSubDomains"); SpringApplication.run(YourSpringBootApplication.class, args); }public static void main(String[] args) { System.setProperty("hawtio.http.strictTransportSecurity", "max-age=31536000; includeSubDomains; preload"); System.setProperty("hawtio.http.publicKeyPins", "pin-sha256=cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs"; max-age=5184000; includeSubDomains"); SpringApplication.run(YourSpringBootApplication.class, args); }Copy to Clipboard Copied! Toggle word wrap Toggle overflow (AWS のみにデプロイする場合) Fuse Console のプロキシーサーブレットを無効にするには、以下の例のように
hawtio.disableProxyプロキシーを設定します。public static void main(String[] args) { System.setProperty("hawtio.disableProxy", "true"); }public static void main(String[] args) { System.setProperty("hawtio.disableProxy", "true"); }Copy to Clipboard Copied! Toggle word wrap Toggle overflow
関連情報
-
hawtio.http.strictTransportSecurityプロパティーの構文の説明は、HTTP Strict Transport Security (HSTS) 応答ヘッダーの説明ページを参照してください。 -
hawtio.http.publicKeyPinsプロパティーの構文や、Base64 でエンコードされた公開鍵の抽出方法の説明は、HTTP Public Key Pinning 応答ヘッダーの説明ページを参照してください。