CAMEL-23250: Add security policy enforcement framework#22269
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
7d1ca40 to
d186bfb
Compare
|
acc9a34 to
7ce2eb7
Compare
b6ed4ab to
7ce2eb7
Compare
5fe8a95 to
6c604f4
Compare
6c604f4 to
8fbeb08
Compare
Introduce a security policy framework that enables runtime enforcement of security-sensitive configuration options. This adds: - New `security` attribute on @metadata, @UriParam, @UriPath annotations with categories: "secret", "insecure:ssl", "insecure:serialization", "insecure:dev" - SecurityConfigurationProperties for policy configuration (camel.security.insecureSslPolicy, etc.) - SecurityUtils/SecurityViolation in camel-util for violation scanning - SecurityPolicyResult in camel-main for startup enforcement - SecurityPolicyHealthCheck for runtime monitoring - Updated all metadata generators (EndpointSchemaGeneratorMojo, PrepareCamelMainMojo, GeneratePojoBeanMojo, SchemaGeneratorMojo, PackageLanguageMojo) to emit the security field in JSON metadata - Bidirectional derivation: secret=true implies security="secret" and security="secret" implies secret=true - Profile-aware defaults: dev/test profiles default to "warn", prod defaults to "fail" for insecure options - Design proposal document (proposals/security.adoc) - Deprecate `secret` attribute in favor of `security = "secret"` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `security = "insecure:ssl"` to trustAllCertificates and similar SSL-bypass parameters across all affected components (HTTP, Netty, Undertow, Vert.x HTTP, Mina, Paho, SJMS, JMS, ActiveMQ, Splunk, etc.). Add `security = "insecure:serialization"` to allowJavaSerializedObject and similar deserialization-bypass parameters. Migrate `@UriParam(secret = true)` to `@UriParam(security = "secret")` and `@Metadata(secret = true)` to `@Metadata(security = "secret")` on all component and core configuration fields touched by this PR, removing usage of the now-deprecated `secret` attribute. Add `security = "insecure:dev"` to devConsoleEnabled, downloadEnabled, sendEnabled, uploadEnabled on main configuration properties. Add `insecureValue` attribute where applicable to flag the specific value that triggers a security concern (e.g., insecureValue = "true" for boolean flags). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regenerate all component JSON metadata, catalog files, and camel-main configuration metadata to include the new security field in component/bean/language JSON schemas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8fbeb08 to
6da130a
Compare
|
CSB and CEQ would need some kind of integration with this as well - CSB have its own spring boot auto configuration that needs to have these new camel.security.xxx option as well. All the components with secret = true needs to be analyses what kind they are. |
|
@gnodet there are conflicts, a rebase is required |
…policy-enforcement # Conflicts: # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/CaffeineAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/CassandraAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/ConsulClusterService.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/EhcacheAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/HazelcastAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/InfinispanEmbeddedAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/InfinispanRemoteAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/InfinispanRemoteClusterService.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/JCacheAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/JdbcAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/beans/LevelDBAggregationRepository.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/activemq.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/activemq6.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/amqp.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-storage-blob.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jms.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/netty-http.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/sjms2.json # catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/releases/camel-releases.json # components/camel-activemq/src/generated/resources/META-INF/org/apache/camel/component/activemq/activemq.json # components/camel-activemq6/src/generated/resources/META-INF/org/apache/camel/component/activemq6/activemq6.json # components/camel-amqp/src/generated/resources/META-INF/org/apache/camel/component/amqp/amqp.json # components/camel-azure/camel-azure-storage-blob/src/generated/resources/META-INF/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json # components/camel-caffeine/src/generated/resources/META-INF/services/org/apache/camel/bean/CaffeineAggregationRepository.json # components/camel-cassandraql/src/generated/resources/META-INF/services/org/apache/camel/bean/CassandraAggregationRepository.json # components/camel-consul/src/generated/resources/META-INF/services/org/apache/camel/bean/ConsulClusterService.json # components/camel-ehcache/src/generated/resources/META-INF/services/org/apache/camel/bean/EhcacheAggregationRepository.json # components/camel-hazelcast/src/generated/resources/META-INF/services/org/apache/camel/bean/HazelcastAggregationRepository.json # components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/bean/InfinispanEmbeddedAggregationRepository.json # components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/bean/InfinispanRemoteAggregationRepository.json # components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/bean/InfinispanRemoteClusterService.json # components/camel-jcache/src/generated/resources/META-INF/services/org/apache/camel/bean/JCacheAggregationRepository.json # components/camel-jms/src/generated/resources/META-INF/org/apache/camel/component/jms/jms.json # components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java # components/camel-leveldb/src/generated/resources/META-INF/services/org/apache/camel/bean/LevelDBAggregationRepository.json # components/camel-netty-http/src/generated/resources/META-INF/org/apache/camel/component/netty/http/netty-http.json # components/camel-sjms/src/generated/resources/META-INF/org/apache/camel/component/sjms/sjms.json # components/camel-sjms2/src/generated/resources/META-INF/org/apache/camel/component/sjms2/sjms2.json # components/camel-sql/src/generated/resources/META-INF/services/org/apache/camel/bean/JdbcAggregationRepository.json # core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
|
Agreed on both points:
Follow-up plan (3 PRs):
Claude Code on behalf of Guillaume Nodet |
Migrate all remaining `secret = true` annotations to the new `security = "secret"` attribute across the entire codebase: - 142 source files migrated (135 components + 7 core/tooling) - ~345 annotation occurrences updated (@UriParam and @metadata) - Regenerated catalog metadata, endpoint DSL, and component DSL - Fixed annotation line length formatting for 4 components Follow-up to PR #22269 which introduced the security policy enforcement framework.



CAMEL-23250
Summary
Adds a security policy enforcement framework that enables runtime detection and enforcement of security-sensitive configuration options in Apache Camel.
Key changes
securityattribute on@Metadata,@UriParam,@UriPathwith categories:"secret","insecure:ssl","insecure:serialization","insecure:dev"insecureValueattribute to flag the specific value that triggers a security concernSecurityConfigurationPropertiesfor policy configuration (camel.security.insecureSslPolicy, etc.)SecurityUtils/SecurityViolationin camel-util for violation scanningSecurityPolicyResultin camel-main for startup enforcement (fail/warn/allow)SecurityPolicyHealthCheckfor runtime monitoring via health APIwarn, prod defaults tofailsecret=trueimpliessecurity="secret"and vice versasecurityfield in JSON schemasBaseOptionModel.setSecurity()validates categories at build time — typos cause an immediateIllegalArgumentExceptionproposals/security.adocinsecure:ssl,insecure:serialization,insecure:devcategoriesFollow-up work
security = "secret"to all remainingsecret = trueparameters (~144 files not yet annotated)camel.security.*propertiescamel.security.*propertiesTest plan
MainSecurityPolicyTest— parameterized tests for policy enforcement (fail/warn/allow) across profilesMainSecurityPolicyHealthCheckTest— health check reports violationsSecurityUtilsTest— violation scanning logicsecurityfield