Skip to content

CAMEL-23250: Add Spring Boot auto-configuration for security policy properties#1766

Merged
davsclaus merged 2 commits intomainfrom
swift-school
Apr 27, 2026
Merged

CAMEL-23250: Add Spring Boot auto-configuration for security policy properties#1766
davsclaus merged 2 commits intomainfrom
swift-school

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Apr 25, 2026

Summary

  • Add CamelSecurityPolicyConfigurationProperties to expose camel.security.* properties via Spring Boot's @ConfigurationProperties
  • Add CamelSecurityPolicyAutoConfiguration that scans all camel.* properties from the Spring Environment for security violations (insecure SSL, plain-text secrets, unsafe deserialization, dev features) and enforces the configured policy (allow/warn/fail)
  • Stores SecurityPolicyResult as a CamelContext plugin for health check integration

Properties exposed

camel.security.policy=warn                            # global: allow | warn | fail
camel.security.secret-policy=                         # override for plain-text secrets
camel.security.insecure-ssl-policy=                   # override for SSL/TLS
camel.security.insecure-serialization-policy=          # override for deserialization
camel.security.insecure-dev-policy=                   # override for dev features
camel.security.allowed-properties=                    # comma-separated exclusions

Test plan

  • noSecurityPropertiesShouldStartNormally — context starts without security config
  • policyAllowShouldIgnoreInsecureConfig — allow policy suppresses violations
  • policyWarnShouldStartWithViolations — warn policy logs but allows startup
  • policyFailShouldPreventStartup — fail policy throws and blocks startup
  • categoryOverrideShouldTakePrecedence — per-category override (e.g., SSL=allow) overrides global fail
  • categoryOverrideWarnWhileGlobalFail — per-category warn while global is fail
  • allowedPropertiesShouldExcludeFromChecks — exclusion list works
  • multipleViolationsDetected — multiple violations reported
  • insecureDevPolicyOverride — dev category override
  • insecureSerializationPolicyOverride — serialization category override
  • Full module test suite: 118 tests pass, 0 failures

🤖 Generated with Claude Code

Claude Code on behalf of Guillaume Nodet

…roperties

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Croway
Copy link
Copy Markdown
Contributor

Croway commented Apr 26, 2026

@gnodet the camel-core security.adoc (on the CAMEL-23250-security-policy-enforcement branch) mentions that "Spring Boot and Quarkus have their own profile mechanisms and are not affected" by the profile-aware defaults. Would it be possible adding a short note — either in the core docs or as Spring Boot-specific documentation — showing how users achieve the same per-environment behavior using Spring profiles, for example:

  # application-prod.properties
  camel.security.policy=fail

  # application-dev.properties
  camel.security.policy=allow

This would help Spring Boot users who read the camel.main.profile = prod auto-default section and wonder how to do the same thing in their stack.

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>
@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented Apr 26, 2026

Claude Code on behalf of Guillaume Nodet

Added a Security Policy section to spring-boot.adoc covering:

  • Available camel.security.* properties and their defaults
  • Category-level overrides (insecure-ssl-policy, insecure-serialization-policy, etc.)
  • The allowed-properties exclusion mechanism
  • Per-environment policies via Spring profiles — shows application-prod.properties with camel.security.policy=fail and application-dev.properties with camel.security.policy=allow

Also applied the project formatter to the new source files.

@davsclaus
Copy link
Copy Markdown
Contributor

LGTM

@davsclaus davsclaus merged commit 4570069 into main Apr 27, 2026
5 checks passed
@davsclaus davsclaus deleted the swift-school branch April 27, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants