重置 Edge 密码

完成安装后,您可以重置以下密码:

以下部分介绍了如何重置这些密码。

重置 SymasLDAP 密码

重置 SymasLDAP 密码的方式取决于您的配置。根据您的 Edge 配置,SymasLDAP 可以安装为:

  • 安装在管理服务器节点上的单个 SymasLDAP 实例。例如,在 2 节点、5 节点或 9 节点 Edge 配置中。
  • 安装在管理服务器节点上的多个 SymasLDAP 实例,配置了 SymasLDAP 复制。例如,在 12 节点 Edge 配置中。
  • 安装在自己的节点上的多个 SymasLDAP 实例,配置了 SymasLDAP 复制。例如,在 13 节点 Edge 配置中。

对于安装在管理服务器上的单个 SymasLDAP 实例,请执行以下操作:

  1. 在管理服务器节点上,运行以下命令以创建新的 SymasLDAP 密码:
    /opt/apigee/apigee‑service/bin/apigee‑service apigee‑openldap \ 
      change‑ldap‑password ‑o OLD_PASSWORD ‑n NEW_PASSWORD
  2. 运行以下命令以存储新密码,供管理服务器访问:
    /opt/apigee/apigee‑service/bin/apigee‑service edge‑management‑server \ 
      store_ldap_credentials ‑p NEW_PASSWORD

    此命令会重启管理服务器。

在SymasLDAP 复制设置(SymasLDAP 安装在管理服务器 节点上)中,请在两个管理服务器节点上按照上述步骤更新 密码。

在 SymasLDAP 复制设置(SymasLDAP 位于非管理 服务器 的节点上)中,请确保先更改两个 SymasLDAP 节点上的密码,然后再更改两个 管理服务器节点上的密码。

重置系统管理员密码

重置系统管理员密码需要您在两个位置重置密码:

  • 管理服务器
  • 新 Edge 界面

如需重置系统管理员密码,请执行以下操作:

  1. 修改用于安装新 Edge 界面的静默配置文件,以设置以下 属性:
    APIGEE_ADMINPW=NEW_PASSWORD
    SMTPHOST=smtp.gmail.com
    SMTPPORT=465
    SMTPUSER=foo@gmail.com
    SMTPPASSWORD=bar
    SMTPSSL=y
    SMTPMAILFROM="My Company <myco@company.com>"

    请注意,您必须在传递新密码时添加 SMTP 属性,因为新 Edge 界面上的所有 属性都会重置。

  2. 在新 Edge 界面节点上,停止新 Edge 界面:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-ui stop
  3. 使用 apigee-setup 实用程序通过配置文件重置新 Edge 界面上的密码:
    /opt/apigee/apigee-setup/bin/setup.sh -p ue -f configFile
  4. (仅当在新 Edge 界面上启用了 TLS 时) 按照 为新 Edge 界面配置 TLS中的说明,在新 Edge 界面上重新启用 TLS。
  5. 在管理服务器上,创建一个新的 XML 文件。在此文件中,将用户 ID 设置为“admin” 并使用以下格式定义密码、名字、姓氏和电子邮件地址:
    <User id="admin">
      <Password><![CDATA[password]]></Password>
      <FirstName>first_name</FirstName>
      <LastName>last_name</LastName>
      <EmailId>email_address</EmailId>
    </User>
  6. 在管理服务器上,执行以下命令:
    curl -u "admin_email_address:admin_password" -H \
    "Content-Type: application/xml" -H "Accept: application/json" -X POST \
    "http://localhost:8080/v1/users/admin_email_address" -d @your_data_file
    

    其中,your_data_file 是您在上一步中创建的文件。

    Edge 会在管理服务器上更新您的管理员密码。

  7. 删除您创建的 XML 文件。密码绝不应以明文形式永久存储。

在具有多个管理服务器的 SymasLDAP 复制 环境中,在一个管理服务器上重置密码会自动更新其他管理服务器 。但是,您必须单独更新所有新 Edge 界面节点。

重置组织用户密码

如需重置组织用户的密码,请使用 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
cp ~/Documents/tmp/hybrid_root/apigeectl_beta2_a00ae58_linux_64/README.md 
  ~/Documents/utilities/README.md

下面是一个示例配置文件,您可以将其与“-f”选项搭配使用:

USER_NAME=user@myCo.com
USER_PWD="Foo12345"
APIGEE_ADMINPW=ADMIN_PASSWORD

您还可以使用 Update user API 更改用户密码。

系统管理员和组织用户密码规则

您可以使用此部分为 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.password.length=8
conf_security_password.validation.default.rating=2
conf_security_password.validation.minimum.rating.required=3

使用这些属性来确定有效密码的总体特征。密码强度的默认 最低评级(稍后在表中介绍)为 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:至少一个数字

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:多个数字

conf_security_password.validation.regex.10=^.*[^a-zA-z0-9]{2,}.*$

10:多个特殊字符(不包括下划线)

conf_security_password.validation.regex.11=^.*[_]{2,}.*$

11:多个下划线

以下规则根据密码内容确定密码强度。 每条规则都包含上一部分中的一个或多个正则表达式,并为其分配 一个数字强度。系统会将密码的数字强度与此文件顶部的 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],rating

regex-index-list 是正则表达式列表(按上一部分中的编号),以及 AND|OR 运算符(表示考虑列出的所有或任何表达式)。

rating 是分配给每条规则的数字强度评级。

例如,规则 5 表示至少包含一个特殊字符或一个 下划线的任何密码的强度评级为 4。如果文件顶部有 password.validation.minimum.rating.required=3 ,则评级为 4 的密码是有效的。

conf_security_rbac.password.validation.enabled=true

启用单点登录 (SSO) 后,将基于角色的访问控制密码验证设置为 false。默认值为 True。

重置 Cassandra 密码

默认情况下,Cassandra 附带的身份验证处于停用状态。如果您启用身份验证,它 会使用预定义的用户(名为 cassandra,密码为 cassandra)。您可以使用此账号, 为此账号设置不同的密码,或创建新的 Cassandra 用户。使用 Cassandra CREATE/ALTER/DROP USER 语句添加、移除和 修改用户。

如需了解如何启用 Cassandra 身份验证,请参阅启用 Cassandra 身份验证。

如需重置 Cassandra 密码,您必须:

  • 在任何一个 Cassandra 节点上设置密码,该密码将广播到环中的所有 Cassandra 节点
  • 使用新密码更新每个节点上的管理服务器、消息处理器、路由器、Qpid 服务器和 Postgres 服务器

如需了解详情,请参阅 CQL 命令。

如需重置 Cassandra 密码,请执行以下操作:

  1. 使用 cqlsh 工具和默认 凭据登录到任何一个 Cassandra 节点。您只需在一个 Cassandra 节点上更改密码,该密码将广播到环中的所有 Cassandra 节点:
    /opt/apigee/apigee-cassandra/bin/cqlsh cassIP 9042 -u cassandra -p 'cassandra'

    其中:

    • cassIP 是 Cassandra 节点的 IP 地址。
    • 9042 是 Cassandra 端口。
    • 默认用户为 cassandra。
    • 默认密码为“cassandra”。如果您之前更改过密码, 请使用当前密码。如果密码包含任何特殊字符,您必须将其用单引号括起来。
  2. 在 cqlsh> 提示符下执行以下命令,以更新密码:
    ALTER USER cassandra WITH PASSWORD 'NEW_PASSWORD';

    如果新密码包含单引号字符,请在该字符前面添加一个 单引号字符以进行转义。

  3. 退出 cqlsh 工具:
    exit
  4. 在管理服务器节点上,运行以下命令:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server store_cassandra_credentials -u CASS_USERNAME -p 'CASS_PASSWORD'

    (可选)您可以将包含新用户名和密码的文件传递给该命令:

    apigee-service edge-management-server store_cassandra_credentials -f configFile

    其中,configFile 包含以下内容:

    CASS_USERNAME=CASS_USERNAME
    CASS_PASSWORD='CASS_PASSWROD'

    此命令会自动重启管理服务器。

  5. 在以下项上重复第 4 步:
    • 所有消息处理器
    • 所有路由器
    • 所有 Qpid 服务器 (edge-qpid-server)
    • Postgres 服务器 (edge-postgres-server)

Cassandra 密码现已更改。

重置 PostgreSQL 密码

默认情况下,PostgreSQL 数据库定义了两个用户:postgres 和 apigee。 这两个用户的默认密码均为 postgres。请按照以下步骤更改 默认密码。

更改所有 Postgres 主节点上的密码。如果您在主/备模式下配置了两个 Postgres 服务器 ,则只需更改主节点上的密码。如需了解详情,请参阅 为 Postgres 设置主备复制 。

  1. 在主 Postgres 节点上,将目录更改为 /opt/apigee/apigee-postgresql/pgsql/bin。
  2. 设置 PostgreSQL postgres 用户密码:
    1. 使用以下命令登录到 PostgreSQL 数据库:
      psql -h localhost -d apigee -U postgres
    2. 系统提示时,输入现有的 postgres 用户密码,即 postgres。
    3. 在 PostgreSQL 命令提示符下,输入以下命令以更改默认 密码:
      ALTER USER postgres WITH PASSWORD 'new_password';

      成功后,PostgreSQL 会返回以下内容:

      ALTER ROLE
    4. 使用以下命令退出 PostgreSQL 数据库:
      \q
  3. 设置 PostgreSQL apigee 用户密码:
    1. 使用以下命令登录到 PostgreSQL 数据库:
      psql -h localhost -d apigee -U apigee
    2. 系统提示时,输入 apigee 用户密码,即 postgres。
    3. 在 PostgreSQL 命令提示符下,输入以下命令以更改默认 密码:
      ALTER USER apigee WITH PASSWORD 'new_password';
    4. 使用以下命令退出 PostgreSQL 数据库:
      \q

    您可以将 postgres 和 apigee 用户的密码设置为相同的值或不同的 值。

  4. 设置 APIGEE_HOME:
    export APIGEE_HOME=/opt/apigee/edge-postgres-server
  5. 加密新密码:
    sh /opt/apigee/edge-analytics/utils/scripts/utilities/passwordgen.sh new_password

    此命令会返回加密后的密码。加密后的密码从“:”字符后开始,不包含“:”;例如,“apigee1234”的加密密码为:

    Encrypted string:WheaR8U4OeMEM11erxA3Cw==
  6. 使用 加密 密码更新管理服务器节点,以用于 postgres 和 apigee 用户。
    1. 在管理服务器上,将目录更改为 /opt/apigee/customer/application。
    2. 修改 management-server.properties 文件以设置以下属性。 如果此文件不存在,请创建它。
    3. 确保该文件归 apigee 用户所有:
      chown apigee:apigee management-server.properties
  7. 使用新的加密密码更新所有 Postgres 服务器和 Qpid 服务器节点。
    1. 在 Postgres 服务器或 Qpid 服务器节点上,更改为以下目录:
      /opt/apigee/customer/application
    2. 打开以下文件进行修改:
      • postgres-server.properties
      • qpid-server.properties

      如果这些文件不存在,请创建它们。

    3. 将以下属性添加到文件中:
      • 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
    4. 确保这些文件归 apigee 用户所有:
      chown apigee:apigee postgres-server.properties
      chown apigee:apigee qpid-server.properties
  8. 按以下顺序重启以下组件:
    1. PostgreSQL 数据库:
      /opt/apigee/apigee-service/bin/apigee-service apigee-postgresql restart
    2. Qpid 服务器:
      /opt/apigee/apigee-service/bin/apigee-service edge-qpid-server restart
    3. Postgres 服务器:
      /opt/apigee/apigee-service/bin/apigee-service edge-postgres-server restart
    4. 管理服务器:
      /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart