第 49 章 安全管理

安全管理是管理用户、组和权限的过程。您可以从 Business Central Security 管理页面控制对 Business Central 资源的访问和功能。

Business Central 为安全管理定义了三种类型的实体:用户、组和角色。您可以为角色和组分配权限。用户从用户所属的组和角色继承权限。

49.1. 安全管理供应商

在安全管理上下文中,域限制访问不同的应用资源。realm 包含有关用户、组、角色和权限的信息。特定域的 concrete 用户和组管理服务实施称为安全管理提供程序。

如果内置的安全管理提供程序没有满足应用程序安全性域的要求,您可以构建和注册自己的安全管理供应商。

注意

如果没有安装安全管理提供程序,则管理安全域的用户界面将不可用。在安装和配置安全管理提供程序后,用户和组管理功能会在安全管理用户界面中自动启用。

Business Central 包括红帽 JBoss EAP 安全管理提供商,它支持基于 application-users.propertiesapplication-roles.properties 属性文件的内容的域类型。

49.1.1. 根据属性文件配置红帽 JBoss EAP 安全管理提供程序

您可以构建和注册您自己的红帽 JBoss EAP 安全管理供应商。要基于属性文件使用红帽 JBoss EAP 安全管理提供程序,请完成以下步骤。

先决条件

  • 安装了红帽 JBoss EAP。

流程

  1. 要使用红帽 JBoss EAP 实例中的现有用户或角色属性,请在 EAP_HOME/standalone/configuration/application-users.propertiesEAP_HOME/standalone/application-roles.properties 文件中包含以下系统属性,如下例所示:

    <property name="org.uberfire.ext.security.management.wildfly.properties.realm" value="ApplicationRealm"/>
    <property name="org.uberfire.ext.security.management.wildfly.properties.users-file-path" value="/standalone/configuration/application-users.properties"/>
    <property name="org.uberfire.ext.security.management.wildfly.properties.groups-file-path" value="/standalone/configuration/application-roles.properties"/>

    下表提供了这些属性的描述和默认值:

    表 49.1. 基于属性文件的红帽 JBoss EAP 安全管理供应商

    属性描述默认值

    org.uberfire.ext.security.management.wildfly.properties.realm

    域的名称。这个属性不是必须的。

    ApplicationRealm

    org.uberfire.ext.security.management.wildfly.properties.users-file-path

    用户属性文件的绝对路径。这个属性是必需的。

    ./standalone/configuration/application-users.properties

    org.uberfire.ext.security.management.wildfly.properties.groups-file-path

    groups 属性文件的绝对文件路径。这个属性是必需的。

    ./standalone/configuration/application-roles.properties

  2. 在应用程序的根目录中创建 security-management.properties 文件。例如,创建以下文件:

    src/main/resources/security-management.properties
  3. security-management.properties 文件中输入以下系统属性和安全供应商名称作为值:

    <property name="org.uberfire.ext.security.management.api.userManagementServices" value="WildflyUserManagementService"/>

49.1.2. 根据属性文件和 CLI 模式配置红帽 JBoss EAP 安全管理供应商

要基于属性文件和 CLI 模式使用红帽 JBoss EAP 安全管理提供程序,请完成以下步骤。

先决条件

  • 安装了红帽 JBoss EAP。

流程

  1. 要使用红帽 JBoss EAP 实例中的现有用户或角色属性,请在 EAP_HOME/standalone/configuration/application-users.propertiesEAP_HOME/standalone/application-roles.properties 文件中包含以下系统属性,如下例所示:

    <property name="org.uberfire.ext.security.management.wildfly.cli.host" value="localhost"/>
    <property name="org.uberfire.ext.security.management.wildfly.cli.port" value="9990"/>
    <property name="org.uberfire.ext.security.management.wildfly.cli.user" value="<USERNAME>"/>
    <property name="org.uberfire.ext.security.management.wildfly.cli.password" value="<USER_PWD>"/>
    <property name="org.uberfire.ext.security.management.wildfly.cli.realm" value="ApplicationRealm"/>

    下表提供了这些属性的描述和默认值:

    表 49.2. 基于属性文件和 CLI 模式的红帽 JBoss EAP 安全管理供应商

    属性描述默认值

    org.uberfire.ext.security.management.wildfly.cli.host

    原生管理接口主机。

    localhost

    org.uberfire.ext.security.management.wildfly.cli.port

    原生管理接口端口。

    9990

    org.uberfire.ext.security.management.wildfly.cli.user

    原生管理接口用户名。

    不适用

    org.uberfire.ext.security.management.wildfly.cli.password

    原生管理接口用户的密码。

    不适用

    org.uberfire.ext.security.management.wildfly.cli.realm

    供应用的安全上下文使用的域。

    ApplicationRealm

  2. 在应用程序的根目录中创建 security-management.properties 文件。例如,创建以下文件:

    src/main/resources/security-management.properties
  3. security-management.properties 文件中输入以下系统属性和安全供应商名称作为值:

    <property name="org.uberfire.ext.security.management.api.userManagementServices" value="WildflyCLIUserManagementService"/>