CVE-2022-38023適用後 NetAppがActive Directoryに参加できない


いままでも「SMB2 Enabled for DC Connections設定に起因する接続できない問題」というのがあったが、先日話題になった「Active Directoryサーバのセキュリティ強化アップデート(CVE-2022-38023)に伴うONTAPファイルサーバへの影響」で、2023年7月以降のActive Directory環境ではONTAP をCIFSに新規作成しようとした場合にエラーがでる、という問題が出ていた。

Is AES Encryption Enabled設定」と「AES session key enabled for NetLogon channel設定」の2つの設定を変更する必要がある。

前者はONTAP 9.12.1から初期値変更、後者はONTAP 9.10.1から初期値変更となっているので、最近導入している場合は問題が発生しないのだが、以前のバージョンからアップデートしているような環境の場合は以前の値のままとなっているため注意が必要となっている。

その1: Is AES Encryption Enabled 設定

以前からONTAPを使っていてアップデートしているような環境では、SMB内部接続での暗号化形式でAESを使わない、という設定になっているせいで、下記の様なエラーとなる。

netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain adosakana.local

In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with
sufficient privileges to add computers to the "CN=Computers" container within the "ADOSAKANA.LOCAL" domain.

Enter the user name: administrator

Enter the password:

Error: Machine account creation procedure failed
  [    47] Loaded the preliminary configuration.
  [   130] Created a machine account in the domain
  [   130] SID to name translations of Domain Users and Admins
           completed successfully
  [   131] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   142] Successfully connected to ip 172.17.44.49, port 464 using
           TCP
  [   233] Kerberos password set for 'SVM3$@ADOSAKANA.LOCAL' succeeded
  [   233] Set initial account password
  [   244] Successfully connected to ip 172.17.44.49, port 445 using
           TCP
  [   276] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   311] Successfully authenticated with DC
           adserver.adosakana.local
  [   324] Unable to connect to NetLogon service on
           adserver.adosakana.local (Error:
           RESULT_ERROR_GENERAL_FAILURE)
**[   324] FAILURE: Unable to make a connection
**         (NetLogon:ADOSAKANA.LOCAL), result: 3
  [   324] Unable to make a NetLogon connection to
           adserver.adosakana.local using the new machine account
  [   346] Deleted existing account
           'CN=SVM3,CN=Computers,DC=adosakana,DC=local'

Error: command failed: Failed to create the Active Directory machine account "SVM3". Reason: general failure.

netapp9101::>

この問題はマニュアルの「Enable or disable AES encryption for Kerberos-based communication」に記載されているように「is-aes-encryption-enabled」設定をtrueに変更することで解決する。

netapp9101::> vserver cifs security modify -vserver svm3 -is-aes-encryption-enabled true
netapp9101::> vserver cifs security show -fields is-aes-encryption-enabled
vserver is-aes-encryption-enabled
------- -------------------------
Cluster -
Snapmirror-WAN
        -
netapp9101
        -
netapp9101-01
        -
svm0    true
svm2    false
svm3    true
7 entries were displayed.

netapp9101::>

その2: AES session key enabled for NetLogon channel 設定

上記を設定しても、下記の様なエラーとなった。

netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain vm2.adosakana.local

In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of
a Windows account with sufficient privileges to add computers to the "CN=Computers" container within the
"ADOSAKANA.LOCAL" domain.

Enter the user name: administrator

Enter the password:

Error: Machine account creation procedure failed
  [    43] Loaded the preliminary configuration.
  [   133] Created a machine account in the domain
  [   133] SID to name translations of Domain Users and Admins
           completed successfully
  [   134] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   144] Successfully connected to ip 172.17.44.49, port 464 using
           TCP
  [   226] Kerberos password set for 'SVM3$@ADOSAKANA.LOCAL' succeeded
  [   226] Set initial account password
  [   253] Successfully connected to ip 172.17.44.49, port 445 using
           TCP
  [   284] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   316] Successfully authenticated with DC
           adserver.adosakana.local
  [   323] Encountered NT error (NT_STATUS_PENDING) for SMB command
           Read
  [   327] Unable to connect to NetLogon service on
           adserver.adosakana.local (Error:
           RESULT_ERROR_GENERAL_FAILURE)
**[   327] FAILURE: Unable to make a connection
**         (NetLogon:ADOSAKANA.LOCAL), result: 3
  [   327] Unable to make a NetLogon connection to
           adserver.adosakana.local using the new machine account
  [   344] Deleted existing account
           'CN=SVM3,CN=Computers,DC=ADOSAKANA,DC=local'

Error: command failed: Failed to create the Active Directory machine account "SVM3". Reason: general failure.

netapp9101::>

この状況となった環境のActive Directoryサーバはsambaで作成しているため /usr/local/samba/var/log.samba を確認してみると下記のエラーがでていた。

[2023/10/20 14:48:22.301935,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:281(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: client_account[SVM3$] computer_name[SVM3] schannel_type[2] client_negotiate_flags[0x741ff] real_account[SVM3$] NT_STATUS_DOWNGRADE_DETECTED reject_des[0] reject_md5[1]
[2023/10/20 14:48:22.302215,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:291(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: Check if option 'server reject md5 schannel:SVM3$ = no' might be needed for a legacy client.
[2023/10/20 14:48:22.304539,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:281(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: client_account[SVM3$] computer_name[SVM3] schannel_type[2] client_negotiate_flags[0x701ff] real_account[SVM3$] NT_STATUS_DOWNGRADE_DETECTED reject_des[1] reject_md5[1]
[2023/10/20 14:48:22.304600,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:291(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: Check if option 'server reject md5 schannel:SVM3$ = no' might be needed for a legacy client.
[2023/10/20 14:48:22.304638,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:298(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: Check if option 'allow nt4 crypto:SVM3$ = yes' might be needed for a legacy client.

もしやkerneberosではなくNTLMで接続されてたりする?と lm-compatibility-level をkrb に設定しても同じ結果となった。

netapp9101::> vserver cifs security modify -vserver svm3 -lm-compatibility-level krb

netapp9101::> vserver cifs security show -fields lm-compatibility-level
vserver lm-compatibility-level
------- ----------------------
Cluster -
Snapmirror-WAN -
netapp9101 -
netapp9101-01 -
svm0    lm-ntlm-ntlmv2-krb
svm2    lm-ntlm-ntlmv2-krb
svm3    krb
7 entries were displayed.

netapp9101::>

さらに調べると「Configure Active Directory domain controller access overview」に、Netlogon にAESを使いたい場合は「aes-enabled-for-netlogon-channel」をtrueに設定する、と書いてあった

netapp9101::> vserver cifs security show -fields aes-enabled-for-netlogon-channel
vserver aes-enabled-for-netlogon-channel
------- --------------------------------
Cluster -
Snapmirror-WAN -
netapp9101 -
netapp9101-01 -
svm0    false
svm2    false
svm3    false
7 entries were displayed.

netapp9101::> vserver cifs security modify -vserver svm3 -aes-enabled-for-netlogon-channel true

netapp9101::> vserver cifs security show -fields aes-enabled-for-netlogon-channel
vserver aes-enabled-for-netlogon-channel
------- --------------------------------
Cluster -
Snapmirror-WAN -
netapp9101 -
netapp9101-01 -
svm0    false
svm2    false
svm3    true
7 entries were displayed.

netapp9101::>

設定変更後に再実行したところ、Active Directory参加に成功した。

netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain adosakana.local

In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of
a Windows account with sufficient privileges to add computers to the "CN=Computers" container within the
"ADOSAKANA.LOCAL" domain.

Enter the user name: administrator

Enter the password:

Notice: SMB1 protocol version is obsolete and considered insecure. Therefore it is deprecated and disabled on this
CIFS server. Support for SMB1 might be removed in a future release. If required, use the (privilege: advanced)
"vserver cifs options modify -vserver svm3 -smb1-enabled true" to enable it.

netapp9101::>

↑のSMB1を有効にするかどうか、というところについては、複合機の出力先として指定されている、とか、LinuxサーバからCIFSでマウントしている、とか、Windowsワークグループからアクセスしている、という場合には有効にする、というような形となる。

Windows Updateしたらsamba ADへの接続がおかしくなった


sambaで作ったsamba AD環境がある。

最近、新しい仮想マシン作ってドメイン参加したあと、PowerShellで「Test-ComputerSecureChannel」を実行したら「False」と出た。

repairしても状況が変わらない

(ADサーバと該当マシン間の通信がセキュアチャネルを使って行われていないという状態)

いまつかっているsambaバージョンを確認すると4.18.2

# /usr/local/samba/sbin/smbd --version
Version 4.18.2
#

sambaのリリース履歴を見るとNetAppでも問題になったセキュリティ修正関連での修正が出ている。

CVE-2023-34967CVE-2022-2127CVE-2023-34968CVE-2023-34966 and CVE-2023-3347.

直接のバグとしては「Bug 15418 – secure channel faulty since Windows 10/11 update 07/2023」が該当している模様

バグであるならアップデートするしかないな、というわけで、samba 4.18.5へアップデート

展開して、make;make install; systemctl restart samba-ad-dc っと

# /usr/local/samba/sbin/smbd --version
Version 4.18.5
#

で、repairすると、今度は成功しました

Active Directoryサーバのセキュリティ強化アップデート(CVE-2022-38023)に伴うONTAPファイルサーバへの影響についてのメモ


WindowsのActive Directoryサーバに対してセキュリティ攻撃ができることが判明したため、Active Directoryサーバに対してセキュリティ強化がWindows Update経由で2022年11月に配布されている。

このときのアップデートで対応されたのは下記の3点

KB5021131: CVE-2022-37966 に関連する Kerberos プロトコルの変更を管理する方法
KB5020805: CVE-2022-37967 に関連する Kerberos プロトコルの変更を管理する方法
KB5021130: CVE-2022-38023 に関連する Netlogon プロトコルの変更を管理する方法

CVE-2022-37966とCVE-2022-38023はどちらも暗号化方式として脆弱なRC4-HMACを使用するのをやめてAESに変更する、というものとなっている。

このため、Kerberos/NTLMv2のどちらを使っていてもRC4-HMACを使用している場合は、このWindows Update適用後に問題が発生する、ということになる。

Windows サーバで構成されているActive Directoryサーバ側での対応については以下にまとめられている

CVE-2022-37966 への対応とその影響について
CVE-2022-37967 への対応とその影響について
CVE-2022-38023 への対応とその影響について

いろいろ書いてあるが、Windowsサーバのレジストリ設定をすることで、強制適用を延期できるけど、最終的にはアクセスできなくなるよ、ということになっている。

で・・・どういう場合に問題が発生するのか?というところが問題となる。

問題が発生するもの

・Active Directoryサーバに対してRC4-HMAC暗号化を使ってKerberos認証を行う場合
・Active Directoryサーバに対してRPC署名を使ってNTLMv2認証を行う場合
・Active Directoryサーバに対してRPCシールとRC4-HMAC暗号化を使ってNTLMv2認証を行う場合

2023/07/24追記: sambaによるActive Direcotryサーバで NTLMv2認証を使う場合(詳細は一番下で解説)

問題が起こらないもの

・Active Directoryサーバに対してAES暗号化を使ってKerberos認証を行う場合
・Active Directoryサーバに対してRPCシールとAES暗号化を使ってNTLMv2認証を行う場合
 (NTLM/Netlogon Secure Channel は同じ意味)

(他にも大丈夫な場合はあると思います)

具体的な環境

2023年5月時点で適切にWindows Updateが実施されているWindows 7 / Windows Server 2012以降のマシンで、Active Directoryに参加している場合はKerberos/AESなので問題ない

Windowsであってもworkgroupとして認証を行う場合はNTLMv2となる場合があるので注意が必要

Linuxからcifs-utilsを使ってCIFS領域をマウントする場合、標準設定ではNTLMv2を使用するため注意が必要

LinuxをActive Directoryに参加させる場合、注意が必要
 Microsoft の 2022 年 11 月の更新により Active Directory の統合が中断される
 Red Hat Enterprise Linux and Microsoft security update of November 2022

ファイルサーバでの問題発生例

Active Directoryに参加しているファイルサーバでは以下のような形で認証が行われる模様

・[クライアント]→Kerberos認証→[ファイルサーバ]→Kerberos認証→[Active Directory]
・[クライアント]→NTLMv2認証→[ファイルサーバ]→NTLMv2認証→[Active Directory]

クライアントからどちらの形式でアクセスをしてくるかで、ファイルサーバ側からActive Directoryへの問いあわせ手法も変わる、ということになる。

このため、ファイルサーバの仕様で問題が発生することとなるため各社がお知らせを出している

・sambaでの問題 RC4/HMAC-MD5 NetLogon Secure Channel is weak and should be avoided Samba 4.15.13/4.16.8/4.17.4以降で対応
・NetAppでの問題 SU530: [Impact Critical] NTLM authentication fails due to enforcement of Netlogon RPC sealing (Microsoft CVE-2022-38023) ONTAP 9.7以降の2023年4月中旬以降提供バージョンで対応
・RedHat/samba CVE-2022-38023
・DELL PowerScale/iSilon PowerScale: Isilon: Netlogon RPC Elevation of Privilege Vulnerability (CVE-2022-38023) OneFS 9.5.0以降で対応
・DELL Unity Dell Unity: Is Unity affected by CVE-2022-38023? (User Correctable) Unity OE 5.1.0以降で対応

・Synology Synology-SA-22:24 Samba AD DC 2023/05/11時点では未提供だが対象リストを見ると通常のファイルサーバ用途では対応不要?
 QNAP,バッファローなども特にお知らせは無し

2023/07/24追記

・バッファロー TeraStation/LinkStation CVE-2022-38023の脆弱性対応によるTeraStation/LinkStationへの影響について
WindowsOSじゃないLinuxベースのやつは影響を受けるようです

・QNAP QTSシリーズ Vulnerabilities in Samba CVE-2022-37966 | CVE-2022-37967 | CVE-2022-38023 | CVE-2022-45141
FreeBSDベースのQESシリーズは影響なし、ですが、それ以外の通常QNAPは影響あり、と

NetApp ONTAPでの対応

対応が必要であるかの調査

NetApp ONTAPでは、ファイルサーバ=>Active Directoryの通信をRC4-HMACで行ってたということで修正がONTAP OSの修正がリリースされています。

2023年4月後半以降にリリースされたONTAP 9.7以降のパッチリリースのみが今回の問題に対応しています。

詳細については富士通が見える状態でリリースを置いてくれています

ETERNUS AX/HXシリーズ, ETERNUS NR1000シリーズにおける WindowsのNetlogon脆弱性対応(CVE-2022-38023)による影響(CIFS接続不可)について

いろいろ書いてありますが、とりあえず、今使ってるNetAppファイルサーバにNTLMv2を使ってアクセスしてきてるユーザがいるのかを確認しましょう

「vserver cifs session show -fields auth-mechanism,protocol-version,windows-user,address」を実行して、auth-mechanismに「NTLMv2」がいる場合は対処が必須です。

netapp9101::> vserver cifs session show -fields auth-mechanism,protocol-version,windows-user,address
node          vserver session-id           connection-id address       auth-mechanism windows-user  protocol-version
------------- ------- -------------------- ------------- ------------- -------------- ------------- ----------------
netapp9101-01 svm0    14421088956793749524 535041285     172.17.44.173 Kerberos       VM2\testuser1 SMB2_1
netapp9101-01 svm0    14421088956793749539 535041298     172.17.44.174 NTLMv2         VM2\testuser1 SMB3
2 entries were displayed.
netapp9101::>

このテスト環境では、172.17.44.173はWindows 7 SP1クライアント、172.17.44.174はRHEL 7.6からCIFSマウントしている環境でした。

このRHEL7.6は「mount -t cifs //svm0.adosakana.local/testutf /mnt2 -o user=testuser1@adosakana.local,password=パスワード,vers=3.0」と実行してマウントしているもので、sec=オプションを付けていない場合はNTLMv2を使用しているようでした。

この「vserver cifs session show -fields auth-mechanism,protocol-version,windows-user,address」はCIFS接続が継続している間は表示される、というものになっているため、数分間アクセスを行わないとリストから消えます。

このため、NTLMv2でアクセスしているかどうかが分からない機械がある場合は、アクセス操作を行ってみた直後にコマンドを実行してみる必要があります。

必要な対応

ONTAP OSのバージョンアップが必要な場合はアップデートを行います。

2023/05/11時点ではCVE-2022-38023に対応するアップデートとして以下が提供されています。

 ONTAP 9.7P22 (End of Limited Support 2025/07/31)
 ONTAP 9.8P18 (End of Limited Support 2025/12/31)
 ONTAP 9.9.1P15 (End of Limited Support 2026/06/30)
 ONTAP 9.10.1P12(End of Limited Support 2027/01/31)
 ONTAP 9.11.1P8 (End of Limited Support 2027/07/31)
 ONTAP 9.12.1P2 (End of Limited Support 2028/02/28)

FAS2520/2552/2554,FAS8020/8040/8060/8080 は ONTAP 9.9.1 までサポート
FAS2620/2650 は ONTAP 9.11.1 までサポート
FAS2720/2750などの現行機種は 制限なし

アップデート先は、同じONTAP OSバージョン内の最新にするか、ハードウェアがサポートされている範囲の新しいバージョンにするかはご自由に

ONTAP OS 9.6などのアップデート提供がバージョンを使用している場合は、ONTAP 9.7以降にアップデートする必要があります。

古いONTAPを新しいONTAPにアップデートする場合、状態によっては複数回のアップデートが必要となります

詳細は「どのバージョンの ONTAP にアップグレードできますか。」を参照してください

例えばONTAP 9.11.1へアップデートする場合、下記のような手順となります。

  ONTAP 9.4→(9.5+9.7)→9.9.1→9.11.1
  ONTAP 9.5→(9.7+9.9.1)→9.11.1
  ONTAP 9.6→9.8→9.11.1
  ONTAP 9.7→(9.8+9.11.1)

(9.5+9.7)というのはONTAP 9.5とONTAP 9.7のアップデートファイルを読み込ませてONTAP 9.7のアップデートとして実行すると、内部的に自動的にONTAP 9.5の適用を行ったあとに9.7適用を行ってくれる、ということをします。

どんな感じでアップデートするか、というのは「この記事」から持ってきた下記画面を参照してください。

1)「イメージの追加」からアップデートするファイルを2つ登録する

2) 新しいバージョンを選択して「更新」

3) まずは古いバージョンの方の適用が開始される

4) 続いて新しいバージョンの方が適用される

5) 終了


NetAppでの調査/対応に関するメモ

NetAppでサポートする認証方式の変更

Set the SMB server minimum authentication security level

「vserver cifs security show -fields lm-compatibility-level」で現在設定されている認証方式を確認

netapp9101::> vserver cifs security show -fields lm-compatibility-level
vserver lm-compatibility-level
------- ----------------------
Cluster -
Snapmirror-WAN
        -
netapp9101
        -
netapp9101-01
        -
svm0    lm-ntlm-ntlmv2-krb
svm2    lm-ntlm-ntlmv2-krb
svm3    lm-ntlm-ntlmv2-krb
7 entries were displayed.
netapp9101::>

値の意味は下記

ValueDescription
lm-ntlm-ntlmv2-krb (default)The storage virtual machine (SVM) accepts LM, NTLM, NTLMv2, and Kerberos authentication security.
ntlm-ntlmv2-krbThe SVM accepts NTLM, NTLMv2, and Kerberos authentication security. The SVM denies LM authentication.
ntlmv2-krbThe SVM accepts NTLMv2 and Kerberos authentication security. The SVM denies LM and NTLM authentication.
krbThe SVM accepts Kerberos authentication security only. The SVM denies LM, NTLM, and NTLMv2 authentication.

標準ではLM, NTLM, NTLMv2, Kerberosに対応している、ということになっている。

NetApp側で強制的にLM,NTLM,NTLMv2クライアントを排除する、という場合は「krb」に変更する

Kerberos接続時のAES暗号化を有効化

Enable or disable AES encryption for Kerberos-based communication

「vserver cifs security show -fields is-aes-encryption-enabled」を実行して確認。ONTAP 9.12.1以降は「true」が標準値となる。

netapp9101::> vserver cifs security show -fields is-aes-encryption-enabled
vserver is-aes-encryption-enabled
------- -------------------------
Cluster -
Snapmirror-WAN
        -
netapp9101
        -
netapp9101-01
        -
svm0    false
svm2    false
svm3    false
7 entries were displayed.
netapp9101::>

なお設定を変更する場合は、ドメイン認証を求められるので注意

netapp9101::> vserver cifs security modify -vserver svm0 -is-aes-encryption-enabled true
Info: In order to enable CIFS AES encryption, the password for the CIFS server
      machine account must be reset. Enter the username and password for the
      CIFS domain "ADOSAKANA.LOCAL".
Enter your user ID: administrator
Enter your password:
netapp9101::> vserver cifs security show -fields is-aes-encryption-enabled
vserver is-aes-encryption-enabled
------- -------------------------
Cluster -
Snapmirror-WAN
        -
netapp9101
        -
netapp9101-01
        -
svm0    true
svm2    false
svm3    false
7 entries were displayed.
netapp9101::>

なお、AES暗号化に関連する設定は is-aes-encryption-enabled 以外に aes-enabled-for-netlogon-channel という設定もある。こちらの詳細については「CVE-2022-38023適用後 NetAppがActive Directoryに参加できない」参照


2023/07/24追記

sambaによるActive Direcotryサーバで NTLMv2認証を使う場合のトラブル

sambaの商業サポートを行っているOSStechに2023/07/21付けのお知らせとして「Windows Updateに伴うSambaの認証の問題を解消するアップデートです。」が掲載されています。

曰く、セキュアチャネルが壊れ、下記3種類の問題が発生するとのこと。

・Sambaのみを使用したActive Directoryサーバ環境におけるNTLM認証が失敗
・リモートデスクトップの認証が失敗
・Sambaのみを使用したNTドメイン環境でNTドメインのログオンが失敗

バグとしては恐らく「BUG 15418: Secure channel faulty since Windows 10/11 update 07/2023」となる

てっきりActive Directoryサーバを運用しているWindows Serverのみ気を使っていればいいのかと思ったら、クライアント側にも影響があったとは・・・


2023/11/14追記

ONTAP 9.10.1より前のONTAPで、CVE-2022-38023適用したActive Directoryドメイン(sambaドメイン含む)に参加できない、という事象が発生した。

詳細は「CVE-2022-38023適用後 NetAppがActive Directoryに参加できない」に書いたが、Active DIrectoryサーバとONTAP間のkerberos通信の暗号化をRC4 MD5ではなくて、AESを使うようにしなければならないので、NetAppのcifsオプションにあるis-aes-encription-enabledとaes-enabled-for-netlogon-channelを有効にする必要がある、というものだった。

Samba 4.16.x をOracle Linux 8環境でコンパイルする


Oracle Linux 8.6環境でSamba 4.16.3をコンパイルしようとしたら面倒だったのでメモ書き。

まず、「Package Dependencies Required to Build Samba」にあるVerified Package DependenciesのSamba master / CentOS 8 のリンクが使えない。

これは、CentOS8ではなく、CentOS8Streamにリンクが変わったためである。

ただ、Oracle Linux 8ではレポジトリ名が異なっているため、実行が失敗する。

Oracle Linux 8でのレポジトリ対応は下記となる。

RHEL 8CentOS 8Oracle Linux 8
BaseBaseol8_baseos_latest
AppStreamAppStreamol8_appstream
CodeReady Linux Builder*PowerToolsol8_codeready_builder
EPEL**EPEL**ol8_developer_EPEL

なので、Oracle Linux 8では下記を実行してレポジトリを有効化する

# yum config-manager --set-enabled ol8_codeready_builder
# yum config-manager --set-enabled ol8_developer_EPEL

次に、「Red Hat Enterprise Linux 8 / CentOS 8」に記載があるパッケージ群をインストール

# yum install docbook-style-xsl gcc gdb gnutls-devel gpgme-devel jansson-devel \
      keyutils-libs-devel krb5-workstation libacl-devel libaio-devel \
      libarchive-devel libattr-devel libblkid-devel libtasn1 libtasn1-tools \
      libxml2-devel libxslt lmdb-devel openldap-devel pam-devel perl \
      perl-ExtUtils-MakeMaker perl-Parse-Yapp popt-devel python3-cryptography \
      python3-dns python3-gpg python36-devel readline-devel rpcgen systemd-devel \
      tar zlib-devel

エラー対処1: dbus-devel

configure中にエラー発生

Checking for library nscd                                                                       : no
Checking for nscd_flush_cache                                                                   : not found
VFS_STATIC: vfs_default,vfs_not_implemented,vfs_posixacl,vfs_dfs_samba4
VFS_SHARED: vfs_recycle,vfs_audit,vfs_extd_audit,vfs_full_audit,vfs_fake_perms,vfs_default_quota,vfs_readonly,vfs_cap,vfs_expand_msdfs,vfs_shadow_copy,vfs_shadow_copy2,vfs_readahead,vfs_xattr_tdb,vfs_streams_xattr,vfs_streams_depot,vfs_acl_xattr,vfs_acl_tdb,vfs_preopen,vfs_catia,vfs_media_harmony,vfs_unityed_media,vfs_fruit,vfs_shell_snap,vfs_commit,vfs_worm,vfs_crossrename,vfs_linux_xfs_sgid,vfs_time_audit,vfs_offline,vfs_virusfilter,vfs_widelinks,vfs_snapper,vfs_posix_eadb,vfs_syncops,vfs_dirsort,vfs_fileid,vfs_aio_fork,vfs_aio_pthread,vfs_gpfs,vfs_btrfs,vfs_glusterfs_fuse
PDB_STATIC: pdb_smbpasswd,pdb_tdbsam,pdb_samba_dsdb,pdb_ldapsam
PDB_SHARED:
AUTH_STATIC: auth_builtin,auth_sam,auth_winbind,auth_unix,auth_samba4
AUTH_SHARED:
NSS_INFO_STATIC: nss_info_template
NSS_INFO_SHARED:
CHARSET_STATIC:
CHARSET_SHARED:
IDMAP_STATIC: idmap_tdb,idmap_passdb,idmap_nss,idmap_ldap
IDMAP_SHARED: idmap_ad,idmap_rfc2307,idmap_autorid,idmap_rid,idmap_hash,idmap_tdb2,idmap_script
GPEXT_STATIC:
GPEXT_SHARED:
PERFCOUNT_STATIC:
PERFCOUNT_SHARED:
Checking for dbus                                                                               : not found
vfs_snapper is enabled but prerequisite dbus-1 package not found. Use --with-shared-modules='!vfs_snapper' to disable vfs_snapper support.
(complete log in /root/samba-4.16.3/bin/config.log)
# 

これは「dnf install dbus-devel」のインストールで対応

# dnf install dbus-devel
メタデータの期限切れの最終確認: 0:08:21 時間前の 2022年07月19日 09時59分33秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ      Arch        バージョン                リポジトリー       サイズ
================================================================================
インストール:
 dbus-devel      x86_64      1:1.12.8-18.0.1.el8       ol8_appstream       68 k

トランザクションの概要
================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 68 k
インストール後のサイズ: 127 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
dbus-devel-1.12.8-18.0.1.el8.x86_64.rpm          54 kB/s |  68 kB     00:01
--------------------------------------------------------------------------------
合計                                             54 kB/s |  68 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : dbus-devel-1:1.12.8-18.0.1.el8.x86_64                  1/1
  scriptletの実行中: dbus-devel-1:1.12.8-18.0.1.el8.x86_64                  1/1
  検証             : dbus-devel-1:1.12.8-18.0.1.el8.x86_64                  1/1

インストール済み:
  dbus-devel-1:1.12.8-18.0.1.el8.x86_64

完了しました!
#

エラー対処2: python3-markdown

configure中にエラー発生

Checking for openpty                                                                            : not found
Checking for library util                                                                       : yes
Checking for openpty in util                                                                    : ok
Checking for system installation of Python module markdown                                      : not found
        Unable to find Python module 'markdown'. Please install the system package: python3-markdown'.
#

これは書かれている通りにpython3-markdownをインストール

# dnf install python3-markdown
メタデータの期限切れの最終確認: 0:09:33 時間前の 2022年07月19日 09時59分33秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ          Arch      バージョン        リポジトリー             サイズ
================================================================================
インストール:
 python3-markdown    noarch    2.6.11-2.el8      ol8_codeready_builder    133 k

トランザクションの概要
================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 133 k
インストール後のサイズ: 418 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
python3-markdown-2.6.11-2.el8.noarch.rpm        108 kB/s | 133 kB     00:01
--------------------------------------------------------------------------------
合計                                            108 kB/s | 133 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : python3-markdown-2.6.11-2.el8.noarch                   1/1
  scriptletの実行中: python3-markdown-2.6.11-2.el8.noarch                   1/1
  検証             : python3-markdown-2.6.11-2.el8.noarch                   1/1

インストール済み:
  python3-markdown-2.6.11-2.el8.noarch

完了しました!
#

エラー対処3: perl-JSON

make中にエラー発生

third_party/heimdal/lib/asn1/der_free.c third_party/heimdal/lib/asn1/der_format.c third_party/heimdal/lib/asn1/der_length.c third_party/heimdal/lib/asn1/der_copy.c third_party/heimdal/lib/asn1/der_cmp.c third_party/heimdal/lib/asn1/der_print.c third_party/heimdal/lib/asn1/extra.c third_party/heimdal/lib/asn1/timegm.c third_party/heimdal/lib/asn1/template.c third_party/heimdal/lib/asn1/oid_resolution.c -> bin/default/third_party/heimdal/lib/asn1/der-protos.h
Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.
BEGIN failed--compilation aborted at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.

Waf: Leaving directory `/root/samba-4.16.3/bin/default'
Build failed
 -> task in '../heimdal/lib/asn1/der-protos.h' failed with exit status 2 (run with -v to display more information)
make: *** [Makefile:7: all] エラー 1
PYTHONHASHSEED=1 WAF_MAKE=1  ./buildtools/bin/waf install
Waf: Entering directory `/root/samba-4.16.3/bin/default'
        Selected embedded Heimdal build
Checking project rules ...
Project rules pass
[1/1] Compiling VERSION
+ install /usr/local/samba/lib/pkgconfig/samba-hostconfig.pc (from bin/default/lib/param/samba-hostconfig.pc)
+ install /usr/local/samba/lib/pkgconfig/dcerpc_samr.pc (from bin/default/source4/librpc/dcerpc_samr.pc)
+ install /usr/local/samba/lib/pkgconfig/dcerpc.pc (from bin/default/source4/librpc/dcerpc.pc)
+ install /usr/local/samba/lib/pkgconfig/samdb.pc (from bin/default/source4/dsdb/samdb.pc)
+ install /usr/local/samba/lib/pkgconfig/samba-credentials.pc (from bin/default/auth/credentials/samba-credentials.pc)
+ install /usr/local/samba/lib/pkgconfig/wbclient.pc (from bin/default/nsswitch/libwbclient/wbclient.pc)
+ install /usr/local/samba/lib/pkgconfig/samba-util.pc (from bin/default/lib/util/samba-util.pc)
+ install /usr/local/samba/lib/pkgconfig/dcerpc_server.pc (from bin/default/source4/rpc_server/dcerpc_server.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr_krb5pac.pc (from bin/default/librpc/ndr_krb5pac.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr_standard.pc (from bin/default/librpc/ndr_standard.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr_nbt.pc (from bin/default/librpc/ndr_nbt.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr.pc (from bin/default/librpc/ndr.pc)
+ install /usr/local/samba/lib/pkgconfig/samba-policy.cpython-36m-x86_64-linux-gnu.pc (from bin/default/source4/lib/policy/samba-policy.cpython-36m-x86_64-linux-gnu.pc)
+ install /usr/local/samba/sbin/samba_downgrade_db (from bin/default/source4/scripting/bin/samba_downgrade_db.inst)
+ install /usr/local/samba/sbin/samba_dnsupdate (from bin/default/source4/scripting/bin/samba_dnsupdate.inst)
+ install /usr/local/samba/sbin/samba_spnupdate (from bin/default/source4/scripting/bin/samba_spnupdate.inst)
+ install /usr/local/samba/sbin/samba_upgradedns (from bin/default/source4/scripting/bin/samba_upgradedns.inst)
+ install /usr/local/samba/sbin/samba_kcc (from bin/default/source4/scripting/bin/samba_kcc.inst)
+ install /usr/local/samba/sbin/samba-gpupdate (from bin/default/source4/scripting/bin/samba-gpupdate.inst)
+ install /usr/local/samba/bin/samba-tool (from bin/default/source4/scripting/bin/samba-tool.inst)
+ install /usr/local/samba/lib/pkgconfig/netapi.pc (from bin/default/source3/libnet/netapi.pc)
+ install /usr/local/samba/lib/pkgconfig/smbclient.pc (from bin/default/source3/libsmb/smbclient.pc)
[306/306] Linking bin/default/third_party/heimdal_build/compile_et.inst
[317/322] Processing ../heimdal/lib/asn1/der-protos.h: third_party/heimdal/lib/asn1/der_get.c third_party/heimdal/lib/asn1/der_put.c third_party/heimdal/lib/asn1/der_free.c third_party/heimdal/lib/asn1/der_format.c third_party/heimdal/lib/asn1/der_length.c third_party/heimdal/lib/asn1/der_copy.c third_party/heimdal/lib/asn1/der_cmp.c third_party/heimdal/lib/asn1/der_print.c third_party/heimdal/lib/asn1/extra.c third_party/heimdal/lib/asn1/timegm.c third_party/heimdal/lib/asn1/template.c third_party/heimdal/lib/asn1/oid_resolution.c -> bin/default/third_party/heimdal/lib/asn1/der-protos.h
Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.
BEGIN failed--compilation aborted at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.

Waf: Leaving directory `/root/samba-4.16.3/bin/default'
Build failed
 -> task in '../heimdal/lib/asn1/der-protos.h' failed with exit status 2 (run with -v to display more information)
make: *** [Makefile:10: install] エラー 1
#

「dnf install perl-JSON」で対処

# dnf install perl-JSON
メタデータの期限切れの最終確認: 0:24:56 時間前の 2022年07月19日 09時59分33秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ      Arch         バージョン              リポジトリー        サイズ
================================================================================
インストール:
 perl-JSON       noarch       2.97.001-2.el8          ol8_appstream        96 k

トランザクションの概要
================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 96 k
インストール後のサイズ: 245 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
perl-JSON-2.97.001-2.el8.noarch.rpm              70 kB/s |  96 kB     00:01
--------------------------------------------------------------------------------
合計                                             70 kB/s |  96 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : perl-JSON-2.97.001-2.el8.noarch                        1/1
  scriptletの実行中: perl-JSON-2.97.001-2.el8.noarch                        1/1
  検証             : perl-JSON-2.97.001-2.el8.noarch                        1/1

インストール済み:
  perl-JSON-2.97.001-2.el8.noarch

完了しました!
#

以上でsamba-4.16.3のコンパイルが正常に終了した。

sambaのDNSでは委任(delegate)ができないようだ


PowerScaleシミュレータのSmartConnect動作を見てみようと、samba 4.15.5で作ったActive DirectoryのDNSサーバ機能で名前解決動作を試みて見た。

結果、samba 4.15.5ではWindowsのDNS管理ツールから行う「委任ウィザード」の「ネームサーバーレコード」の登録で「検証エラー」が発生するためうまく動作しなかった。

sa

samba-tool コマンドでNSレコードの登録を行ってみたところ登録ができるが、指定したDNSサーバに聞きに行くわけではない、という動作だった。

同じ操作をWindows Server 2019で作ったActive Directory環境で試すと何も問題が無く設定完了した