Skip to content

fix(config): restrict config:install to the admin role - #2861

Merged
jbonofre merged 1 commit into
apache:mainfrom
jbonofre:config-install-acl-admin
Sep 11, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
jbonofre:config-install-acl-admin

Conversation

@jbonofre

@jbonofre jbonofre commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Problem

config:install <url> <finalname> downloads a file from an arbitrary URL and writes it into ${karaf.etc} (the -o/--override option lets it overwrite an existing file). That folder also holds users.properties, keys.properties, host.key and every org.apache.karaf.*.acl.* file.

The command has no entry in org.apache.karaf.command.acl.config. SecuredSessionFactoryImpl.checkSecurity() treats an unmatched command as allowed (Specificity.NO_MATCH → passCheck = true), and karaf.secured.command.compulsory.roles ships commented out, so any authenticated shell/SSH user — including a viewer — can run config:install and overwrite, for example, the command ACL files or users.properties.

By contrast bundle:install, feature:install and kar:install are all admin-only in their own ACLs, and config:delete is admin in this same ACL.

Fix

Add install = admin to the config command ACL, in both shipped locations:

  • assemblies/features/standard/src/main/feature/feature.xml (<config> block)
  • instance/.../etc/org.apache.karaf.command.acl.config.cfg (instance template)

and to the itest etc fixture (itests/test/src/test/filtered-resources/etc/feature.xml).

Test

ConfigSshCommandSecurityTest#testConfigInstallCommandSecurityViaSsh — a viewer and a manager get Command not found; an admin can run it.

Note

The underlying fail-open behaviour (unmatched command → allowed, with karaf.secured.command.compulsory.roles disabled by default) is a broader hardening question tracked separately; this PR only closes the config:install gap.

config:install writes a file fetched from an arbitrary URL into
${karaf.etc}, which also holds users.properties, keys.properties and the
*.acl.* files. The command had no entry in the org.apache.karaf.command.acl.config
ACL, and the command guard treats an unmatched command as allowed, so any
authenticated shell user could run it.

Add "install = admin" to the config command ACL, consistent with
config:delete and with bundle:install / feature:install / kar:install.
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Test Results

  705 files  ±0    705 suites  ±0   1h 14m 22s ⏱️ - 3m 25s
  947 tests +1    899 ✅ +1   48 💤 ±0  0 ❌ ±0 
2 841 runs  +3  2 697 ✅ +3  144 💤 ±0  0 ❌ ±0 

Results for commit 40fca4b. ± Comparison against base commit 6e40475.

♻️ This comment has been updated with latest results.

@jbonofre
jbonofre force-pushed the config-install-acl-admin branch from a34b627 to 40fca4b Compare September 8, 2026 17:43
@jbonofre
jbonofre merged commit 54dd45a into apache:main Sep 11, 2026
7 checks passed
@jbonofre
jbonofre deleted the config-install-acl-admin branch September 11, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant