我有我的JMX服務器,它註冊從本地文件讀取的bean,並根據需要使其可供其他JMX客戶端使用。 可以使用「jconsole」或運行在Tomcat容器下的Java應用程序訪問服務器。支持在Java 6上運行的JMX客戶端/服務器上的Kerberos身份驗證/授權
我想要的是添加驗證,以防止「未知」身份訪問JMX服務器。要做到這一點我一直在使用添加Kerberos身份驗證服務器@以下JVM選項
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=5555
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.ssl=false
-Djava.security.auth.login.config=./conf/jaas.conf
-Djava.security.krb5.conf=./conf/krb5.conf
-Dcom.sun.management.jmxremote.login.config=MyKrbAuth
-Ddynamic.mbean.store=./conf/mbeans
-Djava.net.preferIPv4Stack=true
我的Jaas.conf看起來像這樣>>
MyKrbAuth {
com.sun.security.auth.module.Krb5LoginModule required debug=true debugNative=true;
};
當我開始我的JMX服務器與上面的配置,並嘗試連接它使用「JConsole的」,我得到的客戶端和連接下面的異常失敗>>
Cipher: Crypto Permission check failed
Cipher: granted: (CryptoPermission * 128)
Cipher: requesting: (CryptoPermission AES 256)
但在服務器認證似乎是成功>>
[java] [STARTED] Mbean Server
[java] Debug is true storeKey false useTicketCache false useKeyTab false doNotPrompt false ticketCache is null isInitiator true KeyTab is null refreshKrb5Config is false principal is null tryFirstPass is false useFirstPass is false storePass is false clearPass is false
[java] [Krb5LoginModule] user entered username: username
[java]
[java] Acquire TGT using AS Exchange
[java] principal is [email protected]
[java] EncryptionKey: keyType=3 keyBytes (hex dump)=0000: FD 46 7C 02 19 9B 34 E9
[java] EncryptionKey: keyType=1 keyBytes (hex dump)=0000: FD 46 7C 02 19 9B 34 E9
[java] EncryptionKey: keyType=23 keyBytes (hex dump)=0000: FE 6D 82 01 8A D7 AB 60 98
[java] EncryptionKey: keyType=16 keyBytes (hex dump)=0000: 89 02 31 5D F7 5B 3E 89 BC F7 8A 01 A1 80 C7
[java] EncryptionKey: keyType=17 keyBytes (hex dump)=0000: A5 67 71 17 F6 57 A9 26 01 09 B1 EB 75 46 6C
[java]
[java] Commit Succeeded
[java]
從上面看來,客戶端無法解碼響應(這是AES256加密)..如何解決它?
您添加到`jmxremote.access`的訪問條目是什麼?閱讀該文件中的文檔,它用於基於角色的訪問控制。 – Adam 2018-01-10 15:27:05
多年後,我知道,但是您是否嘗試使用login.config`authzIdentity`元素來指定`jmxremote.access`角色,而不是將用戶名添加到文件中? – Adam 2018-01-10 17:11:55