私有雲 v4.18.01 的邊緣
安裝完成後,您就可以重設 OpenLDAP、Apigee Edge 系統管理員、Edge 機構使用者和 Cassandra 密碼。
重設 OpenLDAP 密碼
視您的 Edge 設定而定,OpenLDAP 的安裝方式可能如下:
- 安裝在管理伺服器節點上的 OpenLDAP 執行個體。例如:在 2 個節點、5 個節點或 9 個節點邊緣的邊緣設定中。
- 安裝在管理伺服器節點上的多個 OpenLDAP 執行個體,已設定 OpenLDAP 複製功能。例如,在 12 個節點邊緣設定中。
- 在自己的節點上安裝多個 OpenLDAP 執行個體,已設定 OpenLDAP 複製功能。例如,在 13 個節點邊緣設定中。
重設 OpenLDAP 密碼的方式取決於您的設定。
針對安裝在管理伺服器上的單一 OpenLDAP 執行個體,執行下列操作:
- 在管理伺服器節點中執行下列指令,建立新的 OpenLDAP 密碼:
> /opt/apigee/apigee-service/bin/apigee-service apigee-openldap change-ldap-password -o oldPword -n newPword - 執行下列指令,儲存要供管理伺服器存取的新密碼:
> /opt/apigee/apigee-service/bin/apigee-service Edge-management-server store_ldap_credentials -p newPword
這個指令會重新啟動管理伺服器。
在已安裝在管理伺服器節點的 OpenLDAP 節點的 OpenLDAP 複製設定中,按照上述兩個管理伺服器節點的步驟操作,以便更新密碼。
在 OpenLDAP 複製設定 (採用 OpenLDAP 執行於管理伺服器以外的節點) 中,請務必先變更 OpenLDAP 節點和兩個管理伺服器節點的密碼。
重設系統管理員密碼
重設系統管理員密碼時,您必須在下列兩個地方重設密碼:
- 管理伺服器
- UI
警告:請先停止 Edge UI,再重設系統管理員密碼。由於您會先在管理伺服器上重設密碼,因此 UI 仍在使用舊密碼的一段時間。如果使用者介面使用舊密碼進行超過三次呼叫,OpenLDAP 伺服器會鎖定系統管理員帳戶三分鐘。
如何重設系統管理員密碼:
- 在 UI 節點中停止 Edge UI:
> /opt/apigee/apigee-service/bin/apigee-service Edge-ui stop - 在管理伺服器上執行下列指令,重設密碼:
> /opt/apigee/apigee-service/bin/apigee-service Edge-management-server change_sysadmin_password -o currentPW -n newPW - 請編輯用來安裝 Edge UI 的無聲設定檔,設定下列屬性:
APIGEE_ADMINPW=newPW
SMTPHOST=smtp.gmail.com
SMTPPORT=465
SMTPPORT=foo@gmail.com
SMTPSSL=y
SMTPSSL=y
SMTP 郵件 FROM - 使用 apigee-setup 公用程式,透過設定檔重設 Edge UI 的密碼:
> /opt/apigee/apigee-setup/bin/setup.sh -p ui -f configFile - (僅限 UI 上已啟用 TLS) 請參閱設定管理 UI 的 TLS 一文,在 Edge UI 上重新啟用 TLS。
如果在有多個管理伺服器的 OpenLDAP 複製環境中,重設一個管理伺服器的密碼,系統就會自動更新其他管理伺服器。不過,您必須分別更新所有 Edge UI 節點。
重設機構使用者密碼
如要重設機構使用者的密碼,請使用 apigee-servce 公用程式叫用 apigee-setup:
/opt/apigee/apigee-service/bin/apigee-service apigee-setup reset_user_password [-h] [-u USER_EMAIL] [-p USER_PWD] [-a ADMIN_EMAIL] [-P APIGEE_ADMINPW] [-f configFile]
例如:
> /opt/apigee/apigee-service/bin/apigee-service apigee-setup reset_user_password -u user@myCo.com -p foo12345 -a admin@myCo.com -P adminPword
以下示範與「-f」選項搭配使用的設定檔範例:
USER_NAME= user@myCo.com USER_PWD= "foo12345" APIGEE_ADMINPW= adminPword
您也可以使用 Update user API 來變更使用者密碼。
Sys 管理員和機構使用者密碼規則
請在這個部分為 API 管理使用者強制執行指定的密碼長度和強度。設定會使用一系列預先設定 (且不重複的編號) 規則運算式來檢查密碼內容 (例如大寫、小寫、數字和特殊字元)。請將這些設定寫入 /opt/apigee/customer/application/management-server.properties 檔案。如果該檔案不存在,請建立一個。
編輯 management-server.properties 後,請重新啟動管理伺服器:
> /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
然後您可以將不同的規則運算式組合分組,藉此設定密碼強度評分。舉例來說,您可以判定至少有一個大寫與一個小寫英文字母的密碼獲得「3」強度評分,但密碼至少要有一個小寫英文字母和一個數字,可獲得較高的評分「4」。
資源 |
說明 |
---|---|
conf_security_password.validation.minimum。 conf_security_password.validation.default.rating=2 conf_security_password.validation.minimum。 |
用於判斷有效密碼的整體特性。密碼強度的預設最低評分為 3 (請參考下表)。 請注意,password.validation.default.rating=2 低於規定的最低評分,這表示如果輸入的密碼不符合您設定的規則,則該密碼將為 2 評分,因此為無效 (低於 3 個下限)。 |
以下為識別密碼特性的規則運算式,請注意,每個值都有編號。例如,「password.validation.regex.5=...」是運算式編號 5。您將在檔案的後續部分中使用這些數字,設定用來決定整體密碼強度的不同組合。 |
|
conf_security_password.validation.regex.1=^(.)\\1+$ |
1 - 所有字元重複 |
conf_security_password.validation.regex.2=^.*[a-z]+.*$ |
2 - 至少一個小寫字母 |
conf_security_password.validation.regex.3=^.*[A-Z]+.*$ |
3 - 至少一個大寫字母 |
conf_security_password.validation.regex.4=^.*[0-9]+.*$ |
4 - 至少 1 個數字 |
conf_security_password.validation.regex.5=^.*[^a-zA-z0-9]+.*$ |
5 - 至少一個特殊字元 (不含底線 _) |
conf_security_password.validation.regex.6=^.*[_]+.*$ |
6 - 至少一個底線 |
conf_security_password.validation.regex.7=^.*[a-z]{2,}.*$ |
7 - 超過一個小寫字母 |
conf_security_password.validation.regex.8=^.*[A-Z]{2,}.*$ |
8 - 超過一個大寫字母 |
conf_security_password.validation.regex.9=^.*[0-9]{2,}.*$ |
9 – 超過 1 個數字 |
conf_security_password.validation.regex.10=^.*[^a-zA-z0-9]{2,}.*$ |
10 - 超過一個特殊字元 (不含底線) |
conf_security_password.validation.regex.11=^.*[_]{2,}.*$ |
11 - 超過 1 個底線 |
下列規則會根據密碼內容決定密碼強度。 每項規則都包含前一節中的一或多個規則運算式,並為規則指派強度數值。密碼的數值強度會與這個檔案頂端的 conf_security_password.validation.minimum.rating.required 數字進行比較,藉此判斷密碼是否有效。 |
|
conf_security_password.validation.rule.1=1,AND,0 conf_security_password.validation.rule.2=2、3、4、AND、4 conf_security_password.validation.rule.3=2,9,AND,4 conf_security_password.validation.rule.4=3,9,AND,4 conf_security_password.validation.rule.5=5,6,OR,4 conf_security_password.validation.rule.6=3,2,AND,3 conf_security_password.validation.rule.7=2,9,AND,3 conf_security_password.validation.rule.8=3,9,AND,3 |
每項規則都有編號。例如,「password.validation.rule.3=...」就是規則編號 3。 每項規則使用下列格式 (位於等號右側): <regex-index-list>,<AND|OR>,<分級> regex-index-list 是規則運算式的清單 (依照上一節中的數字計算),以及 AND|OR 運算子 (亦即考慮所有或任何列出的運算式)。 rating:每項規則給予的分數強度評分。 舉例來說,規則 5 表示只要密碼至少有一個特殊字元,「或」一個底線獲得強度評分為 4。使用 passwords.validation.minimum。 |
conf_security_rbac.password.validation.enabled=true |
如果已啟用單一登入 (SSO),請將角色型存取權控管密碼驗證設為 false。預設值為 true。 |
重設 Cassandra 密碼
根據預設,Cassandra 出貨時會停用驗證功能。如果您啟用驗證功能,會使用名為「cassandra」的預先定義使用者'cassandra,並提供密碼「cassandra」'cassandra。您可以使用這個帳戶、為這個帳戶設定其他密碼,或是建立新的 Cassandra 使用者。使用 Cassandra CREATE/ALTER/DROP USER 陳述式新增、移除及修改使用者。
如要瞭解如何啟用 Cassandra 驗證,請參閱啟用 Cassandra 驗證。
如要重設 Cassandra 密碼,您必須執行以下操作:
- 在任何 Cassandra 節點上設定密碼,該密碼就會廣播到環環中的所有 Cassandra 節點
- 更新每個節點上的管理伺服器、訊息處理器、路由器、Qpid 伺服器、Postgres 伺服器和 BaaS 堆疊,透過新的密碼更新
詳情請參閱 http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/cqlCommandsTOC.html。
如何重設 Cassandra 密碼:
- 使用 cqlsh 工具和預設憑證登入任一 Cassandra 節點。?您只需要在一個 Cassandra 節點上變更密碼,系統會向該環中的所有 Cassandra 節點廣播:
> /opt/apigee/apigee-cassandra/bin/cqlsh cassIP 9042 -u cassandra -p cassandra
- cassIP 是 Cassandra 節點的 IP 位址。
- 9042 是 Cassandra 通訊埠。
- 預設使用者為 cassandra。
- 預設密碼為 cassandra。如果之前變更過密碼,請使用目前的密碼。
- 在 cqlsh> 提示中執行下列指令,以更新密碼:
cqlsh> ALTER USER cassandra WITH PASSWORD 'NEW_PASSWORD';
如果新密碼含有單引號字元,請在新密碼前面加上單引號字元進行逸出。 - 結束 cqlsh 工具:
cqlsh> exit - 在管理伺服器節點中,執行下列指令:
> /opt/apigee/apigee-service/bin/apigee-service Edge-management-server store_cassandra_credentials -u CASS_USERNAME -p CASS_PASSWORD
或者,你可以將包含新使用者名稱與密碼的「apigeeFile=USERNAMESS」指令。 - 重複步驟 4:
- 所有訊息處理器
- 所有路由器
- 所有 Qpid 伺服器 (edge-qpid-server)
- Postgres 伺服器 (edge-postgres-server)
- 在 4.16.05.04 以上版本的 BaaS Stack 節點上:
- 執行下列指令,產生已加密的密碼:
> /opt/apigee/apigee-service/bin/apigee-service baas-usergrid secure_password
這個指令會提示你輸入純文字密碼,並傳回經過加密的密碼,格式為:
SECURE:ae1b6dedbf6b26aaab8bec035030301301523 - 在 /opt/apigee/customer/application/usergrid.properties 設定下列權杖。如果該檔案不存在,請建立檔案:
usergrid-deployment_cassandra.username=cassandra
usergrid-deployment_cassandra.password=SECURE:ae1b6dedbf6b26aaab8bee815a910737c1c15b55f3505c50 <使用者名稱>
如果您變更了使用者名稱,請據此設定 usergrid-deployment_cassandra.username 的值。
請務必在密碼中加入「SECURE:」前置字串。否則,BaaS Stack 會將這個值解讀為未加密。
注意:每個 BaaS 堆疊節點都有專屬的密碼,用來加密密碼。因此,您必須分別為各個 BaaS Stack 節點產生加密值。 - 將 usergrid.properties 檔案的擁有權變更為「apigee」使用者:
> chown apigee:apigee /opt/apigee/customer/application/usergrid.properties - 設定堆疊節點:
> /opt/apigee/apigee-service/bin/apigee-service baas-usergrid 設定 - 重新啟動 BaaS 堆疊:
> /opt/apigee/apigee-service/bin/apigee-service baas-usergrid restart - 針對所有 BaaS Stack 論點重複上述步驟。
- 執行下列指令,產生已加密的密碼:
Cassandra 密碼現已變更。
重設 PostgreSQL 密碼
根據預設,PostgreSQL 資料庫定義了兩位使用者:「postgres」和「apigee」。雙方的預設密碼皆為「postgres」。請使用以下程序變更預設密碼。
變更所有 Postgres 主要節點的密碼。如果您之前在主要/待命模式下設定了兩個 Postgres 伺服器,則只需要變更主要節點上的密碼。詳情請參閱設定 Postgres 的主要待命複製功能一文。
- 在主要 Postgres 節點上,將目錄變更為 /opt/apigee/apigee-postgresql/pgsql/bin。
- 設定 PostgreSQL 的「postgres」使用者密碼:
- 使用下列指令登入 PostgreSQL 資料庫:
> psql -h localhost -d apigee -U postgres - 系統提示時,輸入「postgres」使用者密碼,例如「postgres」。
- 在 PostgreSQL 命令提示字元中,輸入下列指令以變更預設密碼:
apigee=> ALTER USER Postgres WITH PASSWORD 'apigee1234'; - 使用下列指令退出 PostgreSQL 資料庫:
apigee=> \q
- 使用下列指令登入 PostgreSQL 資料庫:
- 設定 PostgreSQL「apigee」使用者密碼:
- 使用下列指令登入 PostgreSQL 資料庫:
> psql -h localhost -d apigee -U apigee - 系統提示時,輸入「apigee」使用者密碼,並設為「postgres」。
- 在 PostgreSQL 命令提示字元中,輸入下列指令來變更預設密碼:
apigee=> ALTER USER apigee WITH PASSWORD 'apigee1234'; - 使用下列指令退出 PostgreSQL 資料庫:
apigee=> \q
- 使用下列指令登入 PostgreSQL 資料庫:
- 設定 APIGEE_HOME:
> export APIsGEE_HOME=/opt/apigee/edge-postgres-server - 加密新密碼:
> sh /opt/apigee/edge-postgres-server/utils/scripts/utilities/passwordgen.sh apigee1234
這個指令會傳回已加密的密碼,如下所示。加密密碼的開頭為「:」字元,而且不包含「:」。
加密字串 :WheaR8U4OeMEM11erxA3Cw== - 使用新的「postgres」和「apigee」使用者適用的新加密密碼更新管理伺服器節點。
- 在管理伺服器上,將目錄變更為 /opt/apigee/customer/application。
- 編輯 management-server.properties 檔案,即可設定下列屬性。如果這個檔案不存在,請建立檔案:
注意:部分屬性會使用已加密的「postgres」使用者密碼,有些屬性則會使用已加密的「apigee」使用者密碼。- conf_pg-agent_password=newEncryptedPasswordForPostgresUser
- conf_pg-ingest_password=newEncryptedPasswordForPostgresUser
- conf_query-service_pgDefaultPwd=newEncryptedPasswordForApigeeUser
- conf_query-service_dwDefaultPwd=newEncryptedPasswordForApigeeUser
- conf_analytics_aries.pg.password=newEncryptedPasswordForPostgresUser
- 確認檔案擁有者為「apigee」的使用者:
> chown apigee:apigee:apigee: management-server.properties
- 使用新的加密密碼更新所有 Postgres 伺服器和 Qpid Server 節點。
- 在 Postgres Server 或 Qpid Server 節點上,將目錄變更為 /opt/apigee/customer/application。
- 編輯下列檔案。如果這些檔案不存在,請建立這些檔案:
- postgres-server.properties
- qpid-server.properties
- 在檔案中加入下列屬性:
注意:這些屬性均會使用加密的「postgres」使用者密碼。- conf_pg-agent_password=newEncryptedPasswordForPostgresUser
- conf_pg-ingest_password=newEncryptedPasswordForPostgresUser
- conf_query-service_pgDefaultPwd=newEncryptedPasswordForPostgresUser
- conf_query-service_dwDefaultPwd=newEncryptedPasswordForPostgresUser
- conf_analytics_aries.pg.password=newEncryptedPasswordForPostgresUser
- 請確定檔案屬於「apigee」使用者:
> chown apigee:apigee:postgres-server.properties
> chown apigee:apigee qpid-server.properties
- 請依序重新啟動下列元件:
- PostgreSQL 資料庫:
> /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql restart - Qpid Server:
> /opt/apigee/apigee-service/bin/apigee-service Edge-qpid-server restart - Postgres 伺服器:
> /opt/apigee/apigee-service/bin/apigee-service Edge-postgres-server restart - 管理伺服器:
> /opt/apigee/apigee-service/bin/apigee-service Edge-management-server restart
- PostgreSQL 資料庫: