liveBook · Manning

Chapter 6: Chapter 6. Securing ActiveMQ

What you will learn in chapter 6 of ActiveMQ in Action

This introduction explains authentication and authorization in ActiveMQ’s adaptable security model.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains authentication and authorization in ActiveMQ’s adaptable security model.

Key terms: authentication, authorization, access control lists, ACLs

6.1 Authentication

This section introduces ActiveMQ’s plug-in-based security configuration and contrasts its two authentication plug-ins.

Key terms: plug-ins, <plugin> element, ActiveMQ XML configuration file, simple authentication plug-in, JAAS authentication plug-in, credentials, JAAS API

6.1.1 Configuring the simple authentication plug-in

This section explains how to configure and use ActiveMQ’s simple authentication plug-in and describes its security limitations.

Key terms: simple authentication plug-in, username, password, groups, authorization, stock publisher, createConnection(), clear text, SSL transport, JAAS plug-in

6.1.2 Configuring the JAAS plug-in

This section introduces JAAS pluggable authentication and configures ActiveMQ’s properties-based login module to secure a broker.

Key terms: JAAS, pluggable authentication, LoginModule, simple authentication plug-in, login.config, activemq-domain, PropertiesLoginModule, required, org.apache.activemq.jaas.properties.user, org.apache.activemq.jaas.properties.group

6.2 Authorization

This section introduces authorization as finer-grained control over what authenticated ActiveMQ clients can do.

Key terms: authentication, authorization, destination, STOCKS.*

6.2.1 Destination-level authorization

This section explains how to configure and test operation-specific authorization for ActiveMQ destinations.

Key terms: read, write, admin, JMS destinations, JAAS authorization plug-in, authorization entries, topic, queue, wildcards, groups

6.2.2 Message-level authorization

This section implements, configures, and tests a message-level authorization policy that permits consumption only from the broker’s local host.

Key terms: message-level authorization, MessageAuthorizationPolicy, isAllowedToConsume(), connection context, Connection.getRemoteAddress(), JAR, lib directory, Spring beans–style XML, AuthorizationPolicy, stock portfolio example

6.3 Building a custom security plug-in

This section introduces BrokerFilter-based extensions and options for meeting custom ActiveMQ security requirements.

Key terms: BrokerFilter, broker-level operations, plug-in API, JAAS login module, custom security plug-in

6.3.1 Implementing the plug-in

This section implements an IP-based connection filter and a broker plug-in that configures and installs it.

Key terms: IPAuthenticationBroker, BrokerFilter, addConnection(), regular expression, constructor, chain of interceptors, BrokerPlugin, IPAuthenticationPlugin, installPlugin(), getter

6.3.2 Configuring the plug-in

This section describes declaring the custom IP authentication plug-in in the broker’s XML configuration and its localhost-only connection restriction.

Key terms: IPAuthenticationPlugin, plugins element, broker, 127.0.0.1, localhost

6.3.3 Testing the plug-in

This section tests the custom IP authentication plug-in and highlights the flexibility of the BrokerFilter plug-in pattern.

Key terms: IPAuthenticationPlugin, IPAuthentication-Broker, localhost, examples JAR, BrokerFilter, plug-in mechanism, custom security requirements

6.4 Certificate-based security

This section contrasts the credentials used by earlier ActiveMQ security plug-ins with organizations’ preference for SSL certificates and introduces a certificate-based example.

Key terms: authentication, authorization, client credentials, SSL certificates

6.4.1 Preparing certificates

The section introduces the producer and consumer certificates used in the security example and notes how to handle their information and storage.

Key terms: producer, consumer, certificate, keystore, certificates, secure locations

6.4.2 Creating a truststore

This section describes preparing a broker truststore with the producer and consumer certificates and placing it where the broker configuration can reference it.

Key terms: broker truststore, keystore, producer certificate, consumer certificate, JMS client certificates

6.4.3 Configuring the broker

This section explains how the broker configuration uses a truststore and certificate-based authentication plug-in to control client access.

Key terms: trustStore, trustStorePassword, sslContext, needClientAuth, SSL transport URI, jaasCertificateAuthenticationPlugin, broker resources

6.4.4 Authorization explained

This section explains how certificate login configuration, user and group mappings, and the authorization plug-in govern access to broker destinations.

Key terms: jaasCertificateAuthenticationPlugin, activemq-certificate, login.config, TextFileCertificateLoginModule, PropertiesLoginModule, user.properties, groups.properties, authorizationPlugin, sslconsumer, sslpublisher

6.4.5 Testing it out

Tests certificate-based broker access and authorization using publisher and consumer clients.

Key terms: certificate, broker’s truststore, publisher, authorization settings, consumers, stock-related topics

6.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 5: Chapter 5. ActiveMQ message storage Chapter 7: Chapter 7. Creating Java applications with ActiveMQ →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.