保护 Liberty 批处理环境

Liberty 批处理框架允许您配置对所有批处理管理操作的基于角色的访问权及查看与批处理作业相关联的元数据和日志。

开始之前

批处理角色由批处理容器定义。单个用户可以具有多个批处理角色。
batchAdmin
batchAdmin 具有对所有批处理操作的非受限访问权。这包括以下许可权:提交新作业、停止并重新启动任何用户的作业、查看批处理域中的任何用户提交的任何作业元数据和作业日志以及清除任何作业。batchAdmin 不一定是 WebSphere® Application Server 管理员。
[18.0.0.1 and later]batchGroupAdmin
[18.0.0.1 and later]如果用户具有 bbatchGroupAdmin 角色,并且是分配作业的操作组的成员,那么他们可以访问这些作业的所有批处理操作。具有 batchGroupAdmin 角色的用户可以停止、重复、重新启动和查看任何作业,但他们无法提交新作业,除非他们还具有 batchSubmitter 角色。batchGroupAdmin 用户可查看作业元数据和作业日志,以及清除同一操作组中其他用户所提交的作业。batchGroupAdmin 不一定是 WebSphere Application Server 管理员。
batchSubmitter
batchSubmitter 有权提交新作业,但只能对他们自己的作业执行停止、停止重新或清除之类的批处理操作。batchSubmitter 不能查看或修改其他用户的作业。例如,如果 user1 和 user2 都定义为 batchSubmitter,并且 user1 提交了作业,那么 user2 不能查看与 user1 的作业相关联的作业实例数据。
batchMonitor
具有 batchMonitor 角色的用户拥有所有作业的只读许可权。此角色的用户可以查看所有作业实例和执行,并有权访问所有作业日志。具有 batchMonitor 角色的用户无法提交自己的作业,也无法停止、重新启动或清除任何作业。
[18.0.0.1 and later]batchGroupMonitor
[18.0.0.1 and later]batchGroupMonitor 拥有与用户所属操作组关联的所有作业的只读许可权。此角色的用户可以查看所有作业实例和执行,并且有权访问其操作组范围内的作业的所有作业日志。batchGroupMonitor 无法提交、停止、重新启动或清除作业。
注: 启用批处理安全性后,系统将根据授予当前用户的批处理角色来过滤返回列表的任何 JobOperator API 方法或 REST 操作。例如,如果仅具有 batchSubmitter 许可权的用户请求获取所有作业实例的列表,那么系统仅返回当前用户提交的作业实例。

过程

  1. 缺省情况下,batch-1.0 功能部件不会启用任何安全性。对于所有用户(不管他们是否经过认证),JobOperator 方法保持开放状态。这些方法保持开放状态只是用于开发目的,不需要任何安全性配置。 batchManagement-1.0 功能部件启用批处理 REST API。该 REST API 始终要求用户进行认证,即使未启用 appSecurity-2.0 功能部件也是如此,但所有用户将被视为批处理管理员并可对任何作业实例执行所有批处理操作。启用 appSecurity-2.0 后,系统将执行基于批处理角色的安全授权,并且用户被限制为只能执行向其授予的批处理角色所定义的批处理操作。
    1. 通过 JobOperator API 启用基于批处理角色的安全性。
      <featureManager>
      	<feature>batch-1.0</feature>
      	<feature>appSecurity-2.0</feature>
      </featureManager>
    2. 通过 REST API 启用基于批处理角色的安全性。
      注: batchManagement-1.0 功能部件包含 batch-1.0 功能部件。
      <featureManager>
      	<feature>batchManagement-1.0</feature>
      	<feature>appSecurity-2.0</feature>
      </featureManager>
  2. 配置 server.xml 文件以支持基于角色的安全性。 以下示例说明用于定义用户列表的基本用户注册表。此注册表将由基于批处理角色的安全配置样本使用:
    <basicRegistry id="basic" realm="ibm/api">
    	<user name="alice" password="alicepwd" />
    	<user name="bob" password="bobpwd" />
    	<user name="jane" password="janepwd" />
    	<user name="joe" password="joepwd" />
    	<user name="phyllis" password="phyllispwd" /> 
    	<user name="kai" password="kaipwd" />
    </basicRegistry>

    在此示例中,一个用户占用多个角色。

    <authorization-roles id="com.ibm.ws.batch">
    	<security-role name="batchAdmin" >	
    		<user name="alice" />	
    	</security-role>
    	<security-role name="batchSubmitter" >
    		<user name="jane" />
    		<user name="phyllis" />
    		<user name="bob"/>
    	</security-role>
    	<security-role name="batchMonitor" >
    		<user name="joe" />
    		<user name="bob"/>
    	</security-role>
    </authorization-roles>
    在此示例中,一个用户占用多个角色。所有用户具有 batchSubmitter 角色。
    <authorization-roles id="com.ibm.ws.batch">
    	<security-role name="batchAdmin" >	
    		<user name="alice" />	
    	</security-role>
    	<security-role name="batchSubmitter" >
    		<special-subject type="ALL_AUTHENTICATED_USERS"/>
    	</security-role>
    	<security-role name="batchMonitor" >
    		<user name="joe" />
    		<user name="bob"/>
    	</security-role>
    </authorization-roles>
    在此示例中,一个用户占用多个角色。所有用户(包括那些未认证用户)被允许具有 batchMonitor 角色。
    <authorization-roles id="com.ibm.ws.batch">
    	<security-role name="batchAdmin" >	
    		<user name="alice" />	
    	</security-role>
    	<security-role name="batchSubmitter" >
    		<user name="joe" />
    		<user name="bob"/>
    	</security-role>
    	<security-role name="batchMonitor" >
    		<special-subject type="EVERYONE"/>
    	</security-role>
    </authorization-roles>
    For z/OS platforms
    注: 如果已启用 zosSecurity-1.0 功能部件,那么 SAF 授权提供者将处理基于批处理角色的授权。
    SAF 授权提供者通过检查客户机对 EJBROLE 类中定义的 SAF 资源概要文件的访问级别来确定客户机的授权。缺省情况下,以下资源概要文件与批处理角色相关联。
    batchAdmin:     BBGZDFLT.com.ibm.ws.batch.batchAdmin
    batchSubmitter: BBGZDFLT.com.ibm.ws.batch.batchSubmitter
    batchMonitor:   BBGZDFLT.com.ibm.ws.batch.batchMonitor

    客户机身份必须被授予对相应资源概要文件的 READ 访问权,才能被授予相应批处理角色。

    以下示例说明用于向客户机身份 bob 授予 batchAdmin 角色权限的 RACF® 命令。

    RDEFINE EJBROLE BBGZDFLT.com.ibm.ws.batch.batchAdmin UACC(NONE)
    PERMIT BBGZDFLT.com.ibm.ws.batch.batchAdmin CLASS(EJBROLE) ID(bob) ACCESS(READ)

用于指示主题类型的图标 任务主题

文件名:twlp_batch_securing.html