5.5.3. 使用 Kerberos 凭证授权客户端


AMQ Broker 包括对 JAAS Krb5LoginModule 登录模块的实现,用于在映射角色时供其他安全模块使用。该模块在主体的主体中添加一个 Kerberos 验证的 Peer Principal,作为 AMQ Broker UserPrincipal。然后,可以将凭证传递给 PropertiesLoginModule 或 LDAPLoginModule 模块,它将 Kerberos 验证的 Peer Principal 映射到 AMQ Broker 角色。

注意

Kerberos Peer Principal 没有作为代理用户存在,仅作为角色成员。

先决条件

  • 您必须启用接收器的 GSSAPI 机制,然后才能使用 Kerberos 安全凭证授权 AMQP 连接。

步骤

  1. 停止代理。

    1. 在 Linux 中:

      <broker_instance_dir>/bin/artemis stop
    2. 在 Windows 上:

      <broker_instance_dir>\bin\artemis-service.exe stop
  2. 打开 <broker_instance_dir>/etc/login.config 配置文件。
  3. 添加 AMQ Broker Krb5LoginModule 和 LDAPLoginModule 的配置。通过引用 LDAP 供应商的文档来验证配置选项。

    下方显示了一个示例配置:

    org.apache.activemq.artemis.spi.core.security.jaas.Krb5LoginModule required
        ;
    org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule optional
        initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
        connectionURL="ldap://localhost:1024"
        authentication=GSSAPI
        saslLoginConfigScope=broker-sasl-gssapi
        connectionProtocol=s
        userBase="ou=users,dc=example,dc=com"
        userSearchMatching="(krb5PrincipalName={0})"
        userSearchSubtree=true
        authenticateUser=false
        roleBase="ou=system"
        roleName=cn
        roleSearchMatching="(member={0})"
        roleSearchSubtree=false
        ;
    注意

    上例中显示的 Krb5LoginModule 版本通过 AMQ Broker 发布,并将 Kerberos 身份转换为可供其他 AMQ 模块用于角色映射的代理身份。

  4. 启动代理。

    1. 在 Linux 中:

      <broker_instance_dir>/bin/artemis run
    2. 在 Windows 上:

      <broker_instance_dir>\bin\artemis-service.exe start

其他资源

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部