第 20 章 安全管理
安全管理是管理用户、组和权限的过程。您可以从 Business Central Security Management 页面控制对 Business Central 资源和功能的访问。
Business Central 为安全管理定义了三种类型的实体:用户、组和角色。您可以为角色和组分配权限。用户从用户所属的组和角色继承权限。
20.1. 安全管理供应商
在安全管理上下文中,域限制对不同应用程序资源的访问。realm 包含有关用户、组、角色和权限的信息。特定域的 concrete 用户和组管理服务实施称为安全管理提供程序。
如果内置安全管理提供程序不符合应用程序安全域的要求,您可以构建并注册您自己的安全管理提供程序。
如果没有安装安全管理提供程序,则不支持管理安全域的用户界面。安装和配置安全管理提供程序后,在安全管理用户界面中会自动启用用户和组管理功能。
Business Central 包括红帽 JBoss EAP 安全管理提供程序,它支持基于 application-users.properties
或 application-roles.properties
属性文件的内容的域类型。
20.1.1. 根据属性文件配置 Red Hat JBoss EAP 安全管理供应商
您可以构建并注册您自己的 Red Hat JBoss EAP 安全管理供应商。要根据属性文件使用 Red Hat JBoss EAP 安全管理供应商,请完成以下步骤。
先决条件
- 安装了红帽 JBoss EAP。
流程
要使用红帽 JBoss EAP 实例中的现有用户或角色属性文件,请在
EAP_HOME/standalone/configuration/application-users.properties
和EAP_HOME/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"/>
<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! 下表提供了这些属性的描述和默认值:
表 20.1. 基于属性文件的 Red Hat 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
在应用程序的根目录中创建
security-management.properties
文件。例如,创建以下文件:src/main/resources/security-management.properties
src/main/resources/security-management.properties
Copy to Clipboard Copied! 在以下系统属性和安全供应商名称作为
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!
20.1.2. 根据属性文件和 CLI 模式配置 Red Hat JBoss EAP 安全管理提供程序
要根据属性文件和 CLI 模式使用 Red Hat JBoss EAP 安全管理提供程序,请完成此流程中的步骤。
先决条件
- 安装了红帽 JBoss EAP。
流程
要使用红帽 JBoss EAP 实例中的现有用户或角色属性文件,请在
EAP_HOME/standalone/configuration/application-users.properties
和EAP_HOME/standalone/configuration/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! 下表提供了这些属性的描述和默认值:
表 20.2. 基于属性文件和 CLI 模式的 Red Hat 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
在应用程序的根目录中创建
security-management.properties
文件。例如,创建以下文件:src/main/resources/security-management.properties
src/main/resources/security-management.properties
Copy to Clipboard Copied! 在以下系统属性和安全供应商名称作为
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!