第 25 章 安全管理
安全管理是管理用户、组和权限的过程。您可以从 Business Central Security 管理页面控制对 Business Central 资源的访问和功能。
Business Central 为安全管理定义了三种类型的实体:用户、组和角色。您可以为角色和组分配权限。用户从用户所属的组和角色继承权限。
25.1. 安全管理供应商 复制链接链接已复制到粘贴板!
在安全管理上下文中,域限制访问不同的应用资源。realm 包含有关用户、组、角色和权限的信息。特定域的 concrete 用户和组管理服务实施称为安全管理提供程序。
如果内置的安全管理提供程序没有满足应用程序安全性域的要求,您可以构建和注册自己的安全管理供应商。
如果没有安装安全管理提供程序,则管理安全域的用户界面将不可用。在安装和配置安全管理提供程序后,用户和组管理功能会在安全管理用户界面中自动启用。
Business Central 包括红帽 JBoss EAP 安全管理提供商,它支持基于 application-users.properties 或 application-roles.properties 属性文件的内容的域类型。
25.1.1. 根据属性文件配置红帽 JBoss EAP 安全管理提供程序 复制链接链接已复制到粘贴板!
您可以构建和注册您自己的红帽 JBoss EAP 安全管理供应商。要基于属性文件使用红帽 JBoss EAP 安全管理提供程序,请完成以下步骤。
先决条件
- 安装了红帽 JBoss EAP。
流程
要使用红帽 JBoss EAP 实例中的现有用户或角色属性,请在
EAP_HOME/standalone/configuration/application-users.properties和EAP_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"/>
<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"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 下表提供了这些属性的描述和默认值:
Expand 表 25.1. 基于属性文件的红帽 JBoss EAP 安全管理供应商 属性 描述 默认值 org.uberfire.ext.security.management.wildfly.properties.realm域的名称。这个属性不是必须的。
ApplicationRealmorg.uberfire.ext.security.management.wildfly.properties.users-file-path用户属性文件的绝对路径。这个属性是必需的。
./standalone/configuration/application-users.propertiesorg.uberfire.ext.security.management.wildfly.properties.groups-file-pathgroups 属性文件的绝对文件路径。这个属性是必需的。
./standalone/configuration/application-roles.properties在应用程序的根目录中创建
security-management.properties文件。例如,创建以下文件:src/main/resources/security-management.properties
src/main/resources/security-management.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow 在
security-management.properties文件中输入以下系统属性和安全供应商名称作为值:<property name="org.uberfire.ext.security.management.api.userManagementServices" value="WildflyUserManagementService"/>
<property name="org.uberfire.ext.security.management.api.userManagementServices" value="WildflyUserManagementService"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
25.1.2. 根据属性文件和 CLI 模式配置红帽 JBoss EAP 安全管理供应商 复制链接链接已复制到粘贴板!
要基于属性文件和 CLI 模式使用红帽 JBoss EAP 安全管理提供程序,请完成以下步骤。
先决条件
- 安装了红帽 JBoss EAP。
流程
要使用红帽 JBoss EAP 实例中的现有用户或角色属性,请在
EAP_HOME/standalone/configuration/application-users.properties和EAP_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"/>
<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"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 下表提供了这些属性的描述和默认值:
Expand 表 25.2. 基于属性文件和 CLI 模式的红帽 JBoss EAP 安全管理供应商 属性 描述 默认值 org.uberfire.ext.security.management.wildfly.cli.host原生管理接口主机。
localhostorg.uberfire.ext.security.management.wildfly.cli.port原生管理接口端口。
9990org.uberfire.ext.security.management.wildfly.cli.user原生管理接口用户名。
不适用
org.uberfire.ext.security.management.wildfly.cli.password原生管理接口用户的密码。
不适用
org.uberfire.ext.security.management.wildfly.cli.realm供应用的安全上下文使用的域。
ApplicationRealm在应用程序的根目录中创建
security-management.properties文件。例如,创建以下文件:src/main/resources/security-management.properties
src/main/resources/security-management.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow 在
security-management.properties文件中输入以下系统属性和安全供应商名称作为值:<property name="org.uberfire.ext.security.management.api.userManagementServices" value="WildflyCLIUserManagementService"/>
<property name="org.uberfire.ext.security.management.api.userManagementServices" value="WildflyCLIUserManagementService"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow