jbonofre opened a new pull request, #3062:
URL: https://github.com/apache/karaf/pull/3062

   ## Problem
   
   When the `groovy` feature is installed, the `shell` feature conditionally 
installs `org.apache.karaf.shell.groovy`, which provides `groovy:exec` and 
`groovy:exec-file`. The `groovy` scope ships no 
`org.apache.karaf.command.acl.*` configuration, and the command guard allows 
every command of a scope without ACL (unless 
`karaf.secured.command.compulsory.roles` is set, which it isn't by default). So 
any user who can log in to the console, `viewer` included, can evaluate Groovy 
code in the Karaf JVM, while `shell:exec` and `shell:java` are already 
restricted to `admin`.
   
   ## Fix
   
   Add an `org.apache.karaf.command.acl.groovy` ACL, provided by a `<config>` 
element under the `groovy` conditional of the `shell` feature (same mechanism 
as the `kar`, `jdbc` and `jms` scopes):
   
   ```
   exec = admin
   exec-file = admin
   ```
   
   The same config is added to the itests copy of the features file 
(`itests/test/src/test/filtered-resources/etc/feature.xml`).
   
   ## Tests
   
   - `GroovySshCommandSecurityTest` (new): over SSH, `karaf` can see and run 
`groovy:exec` / `groovy:exec-file`, while a viewer and a manager get "Command 
not found".
   - `GroovyTest`: runs the commands with the `admin` role, as 
`executeCommand()` without a principal is now denied.
   - Both pass locally on JDK 21.
   - Manual updated (`user-guide/security.adoc`).
   


-- 
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]

Reply via email to