加密密碼
如需詳細資訊,請參閱本說明中心中的主題ThingWorx 說明中心中的 安全性管理工具
加密授權與資料庫密碼 (8.4.0+)
金鑰庫提供者使用在檔案中加密儲存的安全權杖來處理金鑰庫。寫入至金鑰庫的所有資料都將使用密碼安全儲存。提供者初次啟動時,如果不存在隨機密碼值與金鑰庫檔案,它就會產生隨機密碼值與金鑰庫檔案。
* 
金鑰庫密碼與金鑰庫檔案應限制為僅供應用程式使用者使用。應用程式使用者必須擁有檔案的讀取/寫入權限。
* 
下列範例以 Windows 為基礎。如果您要使用 Linux 作業系統,請視需要變更指令。
欲預先建立金鑰庫檔案並在其中儲存初始資料,您必須使用 安全性管理工具
1. PTC 支援網站取得「安全性管理工具」zip 檔。
2. 將壓縮檔的內容解壓縮至某一目錄。
3. 使用下列參數建立組態檔案並將其放置在解壓縮檔案的 bin 資料夾中。
* 
在此範例中,檔案名為 keystore.conf,工具版本為 1.0.0.36,其位於 C://security-common-cli-1.0.0.36/bin
* 
default-encryption-key-length 必須符合應用程式組態。在 ThingWorx 中,就是位於 platform-settings.jsonInternalAesCryptographicKeyLength 參數。預設為 128,但是如果您使用 Java 1.8.0_162 或更高版本,則可以使用 256 位元加密。如有必要,您也可以更新金鑰大小限制的 java 政策來與較舊的 Java 版本搭配使用。
{
security {
secret-provider = "com.thingworx.security.provider.keystore.KeyStoreProvider"
default-encryption-key-length = 128
keystore {
password-file-path = "/ThingworxPlatform"
password-file-name = "keystore-password"
path = "/ThingworxStorage"
name = "keystore"
}
}
}
4. 啟動指令提示並轉至 security-common-cli-1.0.0.36\bin 的位置。
5. 執行下列項目以於配置位置建立密碼檔案與金鑰庫:
授權密碼:
C:\security-common-cli-1.0.0.36\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.licensing.password "add-password-here"
資料庫密碼:
C:\security-common-cli-1.0.0.36\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.db.password "add-password-here"
授權 proxy 密碼:
C:\security-common-cli-1.0.0.36\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.proxy.password "add-password-here"
RabbitMQ 密碼 (如果您已安裝 ThingWorx Flow):
C:\security-common-cli-1.0.3.48\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.queue.password "add-password-here"
6. 開啟 ThingworxPlatform\platform-settings.json 並進行下列更新:
授權密碼:在 LicensingConnectionSettings 下,將 password 值變更為 encrypt.licensing.password。例如,"password": "encrypt.licensing.password"
資料庫密碼:在您正在使用之持續性提供者的 PersistenceProviderPackageConfigs ConnectionInformation 下,將 password 值變更為 encrypt.db.password。例如,"password": "encrypt.db.password"
授權 proxy 密碼:在 LicensingConnectionSettings 下,將密碼值變更為 encrypt.proxy.password。例如,"password": "encrypt.proxy.password"
RabbitMQ 密碼 (如果您已安裝 ThingWorx Flow):在 platform-settings.json 檔案中的 OrchestrationSettings 下,將 QueuePassword 值變更為 encrypt.queue.password。例如,"QueuePassword": "encrypt.queue.password"
此密碼指示 ThingWorx Platform 在金鑰庫中尋找加密密碼 (若遇到)。
加密授權與資料庫密碼 (8.3.x 及以下版本)
如需此流程的相關資訊,請參閱較舊版本的 安裝指南