CAMEL-23250: Security policy enforcement with profile-aware defaults#22269
Open
CAMEL-23250: Security policy enforcement with profile-aware defaults#22269
Conversation
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
5 tasks
oscerd
approved these changes
Mar 27, 2026
- CyberArkVaultConfiguration: mark authToken as secret - IBMSecretsManagerVaultConfiguration: mark eventStreamUsername and eventStreamPassword as secret Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a built-in security policy enforcement mechanism that detects insecure configuration at startup and either warns or prevents the application from starting, depending on the configured policy. Framework components: - SecurityUtils and SecurityViolation in camel-util for detection logic - SecurityConfigurationProperties for camel.security.* configuration - SecurityPolicyResult as a CamelContext plugin for runtime access - SecurityPolicyHealthCheck for health monitoring - Profile-aware defaults: prod profile auto-sets policy=fail - security attribute on @UriParam/@UriPath/@metadata annotations - Tooling support to generate security options map from annotations Security categories: secret, insecure:ssl, insecure:serialization, insecure:dev. Policy levels: allow, warn (default), fail. Annotated 60+ component options across AWS, Huawei, JMS, Netty, HTTP, Splunk, Paho, and other components with security categories. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8da3b9c to
c25dd5c
Compare
Regenerated component JSON metadata, endpoint DSL factories, and catalog resources to reflect the new security annotations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c25dd5c to
ca52d14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Built-in security policy enforcement that detects insecure configuration at startup and either warns or prevents the application from starting.
secret(plain-text passwords),insecure:ssl(disabled cert verification),insecure:serialization(Java object deserialization),insecure:dev(dev-only features in prod)allow(silent),warn(log, default),fail(block startup)prodprofile auto-setspolicy=failcamel.security.insecureSslPolicy=allowwhile global isfailcamel.security.allowedPropertiesSecurityPolicyResultaccessible as a CamelContext pluginCommit structure (for easier review)
b0834acFix missing secret=true annotations — CyberArkauthToken, IBM Event StreamseventStreamUsername/eventStreamPassword(2 files)5c89a07Security policy enforcement framework — all new classes, tooling, component annotations, tests, docs (90 files)c25dd5cRegenerate catalog and generated files — JSON metadata and endpoint DSL (423 files, reviewers can skip this commit)Key files to review
Framework core:
core/camel-util/…/SecurityUtils.java— detection logic + security options mapcore/camel-util/…/SecurityViolation.java— violation recordcore/camel-main/…/SecurityConfigurationProperties.java—camel.security.*configcore/camel-main/…/SecurityPolicyResult.java— runtime result APIcore/camel-main/…/BaseMainSupport.java— enforcement wiring at startupcore/camel-main/…/ProfileConfigurer.java—prodprofile defaultTooling (annotation → generated map pipeline):
tooling/spi-annotations/…/UriParam.java— newsecurity()attributetooling/…/UpdateSensitizeHelper.java— generatesSecurityUtils.javamapHealth check:
core/camel-health/…/SecurityPolicyHealthCheck.javaTests & docs:
core/camel-main/…/MainSecurityPolicyTest.java— 27 tests covering all policy levels, categories, overrides, profilesdocs/…/security.adoc— user documentationdocs/…/camel-4x-upgrade-guide-4_19.adoc— upgrade guide entryExample annotation change (repeated across 60+ components):
components/camel-aws/…/BedrockAgentConfiguration.java— addssecurity = "insecure:ssl"totrustAllCertificatesTest plan
MainSecurityPolicyTest(all policy levels, categories, overrides, profiles, allowed properties, placeholder detection)SecurityUtilsTest(plain-text secret detection)mvn install -B -pl core/camel-main -DskipTests -ammvn test -B -pl core/camel-main -Dtest=MainSecurityPolicyTestmvn formatter:format impsort:sortFollow-up ideas
Findings from a security audit that are not covered by this PR but could be addressed in follow-up tickets:
Near-term
Infinispan deserialization filter —
DefaultExchangeHolderUtilsusesClassLoadingAwareObjectInputStreamwithout JEP-290setObjectInputFilter(). Should add the same default filter (java.**;org.apache.camel.**;!*) used by SQL/LevelDB/Cassandra/Consul stores.TLS protocol version filtering — Splunk and Paho MQTT expose SSLv3/TLSv1 in their protocol enums. The global
SSLContextParametersdefault filtering only excludesSSL.*regex. Consider also excludingTLSv1andTLSv1.1by default.Medium-term
FIPS compliance category — The framework already supports arbitrary categories via
resolvePolicy()'sdefault → nullfallback. Addinginsecure:fipsrequires annotating non-FIPS algorithms and adding afipsPolicyfield toSecurityConfigurationProperties. See JIRA comment for a detailed plan.SSRF mitigation — Add an optional URI whitelist mechanism for
toD/recipientListdynamic routing. This is an architectural change beyond config-level checking.Expression language sandboxing — OGNL, Groovy, MVEL, SpEL all allow arbitrary code execution. Not config-level (the framework can't catch this), but documenting the risk in
security.adocwould help users make informed choices.Low priority
HTTP header CRLF validation — Add header value sanitization in
camel-http-commonto prevent header injection.MongoDB trust-all TrustManager —
SslAwareMongoClienthardcodes a trust-allTrustManager. Not trackable by the annotation framework since it's programmatic, not a@UriParam.