oscerd opened a new issue, #728:
URL: https://github.com/apache/camel-karaf/issues/728
## Description
The `camel-core` feature ships a Karaf JMX ACL configuration for the whole
`org.apache.camel` MBean domain:
`features/src/main/feature/camel-features.xml`
```xml
<!-- allow camel to access its own mbeans for karaf commands and other needs
-->
<config name="jmx.acl.org.apache.camel">
* = *
</config>
```
Karaf's `KarafMBeanServerGuard` resolves ACL PIDs most-specific-first
(`jmx.acl.<domain>.<type>` ... `jmx.acl.<domain>` ... `jmx.acl`). Because
this
PID is at the domain level and no more-specific PID exists for the domain, it
is consulted before the root `jmx.acl` PID and therefore fully replaces
Karaf's stock per-operation role mapping for every Camel MBean.
Karaf's stock `etc/jmx.acl.cfg` maps operations by name:
```
list* = viewer
get* = viewer
is* = viewer
set* = admin
* = admin
```
The blanket entry drops that distinction for the Camel domain, so read-only
introspection and mutating operations are treated identically. The comment on
the config says the intent was to let the `camel:*` shell commands reach the
Camel MBeans, which is narrower than what the entry actually grants.
## Expected Behavior
The shipped default mirrors Karaf's own convention: introspection operations
mapped to `viewer`, lifecycle operations to `manager`, and everything else
left at Karaf's `admin` default -- i.e. the grant is scoped to what the
`camel:*` commands actually invoke.
## Actual Behavior
A single `* = *` entry covers every operation on every MBean in the
`org.apache.camel` domain, replacing Karaf's stock mapping for that domain.
## Additional Context
- The config is present and identical on `main` and on the
`camel-karaf-4.8.x`, `camel-karaf-4.9.x`, `camel-karaf-4.10.x`,
`camel-karaf-4.14.x` and `camel-karaf-4.18.x` branches. It was introduced
in
`1351482bd` when the repository was seeded.
- Because a Karaf `<config>` element seeds a ConfigAdmin configuration on
feature install, an existing deployment will keep its current
`etc/jmx.acl.org.apache.camel.cfg` on upgrade unless the operator replaces
it. Any change here should be accompanied by a note in the docs.
- Exact role tiering is a judgement call and worth agreeing on in this issue
before a PR lands. In particular `dumpRoutesAsXml(boolean)` resolves
property placeholders, so it does not belong in the same tier as the other
`dump*`/`list*` operations.
---
_Claude Code on behalf of Andrea Cosentino_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]