You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2024/11/21 07:24:36 UTC
(camel) branch main updated (35985678bb6 -> 72c5f8722ed)
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
from 35985678bb6 chore(deps): Bump org.apache.parquet:parquet-common (#16327)
new 0dd7cf4f494 chore(components): add a warning when missing jolokia policies
new 72c5f8722ed fix(test): changing some test condition
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/main/docs/platform-http-jolokia.adoc | 29 ++++++++++++++++++++++
.../plugin/DefaultJolokiaPlatformHttpPlugin.java | 12 ++++++---
.../camel/itest/security/GreeterClientTest.java | 2 +-
3 files changed, 38 insertions(+), 5 deletions(-)
(camel) 01/02: chore(components): add a warning when missing jolokia policies
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0dd7cf4f494f288dc94e009a374a22d3e3a58b51
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Nov 20 12:19:07 2024 +0100
chore(components): add a warning when missing jolokia policies
---
.../src/main/docs/platform-http-jolokia.adoc | 29 ++++++++++++++++++++++
.../plugin/DefaultJolokiaPlatformHttpPlugin.java | 12 ++++++---
2 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/components/camel-platform-http-jolokia/src/main/docs/platform-http-jolokia.adoc b/components/camel-platform-http-jolokia/src/main/docs/platform-http-jolokia.adoc
index d573dd2767f..bec7528f151 100644
--- a/components/camel-platform-http-jolokia/src/main/docs/platform-http-jolokia.adoc
+++ b/components/camel-platform-http-jolokia/src/main/docs/platform-http-jolokia.adoc
@@ -19,3 +19,32 @@ Jolokia can be enabled as follows in `application.properties`:
camel.server.enabled = true
camel.server.jolokiaEnabled = true
----
+
+After the application is started, you can query the Jolokia endpoint (default `/q/jolokia`) as in this example:
+
+```
+$ curl http://localhost:8080/q/jolokia/list/org.apache.camel | jq
+
+{
+ "request": {
+ "path": "org.apache.camel",
+ "type": "list"
+ },
+ "value": {
+ "context=test,name=\"timer://yaml\\?period=1000\",type=endpoints": {
+ "op": {
+ "getEndpointUri": {
+ "args": [],
+ "ret": "java.lang.String",
+ "desc": "EndpointUri"
+ },
+...
+```
+
+== How to use it
+
+This components acts as a Jolokia agent exposing HTTP endpoints to access JMX services. It looks for default restrictor policies located in `classpath:/jolokia-access.xml`, allowing by default access to all MBeans if no policy is found.
+
+WARNING: this may be exposing sensitive information, make sure to protect the access to the endpoints accurately.
+
+Make sure to https://jolokia.org/reference/html/manual/security.html#security-policy-location[include a security policy] as provided in Jolokia documentation to avoid any security problem.
diff --git a/components/camel-platform-http-jolokia/src/main/java/org/apache/camel/component/platform/http/plugin/DefaultJolokiaPlatformHttpPlugin.java b/components/camel-platform-http-jolokia/src/main/java/org/apache/camel/component/platform/http/plugin/DefaultJolokiaPlatformHttpPlugin.java
index 053529db681..2d8c89fdb06 100644
--- a/components/camel-platform-http-jolokia/src/main/java/org/apache/camel/component/platform/http/plugin/DefaultJolokiaPlatformHttpPlugin.java
+++ b/components/camel-platform-http-jolokia/src/main/java/org/apache/camel/component/platform/http/plugin/DefaultJolokiaPlatformHttpPlugin.java
@@ -108,15 +108,19 @@ public class DefaultJolokiaPlatformHttpPlugin extends ServiceSupport implements
try {
var restrictor = RestrictorFactory.lookupPolicyRestrictor(pLocation);
if (restrictor != null) {
- jolokiaLogHandler.info("Using access restrictor: " + pLocation);
+ LOG.info("Using access restrictor: " + pLocation);
return restrictor;
} else {
- jolokiaLogHandler.info("No access restrictor found at: " + pLocation + ", access to all MBeans is allowed");
+ LOG.warn("No access restrictor found at: " + pLocation + ", access to all MBeans is allowed." +
+ " Mind that this is an unsecure and dangerous configuration that you may only want to use for development environments."
+ +
+ " NEVER use this in a production environment as it would expose sensitive information with no authentication"
+ + " and is a potential vector of remote attacks.");
return new AllowAllRestrictor();
}
} catch (IOException e) {
- jolokiaLogHandler.error("Error while accessing access restrictor: at " + pLocation +
- ". Denying all access to MBeans for security reasons. Exception: " + e,
+ LOG.error("Error while accessing access restrictor: at " + pLocation +
+ ". Denying all access to MBeans for security reasons. Exception: " + e,
e);
return new DenyAllRestrictor();
}
(camel) 02/02: fix(test): changing some test condition
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 72c5f8722ed730d5a12ee2e3240b2a3cf1e77167
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Nov 20 15:52:09 2024 +0100
fix(test): changing some test condition
Likely caused by some dependency bump.
---
.../test/java/org/apache/camel/itest/security/GreeterClientTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java
index 906199e3035..903a9728d76 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java
@@ -122,7 +122,7 @@ public class GreeterClientTest {
"Get a wrong exception message");
assertTrue(
ex.getMessage().endsWith(
- "Caused by: [org.springframework.security.access.AccessDeniedException - Access Denied]"),
+ "Caused by: [org.springframework.security.authorization.AuthorizationDeniedException - Access Denied]"),
"Get a wrong exception message");
}
}