legacy-knowledge-base
公開されました Jul. 2, 2025

Liferay DXP 7.1はX-Frame-Options、X-XSS-Protection、X-Content-Type-Optionsヘッダをサポートしますか?

投稿者

Sivakumar Perumal

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

問題

  • Liferay DXP 7.1はX-Frame-Options、X-XSS-Protection、X-Content-Type-Optionsヘッダをサポートしますか? もしそうなら、同じことを可能にする方法を教えてください。

環境

  • Liferay DXP 7.1

解像度

  • Liferay DXP 7.1は、以下のヘッダーで既にセキュリティが確保されており、デフォルトで有効になっています。
  • これらの値は、portal-impl.jarの中にあるsystem.propertiesファイル(portal.propertiesファイルではありません)にあります。
    #
    # Set this to true for the portal to send the "X-Frame-Options: DENY" HTTP
    # header to protect against clickjacking.
    #
    # Custom HTTP header values instead of "DENY" can be specified per URL via
    # the properties "http.header.secure.x.frame.options.*".
    #
    http.header.secure.x.frame.options=true
        #
    # Set this to nonempty value for the portal to send the "X-XSS-Protection"
    # HTTP header to block cross-site scripting attacks. Possible nonempty
    # values are "0", "1" and "1; mode=block"
    #
    http.header.secure.x.xss.protection=1
        #
    # Set this to true for the portal to send the "X-Content-Type-Options:
    # nosniff" HTTP header to protect against MIME sniffing. Custom URLs can
    # specified in the property
    # "http.header.secure.x.content.type.options.urls.excludes" that allow for
    # unhindered MIME sniffing.
    #
    http.header.secure.x.content.type.options=true
  • デフォルトの設定を上書きするには、system-ext.propertiesファイルを作成し、system.propertiesを直接修正しないことがベストプラクティスです。
  • system-ext.properties ファイルを .../ROOT/WEB-INF/classes フォルダ内に配置します。 変更を適用するためには、サーバーの再起動が必要です。
    Http_Security_Headers.png

追加情報

  • 一般的な情報については、 system-ext.properties reference Guideを参照してください。
did-this-article-resolve-your-issue

legacy-knowledge-base