Skip to content

Tighten default Jolokia access policy and bind the web console to loopback - #2639

Merged
jbonofre merged 1 commit into
apache:mainfrom
jbonofre:harden-jolokia-policy-console-bind
Oct 16, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
jbonofre:harden-jolokia-policy-console-bind

Conversation

@jbonofre

@jbonofre jbonofre commented Oct 5, 2026

Copy link
Copy Markdown
Member

Default configuration changes for the web console and the Jolokia REST API.

conf/jolokia-access.xml

  • <allow> lists the read-only broker operations explicitly (browse, queries, health, scheduled job listing, cursor state) instead of a wildcard on org.apache.activemq:*. Jolokia consults <allow> only for command types that are not in <commands> (write, exec) and does not consult <deny> for them, so the list has to be explicit. The file now documents how the three sections combine.
  • <cors> lists the console's loopback origins (localhost, 127.0.0.1, [::1] on the default http and https ports) for strict checking.
  • Operation names in <deny> end with * so they also match a name sent with its signature, e.g. purge().

conf/jetty-spring.properties and JettyServerBean

  • jetty.http.host and jetty.ssl.host are set to 127.0.0.1, so the connectors bind loopback by default as they did before the move to conf/jetty/*.xml.
  • -Djetty.host=<address> overrides both again. The Docker entrypoint passes it.

Behaviour changes

  • Write and exec requests through Jolokia are limited to the listed read-only operations. To open another one, add it to <allow>.
  • Jolokia clients must send an Origin header matching an <allow-origin> entry. Add the scheme, host and port the console is reached through if it differs from the defaults.
  • Installations that keep their own jetty-spring.properties need to add the two host lines to get the loopback binding.

Tests

  • JolokiaAccessPolicyTest evaluates the shipped policy with Jolokia's PolicyRestrictor: every operation of the broker MBean interfaces (bare name and with signature), attribute writes and reads, and origins.
  • JettyBindAddressTest applies the shipped Jetty XML files and properties and checks the connector hosts.
  • JettyServerBeanTest covers the configured host and the -Djetty.host override.

…pback

- jolokia-access.xml: list the allowed read-only operations explicitly
  instead of a wildcard, list the allowed origins for strict checking, and
  let denied operation names match a name sent with its signature
- jetty-spring.properties: bind the http/https connectors to 127.0.0.1
- JettyServerBean: -Djetty.host overrides the connector bind address
- add tests evaluating the shipped Jolokia policy and Jetty configuration
@jbonofre
jbonofre requested a review from cshannon October 5, 2026 17:00

@cshannon cshannon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with Jolokia access policies but the testing seems like it's pretty extensive . @mattrpav - do you have any thoughts on this?

@cshannon cshannon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is just hardening and Jolokia is already locked down to admins only now it probably can just go into 6.4.0, but a 6.3.x backport is fine too. Either way.

@jbonofre

Copy link
Copy Markdown
Member Author

@cshannon let's keep that for 6.4.0 only (no need to backport on 6.3.x).

@jbonofre
jbonofre merged commit 58c1f02 into apache:main Oct 16, 2026
10 checks passed
@jbonofre
jbonofre deleted the harden-jolokia-policy-console-bind branch October 16, 2026 11:47
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Apache ActiveMQ v6.4.0 Oct 16, 2026
@mattrpav mattrpav added this to the 2026 Security hardening milestone Oct 20, 2026
mattrpav added a commit that referenced this pull request Oct 21, 2026
…pback (#2639) (#2721)

- jolokia-access.xml: list the allowed read-only operations explicitly
  instead of a wildcard, list the allowed origins for strict checking, and
  let denied operation names match a name sent with its signature
- jetty-spring.properties: bind the http/https connectors to 127.0.0.1
- JettyServerBean: -Djetty.host overrides the connector bind address
- add tests evaluating the shipped Jolokia policy and Jetty configuration

(cherry picked from commit 58c1f02)

Co-authored-by: JB Onofré <jbonofre@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants