比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

貴学にてIdPv5をインストールする場合の構築手順

貴学にて、貴学のサーバにOSを含めShibboleth IdPならびに必要なパッケージのインストール・設定を行う手順を説明します。



目次
maxLevel2
minLevel2
stylenone

...

アンカー
idpInst1
idpInst1

1. Shibboleth IdP (version 5以降) の動作要件

以下は本技術ガイドで構築する前提となる環境です。

  • Apache HTTP Server 2.4 以上 と mod_ssl

...

最新の情報はShibbolethのサイトでご確認ください:
全体, Jetty11

...

アンカー
idpInst2
idpInst2

2. OSをインストールする

1. OSでの設定

・OS(Rocky Linux 9)インストール

インストーラでインストールするもの。

...

 環境に合わせ、ホスト名・ネットワーク・セキュリティを設定して下さい。

2. DNSへ登録する

 新しいホスト名とIPアドレスをDNSに登録してください。

3. 時刻同期を設定する

 ntpサービスを用い、貴学環境のntpサーバと時刻同期をしてください。

  ※Shibbolethでは、通信するサーバ間の時刻のずれが約3分を越えるとエラーになります。


...

アンカー
idpInst3
idpInst3

3. java17(OpenJDK)、jetty11をインストールする 

1. tomcatの削除

tomcat が入っている場合は、削除してください。

2. java17 のインストール 

Rocky LinuxにはOpenJDKのパッケージが用意されていますので、これをdnfにてインストールします。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

(1) インストール可能なjava-17-openJDKがあるか確認します
# dnf list --all | grep java-17-openjdk

(2) java-17-openjdkがインストール済か確認します
# dnf list --installed | grep java-17-openjdk
(3) java-17-openjdkをインストールします
# dnf -y install java-17-openjdk
(4) インストール結果を確認します
# java -version

 

3. jetty11 のインストール 

Jetty11の配置

jetty11は、https://jetty.org/download.html より最新版のパッケージ(.tgz)をダウンロードしてインストールします。
「最新版のパッケージ(.tgz)」のURLは、https://jetty.org/download.htmlの「The latest releases of Eclipse Jetty」表の「11.0.22 (EOCS)」行の「.tgz」をマウス右クリックして「リンクをコピー」を選択することによって、クリップボードに得ることができます。

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# sudo systemctl daemon-reload
sudo systemctl enable jetty


4. jetty-baseの設定

/opt/jetty-base/webapps/idp.xmlを以下のように修正します。(下記のようになっていることを確認します)

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# ---------------------------------------
# Module: idp
# Shibboleth IdP
# ---------------------------------------
--module=logging-logback
--module=idp

--module=http
--module=http-forwarded

(省略)

# Allows use of default IdP command line tools.
jetty.http.host=127.0.0.1
jetty.http.port=8080


 /opt/jetty-base/etcstart.d/tweakidp-ssllogging.xmlを以下の内容で作成します。ini を修正します。ファイルが無ければ作成してください。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# Override logback version pinned in jetty-home/modules/logback-impl.mod
logback.version=1.4.9

情報

ここで記載しているバージョンは lib/logging/ 以下に配置されているライブラリのバージョンです。展開したjetty-baseが本技術ガイドに記載のものと異なる場合は、実際に配置されているライブラリのバージョンを logback.version= に記述してください。

この記述を間違えると、エラーメッセージ
    java.security.PrivilegedActionException: java.lang.ClassNotFoundException: ch.qos.logback.access.jetty.RequestLogImpl
によりShibboleth IdPの起動に失敗したり、/opt/jetty-base/logs/jetty.logが出力されないといったことが起こります。


 /opt/jetty-base/etc/tweak-ssl.xmlを以下の内容で作成します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
    "http://www.eclipse.org/jetty/configure_9_4.dtd">
<Configure id="sslContextFactory"

     class="org.eclipse.jetty.util.ssl.SslContextFactory">
    <Set name="IncludeProtocols">
 

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
    "http://www.eclipse.org/jetty/configure_9_4.dtd">
<Configure id="sslContextFactory"

     class="org.eclipse.jetty.util.ssl.SslContextFactory">
    <Set name="IncludeProtocols">
        <Array type="String">
            <Item>TLSv1.3</Item>
            <Item>TLSv1.2</Item>
        </Array>
    </Set>
    <Set name="ExcludeProtocols">
        <Array type="String">
            <Item>TLSv1.1<3</Item>
            <Item>TLSv1</Item>
            <Item>SSL</Item>
            <Item>SSLv2</Item>
            <Item>SSLv3<<Item>TLSv1.2</Item>
        </Array>
    </Set>
    <Set name="IncludeCipherSuitesExcludeProtocols">
        <Array type="String">
            <Item>TLS_ECDHE.*<<Item>TLSv1.1</Item>
            <Item>TLSv1</Item>
            <Item>SSL</Item>
            <Item>TLS_AES.*<<Item>SSLv2</Item>
            <Item>TLS_RSA.*<<Item>SSLv3</Item>
        </Array>
    </Set>
    <Set name="ExcludeCipherSuitesIncludeCipherSuites">
        <Array type="String">
            <Item>.*NULL<Item>TLS_ECDHE.*</Item>
            <Item>.*RC4<Item>TLS_AES.*</Item>
            <Item>.*MD5<Item>TLS_RSA.*</Item>
        </Array>
    </Set>
    <Set name="ExcludeCipherSuites">
        <Array type="String">
            <Item>.*DESNULL.*</Item>
            <Item>.*DSSRC4.*</Item>
            <Item>TLS_DHE<Item>.*MD5.*</Item>
            <Item>.*DES.*</Array>Item>
    </Set>
<            <Item>.*DSS.*</Item>
            <Item>TLS_DHE.*</Item>
        </Array>
    </Set>
</Configure>

上記ファイルを参照するように /opt/jetty-base/modules/idp-backchannel.mod に追記します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

(省略)
[xml]
etc/idp-backchannel.xml
etc/tweak-ssl.xml


5.  httpd の設定 

/etc/httpd/conf/httpd.conf の修正

...

情報

加えて、SSL 3.0プロトコルに対する攻撃が発見されておりますので、当該プロトコルを無効化することをお勧めします。
SSLバージョン3の脆弱性について (CVE-2014-3566)

パネル

SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

/etc/httpd/conf.d/virtualhost-localhost80.conf を以下の内容で作成してください。
これはShibboleth IdPが提供するreload-metadata.sh等のコマンドを使った操作を可能にするためのものです。

...

パネル
bgColor#eeeeee

<VirtualHost localhost:80>
ProxyPass /idp/ http://localhost:8080/idp/ connectiontimeout=5 timeout=15
</VirtualHost>

 

...

アンカー
idpInst4
idpInst4

4. Shibbolethのインストール

各ファイル名等の指定は,Version 5に準拠しています。


1. Shibboleth IdP パッケージのダウンロード

http://shibboleth.net/downloads/identity-provider/latest/から最新のIdP( shibboleth-identity-provider-5.?.?.tar.gz)をwgetでダウンロードします。
shibboleth-identity-provider-5.?.?.tar.gz をマウスの右ボタンでクリックするとショートカットメニューが表示されますが、「リンクをコピー」メニューを選択すると、クリップボードにダウンロード元のURLが得られます。
このURLからwgetでパッケージをダウンロードします。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# wget https://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-5.1.2.tar.gz

情報

ダウンロードしたファイルの真正性を確かめるにはPGP署名(ダウンロードURLに".asc"を追加したもの)を確認してください。

2. インストール

ダウンロードしたtar.gzファイルを展開し、bin/installコマンドを実行します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# tar xzvf shibboleth-identity-provider-5.1# tar xzvf shibboleth-identity-provider-5.1.2.tar.gz
# cd shibboleth-identity-provider-5.1.2

↓下記2行を記載したファイル install.properties を作成する。
# cat > ../install.properties
idp.conf.credentials.filemode=640
idp.conf.credentials.group=jetty
CTRL+d ←CTRLキーを押しながらdキーを同時に押す

ここで作成したファイルは、bin/install.sh実行後、削除されるようです。
# sudo bin/install.sh --propertyFile ../install.properties

情報

install.shのコマンドラインオプションとして -D... の指定ができなくなりましたので、バージョン5では、../install.propertiesを上記のように作成してから実行してください。

情報

ダウンロードしたファイルの真正性を確かめるにはPGP署名(ダウンロードURLに".asc"を追加したもの)を確認してください。

...

borderColor#cccccc
bgColor#eeeeee
borderStylesolid

...

 install.shシェルスクリプトを実行すると、以下のような問い合わせがあります。
手順に従って、進めてください。

注意

インストール時に入力するパスワードを本運用で使う場合は、推測されにくいものを使用してください。
※ここで入力した Cookie Encryption Key Password は、/opt/shibboleth-idp/credentials/secrets.propertiesに記載されます。
 一方 Backchannel PKCS12 Password は記録されません。

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# tar xzvf shibboleth-identity-provider-4.?.?.tar.gz
# cd shibboleth-identity-provider-4.?.?
# sudo ./bin/install.sh -Didp.conf.credentials.filemode=640 -Didp.conf.credentials.group=jetty

...

Installation Directory: [/opt/shibboleth-idp] ?
[Enter] ←入力なし(デフォールト設定)
INFO  - New Install.  Version: 5.1.2

注意

インストール時に入力するパスワードを本運用で使う場合は、推測されにくいものを使用してください。
※ここで入力した Cookie Encryption Key Password は、/opt/shibboleth-idp/credentials/secrets.propertiesに記載されます。
 一方 Backchannel PKCS12 Password は記録されません。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid
Buildfile: /root/shibboleth-identity-provider-4.0.1/bin/build.xml
install:
Source (Distribution) Directory (press <enter> to accept default): [/root/shibboleth-identity-provider-4.0.1] ?
[Enter] ←入力なし

Installation Directory: [/opt/shibboleth-idp] ?
[Enter] ←入力なし

INFO [net.shibboleth.idp.installer.V4Install:151] - New Install. Version: 4.0.1
Host Name: [upkishib-idp.nii.ac.jp]
[Enter] ←入力なし ※表示されたホスト名が違う場合、設定してください。

INFO [net.shibboleth.idp.installer.V4Install:549] - Creating idp-signing, CN = upkishib-idp.nii.ac.jp URI = https://upkishib-idp.nii.ac.jp/idp/shibboleth, keySize=3072
INFO [net.shibboleth.idp.installer.V4Install:549] - Creating idp-encryption, CN = upkishib-idp.nii.ac.jp URI = https://upkishib-idp.nii.ac.jp/idp/shibboleth, keySize=3072

Backchannel PKCS12 Password: backpass[Enter] ←任意のパスワード
Re-enter password: backpass[Enter]

INFO [net.shibboleth.idp.installer.V4Install:592] - Creating backchannel keystore, CN = upkishib-idp.nii.ac.jp URI = https://upkishib-idp.nii.ac.jp/idp/shibboleth, keySize=3072

Cookie Encryption Key Password: cookiepass[Enter] ←任意のパスワード
Re-enter password: cookiepass[Enter]

INFO [net.shibboleth.idp.installer.V4Install:633] - Creating backchannel keystore, CN = upkishib-idp.nii.ac.jp URI = https://Hostname: [upkishib-idp.nii.ac.jp/idp/shibboleth] ?
[Enter] ←入力なし ※表示されたホスト名が違う場合、設定してください。
, keySize=3072
INFO [net.shibboleth.utilities.java.support.security.BasicKeystoreKeyStrategyTool:166] - No existing versioning property, initializing... (省略)
SAML EntityID: [https://upkishib-idp.nii.ac.jp/idp/shibboleth] ?
[Enter]
 ←入力なし ←入力なし(デフォールト設定)

Attribute Scope: [nii.ac.jp]
[Enter] ←入力なし ※表示されたスコープが違う場合、設定してください。

 (省略)

BUILD SUCCESSFUL
Total time: 2 minutes 9 seconds   (省略)

 上記のような質問に答えながら、インストールを行います。

3. パーミッションの調整 

”jetty”ユーザがログファイルを出力できるようディレクトリの所有者を変更します。

...

ヒント

IdPが実際に使用する証明書の秘密鍵はまだ配置されておりませんので、所有者・パーミッションは後の手順で設定します。


アンカー
jakarta-taglibs-core.jar_jakarta-taglibs-standard.jar
jakarta-taglibs-core.jar_jakarta-taglibs-standard.jar

4

...

. ディレクトリインデックスの禁止

edit-webapp内にweb.xml を作成します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# sudo mkdir /opt/shibboleth-idp/edit-webapp/WEB-INF
# sudo cp -ip /opt/shibboleth-idp/dist/webapp/WEB-INF/web.xml /opt/shibboleth-idp/edit-webapp/WEB-INF/web.xml
# sudo chmod u+w /opt/shibboleth-idp/edit-webapp/WEB-INF/web.xml


作成したweb.xml を以下の内容で修正します。
※既存の<servlet>の前に設定を追加します。<servlet>ブロックがない時は、最後(</web-app>の手前)に追加してください

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

<filter-mapping>
<filter-name>SLF4JMDCServletFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- Servlets and servlet mappings -->
<servlet>
  <servlet-name>default</servlet-name>
     <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
       <init-param>
         <param-name>dirAllowed</param-name>
         <param-value>false</param-value>
       </init-param>
     <load-on-startup>0</load-on-startup>
</servlet>

<servlet>
<servlet-name>idp</servlet-name>

...

注意

※jetty起動に失敗したら設定修正後、/opt/jetty-base/tmp/下にファイルが残っていたら削除してから再度起動してください。
※build.shしたら sudo systemctl restart jetty しないと反映されません。



...

アンカー
idpInst5
idpInst5

5. サービスの起動・停止方法


サービス起動コマンド停止コマンド再起動コマンド
httpdsystemctl start httpdsystemctl stop httpdsystemctl restart httpd
jettysystemctl start jettysystemctl stop jettysystemctl restart jetty

 


...

インストールが完了したら,サイト情報等の設定を行って下さい.

 

...