Securing Apache ActiveMQ comes down to customer-side settings: turn on broker authentication, change the web console's default admin/admin credentials and keep the OpenWire port reachable only from the networks that need it. Apply the project's security releases promptly and follow the ActiveMQ security advisories. This guide covers ActiveMQ Classic: how clients, administrators and other brokers authenticate, how destination authorisation works, which credentials live in the broker's configuration, what to log, and a hardening baseline. It is for platform engineers, middleware administrators and security engineers. ActiveMQ Artemis is a separate code base with its own security documentation and is not covered in detail here.
This is an independent guide from NHI Mgmt Group, based on the Apache ActiveMQ project's public documentation as of November 2026. It is not sponsored or reviewed by the Apache ActiveMQ project. Product features change, so confirm settings against the Apache ActiveMQ project's current documentation.
Key takeaways
- Upgrade brokers and clients together. The project's advisories tell users to upgrade "both brokers and clients" where the fix is in the Java OpenWire marshaller that both sides use.
- Protect the management plane. Most 2026 ActiveMQ advisories concern Jolokia, the REST API and the web console; on 6.x, use 6.1.2 or later and confirm the API context requires authentication.
- Authentication is opt in. The broker does nothing until you configure
simpleAuthenticationPluginorjaasAuthenticationPlugin, and the web console's basic authentication is controlled by theauthenticateproperty inconf/jetty.xml. - Every application and bridge is a non-human identity. Producers, consumers, network connectors and bundled components each hold a username and password; give each its own account and destination rights.
- Restrict ObjectMessage deserialisation. Since 5.12.2 and 5.13.0 trusted packages must be listed explicitly; never set
SERIALIZABLE_PACKAGESto*orsetTrustAllPackages(true)in production.
How identity and access work in ActiveMQ
ActiveMQ Classic has three planes, each with its own authentication setting. Hardening only the messaging plane, and leaving the console and Jolokia open, is a common gap.
| Plane | Default endpoint | Authentication | Authorisation |
|---|---|---|---|
| Messaging (OpenWire, AMQP, STOMP, MQTT, WebSocket) | Transport connectors in activemq.xml; OpenWire on 61616 in the default configuration (own knowledge) | simpleAuthenticationPlugin or jaasAuthenticationPlugin (properties files, LDAP, certificates) | authorizationPlugin entries with read, write, admin per queue or topic |
| Web console | http://localhost:8161/admin | Jetty basic authentication, users in conf/jetty-realm.properties, default admin/admin | Jetty roles in jetty.xml constraints |
API context (Jolokia at /api/jolokia/, Message REST API) | Same embedded Jetty server, port 8161 | Same Jetty settings; on 6.x use 6.1.2 or later | Jolokia access policy; restrict exec operations on org.apache.activemq MBeans and stay on a current release |
Messaging authentication
- simpleAuthenticationPlugin: users are defined inline as
<authenticationUser username= password= groups=>. Simple, but the passwords sit inactivemq.xml. - jaasAuthenticationPlugin: names a JAAS entry in
login.config, found through thejava.security.auth.login.configsystem property or the classpath. Use it for LDAP (LDAPLoginModule, with a cached LDAP module from 5.6) or client certificates. - Anonymous access: off unless
anonymousAccessAllowed="true"is set. If you enable it, anonymous clients get the user and groupanonymous, so authorisation entries must deny that group anything sensitive. - Reload behaviour: from 5.12 JAAS property files load only at startup unless
reload=trueis set, so removing a user needs a reload or restart to take effect. - LDAP cautions: the project's advisory list includes LDAP authentication fixes. Disable anonymous bind on the directory and stay on a current release. See the LDAP Security Deep Dive Guide.
Destination authorisation
Inside authorizationPlugin, an authorizationMap holds authorizationEntry elements for a queue or topic (wildcards such as ORDERS.> allowed). read allows browsing and consuming, write allows sending, and admin allows lazy creation of destinations. Two details catch teams out:
- Advisory topics: every user needs
adminonActiveMQ.Advisorydestinations to create them, but normal users should not read or write all advisories. Open onlyActiveMQ.Advisory.TempQueueandActiveMQ.Advisory.TempTopicto everyone, andActiveMQ.Advisory.Consumer.>to bridge users. - Temporary destinations: without a
tempDestinationAuthorizationEntry, all users get read, write and admin on temporary destinations. Several 2026 advisories (temporary destination ownership takeover, authorisation bypass via temporary composite destinations) show this area is still active.
Where the payload itself decides who may consume, a custom MessageAuthorizationPolicy with isAllowedToConsume(...) can be packaged into the broker's lib folder and configured as <messageAuthorizationPolicy>.
Admin roles and privileged access
Whoever reaches the web console or Jolokia with valid credentials can manage the broker, and Jolokia exec operations on broker MBeans such as addNetworkConnector can extend that to running code, so restrict them in the Jolokia access policy. Treat console access as privileged access to the host.
- Turn on console authentication: set
authenticatetotrueinconf/jetty.xml(available since 5.4.0), replace admin/admin injetty-realm.properties, and give each administrator a named account. - Cover the whole Jetty context: the project's mitigation adds a
ConstraintMappingwithpathSpec/so the API context is covered too. Check that Jolokia and the REST API demand credentials after every upgrade. - Separate viewers from operators: recent advisories cover the separation of low privilege web users from Jolokia broker management and console admin access. Upgrade, then test that a read-only role really is read-only.
- Bind and encrypt: the console listens on localhost in the documented default; keep it there or on a management network, and enable the secure connector in
jetty.xml(the example uses port 8162 with a keystore) and remove the plain connector. - Host and JMX access: remote JMX has its own security releases. If you do not use remote JMX, leave it off; if you do, require authentication and TLS and restrict it to a management network. Host administrators can read every credential file, so manage them through your Privileged Access Management Guide process.
Integrations, API tokens and service accounts
An ActiveMQ estate holds more machine credentials than human ones. Each one belongs in your inventory with an owner.
| Credential | Where it lives | Risk | Control |
|---|---|---|---|
| Application producer and consumer accounts | Application config, connection factory userName/password | Shared accounts give every app every destination | One account per application, destination-scoped read or write only |
| Bundled component credentials | conf/credentials.properties, defaults activemq.username=system and activemq.password=manager | Known default password | Change on install; use encrypted passwords (supported from 5.4.1) |
| Network connector (broker to broker) accounts | networkConnector userName/password | Bridge accounts need advisory access and wide destination rights | Dedicated bridge user per link; must exist on the peer's authentication plugin |
| Web console and Jolokia accounts | jetty-realm.properties, plus the console's own connection factory in webconsole-embeded.xml | Admin/admin default, code execution via Jolokia | Named users, strong passwords, management network only |
| Keystore and truststore passwords | ActiveMQSslConnectionFactory properties, broker sslContext | Plaintext secret next to the private key | File permissions, secrets manager injection, certificate expiry monitoring |
| Camel and Spring integrations | ActiveMQComponent connection factory | Credentials in application repositories | Secrets manager, scanning for committed secrets |
For stronger client identity, use the SSL transport with transport.needClientAuth=true on the broker so each client presents a certificate, and map certificates to users through JAAS. Client hostname verification has been on by default since 5.15.6; do not turn it off with verifyHostName=false. Broker side hostname checking (transport.verifyHostName=true) is off by default and applies only to two-way TLS. The mTLS Guide covers the certificate lifecycle, and the Service Account Security Guide covers ownership and rotation.
Security updates and patching
The Apache ActiveMQ project publishes its security advisories. Apply security releases promptly, and take the latest release rather than the first fixed one (NHI Mgmt Group recommendation). Upgrade brokers and Java client libraries together, and restrict Jolokia and the web console to a management network while you do (NHI Mgmt Group recommendation).
- Inventory: list every broker and every client library version, including JARs bundled inside applications and the
activemq-allartefact. Software composition analysis or an SBOM finds client copies that a broker inventory misses. - Prioritise exposure: any broker whose OpenWire port is reachable from untrusted networks, or whose console is reachable outside a management network, goes first.
- Test in a staging pair: upgrade a broker and a representative client, check authentication, authorisation, network connectors and ObjectMessage handling, and keep the previous binaries and
confdirectory for rollback. - Roll out: brokers in a failover pair one at a time, then client libraries through normal application releases.
- Hunt: on any broker that was exposed and unpatched, check for unexpected child processes, new files and outbound connections before trusting it. See the Emergency Out-of-Band Patching Playbook.
Logging and detection
ActiveMQ logs through its logging configuration in conf; authentication failures and connection events show up there, but exploitation is clearest at the host. Forward both to the SIEM.
| Signal | Source | Technique |
|---|---|---|
Broker Java process spawning sh, bash, curl, wget, cmd.exe or powershell.exe | EDR, auditd, Sysmon Event ID 1 | T1190 then T1059.004 or T1059.001 |
| Broker making outbound HTTP requests to fetch XML or JARs | Egress proxy, firewall logs | T1105; a broker fetching remote Spring XML or JARs is unexpected |
Jolokia requests calling exec on addNetworkConnector or addConnector | Jetty request log, reverse proxy logs | Management API abuse |
| New network connector or transport connector at runtime | Broker logs, JMX audit | Persistence or data diversion |
Authentication failures in bursts, or successes for anonymous or system | Broker logs | T1110, default credential use |
| Connections to 61616 or 8161 from outside expected subnets | Firewall, NetFlow | T1046 scanning, exposure drift |
Metrics:
- Percentage of brokers and client libraries on a current release with all security fixes.
- Number of brokers with OpenWire or the console reachable from untrusted networks (target: zero).
- Percentage of applications with their own broker account rather than a shared one.
- Number of authorisation entries granting
adminon>to non-administrators (target: zero). - Days to rotate broker credentials after a staff or supplier change.
Hardening baseline
- Network: place brokers on an internal segment; allow 61616 (or your TLS port) only from application subnets and the console port only from a management network. Remove transport connectors for protocols you do not use.
- Transport security: use
ssl://transports, settransport.enabledCipherSuitesto a modern list, and require client certificates where applications can support them. - Authentication: enable
jaasAuthenticationPlugin(LDAP or certificates) or at leastsimpleAuthenticationPlugin; leaveanonymousAccessAllowedoff. - Authorisation: one
authorizationEntryper destination family, least privilege per application, explicit advisory andtempDestinationAuthorizationEntryrules. - Management plane: console authentication on, admin/admin gone, the whole Jetty context constrained, HTTPS only, and Jolokia limited or removed if no tool uses it.
- Deserialisation: set
org.apache.activemq.SERIALIZABLE_PACKAGESinACTIVEMQ_OPTSto the packages you need and usesetTrustedPackages()on clients; prefer text or bytes messages over ObjectMessage altogether. See the Secure Deserialisation Guide. - Credentials: change
credentials.properties, use encrypted passwords or secrets injection, and restrict file permissions onconfto the broker service account. - Host: run the broker as a dedicated non-root account, block outbound internet access except what you need, and install EDR.
Choosing an approach: a small team with a single broker can get most of the benefit from simple authentication, per-application accounts, a closed console and fast upgrades. A large estate with networks of brokers should use JAAS with LDAP or certificates so accounts are managed centrally, and treat broker configuration as code reviewed in change control.
Common misconfigurations
- No broker authentication: the shipped configuration does not require credentials for messaging, so any host that can reach 61616 can send and consume.
- Patching the broker, not the clients: OpenWire fixes can apply to Java clients too, and old client JARs live on in applications for years.
- Console exposed with default credentials: admin/admin on a reachable 8161 hands over broker management, and through Jolokia, potentially the host.
- Trusting all packages:
SERIALIZABLE_PACKAGES=*orsetTrustAllPackages(true), added to make an integration work in test, reopens Java deserialisation risk. - One shared "system" account: every application using the bundled
systemcredentials means no attribution and no least privilege. - Bridge accounts with full rights: network connector users given
adminon everything because advisory permissions were hard to get right.
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | CIS Controls v8.1 | ISO/IEC 27001:2022 Annex A |
|---|---|---|---|---|
| Upgrades and security releases | SI-2, RA-5 | ID.RA-01, PR.PS-02 | Control 7 | A.8.8 |
| Client and service authentication | IA-2, IA-3, IA-5 | PR.AA-01, PR.AA-03 | Controls 5 and 6 | A.5.17, A.8.5 |
| Destination authorisation | AC-3, AC-6 | PR.AA-05 | Control 6 | A.8.3 |
| TLS transports | SC-8, SC-23 | PR.DS-02 | Control 3 | A.8.24 |
| Deserialisation and input validation | SI-10 | PR.PS-01 | Control 16 | A.8.28 |
| Logging and host monitoring | AU-6, AU-12, SI-4 | PR.PS-04, DE.CM-09 | Control 8 | A.8.15, A.8.16 |
Practitioner checklist
- Inventory brokers and Java client libraries and upgrade both to a current release.
- Enable broker authentication and keep anonymous access off.
- Write per-application authorisation entries, including advisory and temporary destination rules.
- Turn on console authentication, replace admin/admin, constrain the full Jetty context and serve it over HTTPS.
- Restrict or remove Jolokia and remote JMX; restrict console access to a management network.
- Change
credentials.propertiesdefaults and give each application and bridge its own account. - Set trusted packages for ObjectMessage on broker and clients, never
*. - Use TLS transports with client certificates where possible and keep hostname verification on.
- Alert on the broker process spawning shells or fetching remote content.
Standards and references
- Apache ActiveMQ: Classic Security
- Apache ActiveMQ: Classic Security Advisories
- Apache ActiveMQ: Web Console
- Apache ActiveMQ: ObjectMessage
- Apache ActiveMQ: SSL Transport Reference
Related NHI Mgmt Group resources: Insecure Deserialisation Guide · Ransomware Prevention Guide · Service Account Security Guide