security - 使用自定义 JAAS 访问 Jolokia
问题描述
在 ActiveMQ Artemis 中,当我将requisite
orrequired
标志与我的自定义 JAAS 登录模块一起使用时,我无法登录到 Artemis 管理控制台(Jolokia,端口8163
)。我在对移动设备进行身份验证的自定义 JAAS 登录模块中有特殊的业务逻辑。但同时我希望有一个管理员用户可以使用一些用户名/密码甚至没有密码登录到 Artemis 管理控制台。为了在 Artemis 中同时拥有自定义和访客登录模块login.config
,我必须将自定义 JAAS 模块的安全标志保持为sufficient
至少。我该如何处理这种情况?
解决方案
Hawtio 使用的安全“领域”是通过hawtio.realm
. etc/artemis.profile
例如,这是默认值:
JAVA_ARGS=" -XX:+PrintClassHistogram -XX:+UseG1GC -Xms512M -Xmx2G -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml -Djon.id=amq"
这里hawtio.realm
设置为activemq
与 default 中的条目匹配login.config
,例如:
activemq {
org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule sufficient
debug=false
reload=true
org.apache.activemq.jaas.properties.user="artemis-users.properties"
org.apache.activemq.jaas.properties.role="artemis-roles.properties";
org.apache.activemq.artemis.spi.core.security.jaas.GuestLoginModule sufficient
debug=false
org.apache.activemq.jaas.guest.user="myUser"
org.apache.activemq.jaas.guest.role="amq";
};
我看不出有什么理由不能专门为 Hawtio 添加新的领域/域login.config
,然后更改配置artemis.profile
以引用它。这样,您可以根据需要自定义 Hawtio 连接和消息连接的安全性。
此外,值得注意的是,Artemis 最近增加了对每个接受者安全域的支持。您可以在文档中阅读有关此内容的更多信息。
推荐阅读
- c - 避免 IDT 挂钩中的页面错误
- angular - Angular 材料在 Angular 9 中不起作用
- javascript - 如何在本地安排 React 中的重复网络通知?
- tomcat - 解析要发送到 ftp 的 pdf 图像时内存泄漏/峰值
- mongodb - 通过移动文件而不是转储/恢复将现有的 MongoDb 部署移动到 directoryperdb
- java - 将大数据对象缓存到 Hazlecast 的最佳方法是什么
- java - Android Studio - 找不到与包名称“''匹配的客户端
- python - 用元素名称替换索引,保持名称的顺序而不是索引的顺序
- javascript - 无法让课程被删除
- python - 每次我绕过 while 循环时,如何保持我的值相同?