You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CAMEL-23250: Add security policy documentation and apply formatter
Add a Security Policy section to spring-boot.adoc covering available
camel.security.* properties, category overrides, allowed-properties
exclusion, and per-environment policies via Spring profiles.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Camel Spring Boot automatically enforces security policies at startup, detecting insecure configuration such as disabled SSL verification, plain-text secrets, enabled Java deserialization, or development-only features.
508
+
509
+
The global policy controls how Camel reacts when insecure configuration is detected:
510
+
511
+
[source,properties]
512
+
----
513
+
# allow — no warnings, allow the configuration
514
+
# warn — log a warning at startup (default)
515
+
# fail — throw an exception and prevent startup
516
+
camel.security.policy=warn
517
+
----
518
+
519
+
=== Category Overrides
520
+
521
+
Each security category can override the global policy independently:
522
+
523
+
[source,properties]
524
+
----
525
+
camel.security.policy=fail
526
+
camel.security.insecure-ssl-policy=warn
527
+
camel.security.insecure-serialization-policy=warn
528
+
camel.security.insecure-dev-policy=allow
529
+
camel.security.secret-policy=fail
530
+
----
531
+
532
+
To exclude specific properties from all checks, use `allowed-properties`:
Spring profiles allow you to enforce strict security in production while keeping a relaxed policy during development.
542
+
543
+
In `application-prod.properties`:
544
+
545
+
[source,properties]
546
+
----
547
+
camel.security.policy=fail
548
+
----
549
+
550
+
In `application-dev.properties`:
551
+
552
+
[source,properties]
553
+
----
554
+
camel.security.policy=allow
555
+
----
556
+
557
+
Activate the profile via `spring.profiles.active`:
558
+
559
+
[source,properties]
560
+
----
561
+
# application.properties
562
+
spring.profiles.active=dev
563
+
----
564
+
565
+
Or at runtime:
566
+
567
+
[source,bash]
568
+
----
569
+
java -Dspring.profiles.active=prod -jar myApp.jar
570
+
----
571
+
572
+
This way, developers can freely use options like `trustAllCertificates=true` locally, while production deployments will fail fast if any insecure configuration is detected.
573
+
505
574
== Virtual Threads Support
506
575
507
576
Camel Spring Boot provides comprehensive support for JDK 21+ Virtual Threads, offering significant performance improvements for I/O-intensive applications. Virtual threads are lightweight threads that can dramatically reduce memory overhead and improve scalability compared to traditional platform threads.
Copy file name to clipboardExpand all lines: core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/security/CamelSecurityPolicyAutoConfiguration.java
Copy file name to clipboardExpand all lines: core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/security/CamelSecurityPolicyConfigurationProperties.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -51,14 +51,14 @@ public class CamelSecurityPolicyConfigurationProperties {
51
51
privateStringinsecureSslPolicy;
52
52
53
53
/**
54
-
* Security policy for insecure deserialization configuration. When set, overrides the global policy for options that
55
-
* enable dangerous deserialization of untrusted data.
54
+
* Security policy for insecure deserialization configuration. When set, overrides the global policy for options
55
+
* that enable dangerous deserialization of untrusted data.
56
56
*/
57
57
privateStringinsecureSerializationPolicy;
58
58
59
59
/**
60
-
* Security policy for development-only features. When set, overrides the global policy for options intended only for
61
-
* development environments.
60
+
* Security policy for development-only features. When set, overrides the global policy for options intended only
Copy file name to clipboardExpand all lines: core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/security/CamelSecurityPolicyAutoConfigurationTest.java
0 commit comments