首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何根据Artemis web控制台中的地址拆分权限

如何根据Artemis web控制台中的地址拆分权限
EN

Stack Overflow用户
提问于 2022-09-15 13:36:41
回答 1查看 38关注 0票数 0

你好,一项任务:对于每个用户,给出操作的权限(列表、获取、浏览等等)只在他们的地址上。地址的权限在broker.xml中发布。

目前,任何具有浏览角色的用户都可以从任意地址读取消息。

引发具有域身份验证的Artemis集群。我们通过broker.xml向域用户的地址颁发权限。我们希望使域用户能够通过web管理他们的地址/队列。授予artemis.profile配置中的域用户组的权限,所有域用户都可以访问web。

授予域用户组对management.xml文件中的方法的权限,所有域用户都可以在所有队列中使用允许的方法,包括浏览方法(允许您读取消息)。

是否有可能限制web中的访问,以便域用户只能在其队列上使用允许的方法(在broker.xml中授予权限),或者您是否需要为management.xml中的每个队列指定方法块(您可以使用掩码),并授予方法单独组的权限?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-16 01:05:26

一般来说,ActiveMQ Artemis支持基于角色的访问控制(即RBAC),因此每个需要唯一权限的用户都需要处于一个独特的角色中。

ActiveMQ Artemis中的web控制台基于Hawtio,它使用Jolokia ( JMX桥)与代理中的JMX MBeans进行通信。在etc/management.xml中配置了对Jolokia的授权。以下是默认内容:

代码语言:javascript
运行
复制
<management-context xmlns="http://activemq.apache.org/schema">
   <!--<connector connector-port="1099"/>-->
   <authorisation>
      <allowlist>
         <entry domain="hawtio"/>
      </allowlist>
      <default-access>
         <access method="list*" roles="amq"/>
         <access method="get*" roles="amq"/>
         <access method="is*" roles="amq"/>
         <access method="set*" roles="amq"/>
         <access method="*" roles="amq"/>
      </default-access>
      <role-access>
         <match domain="org.apache.activemq.artemis">
            <access method="list*" roles="amq"/>
            <access method="get*" roles="amq"/>
            <access method="is*" roles="amq"/>
            <access method="set*" roles="amq"/>
            <!-- Note count and browse are need to access the browse tab in the console-->
            <access method="browse*" roles="amq"/>
            <access method="count*" roles="amq"/>
            <access method="*" roles="amq"/>
         </match>
         <!--example of how to configure a specific object-->
         <!--<match domain="org.apache.activemq.artemis" key="subcomponent=queues">
            <access method="list*" roles="view,update,amq"/>
            <access method="get*" roles="view,update,amq"/>
            <access method="is*" roles="view,update,amq"/>
            <access method="set*" roles="update,amq"/>
            <access method="*" roles="amq"/>
         </match>-->
      </role-access>
   </authorisation>
</management-context>

domainkey基于代理上JMX MBean的名称。例如,代理“MBean”上地址"myAddress“上名为"myQueue”的anycast队列的名称是:

代码语言:javascript
运行
复制
org.apache.activemq.artemis:broker=myBroker,component=addresses,address="myAddress",subcomponent=queues,routing-type="anycast",queue="myQueue"

因此,如果您只希望角色"myRole“中的用户能够浏览队列"myQueue”上的消息,那么您将得到如下匹配:

代码语言:javascript
运行
复制
         <match domain="org.apache.activemq.artemis" key="queue=myQueue">
            <access method="list*" roles="myRole"/>
            <access method="get*" roles="myRole"/>
            <access method="is*" roles="myRole"/>
            <access method="set*" roles="myRole"/>
            <access method="browse*" roles="myRole"/>
            <access method="count*" roles="myRole"/>
            <access method="*" roles="myRole"/>
         </match>

请记住,默认情况下,只有通过具有amq角色的用户才允许对控制台的访问。这是通过系统属性etc/artemis.profile-Dhawtio.role=amq中配置的。您可以通过将其更改为-Dhawtio.roles=amq,myRole来配置多个角色。

您可以在文献资料中找到更多细节。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73732151

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档