Security Policy Enforcement
Camel includes a built-in security policy enforcement mechanism that detects insecure configuration at startup time — before your application processes any messages. It catches common mistakes like plain-text passwords, disabled SSL verification, unsafe deserialization settings, and development features left enabled in production.
Security categories
The framework checks four categories of security concerns:
| Category | Description | Example properties |
|---|---|---|
| Plain-text sensitive values that should use property placeholders, vault references, or environment variables |
|
| SSL/TLS settings that weaken transport security |
|
| Enabling Java object deserialization, a known attack vector |
|
| Development or debug features that should not be enabled in production |
|
The insecure options are the component, data format and language options that are marked with a security category in their metadata. A property that configures a component, data format or language (such as camel.component.netty.ssl) is only checked against the options of that component, data format or language, so an option that merely has the same name as an insecure option of another component (such as the ssl option of camel-hivemq) is not flagged. Any other property (such as camel.ssl.trustAllCertificates) is checked by the option name.
Policy levels
Each category can be set to one of three enforcement levels:
| Level | Behavior |
|---|---|
| Silently permit the configuration — no warning, no error. |
| Log a warning at startup but allow the application to start. This is the default. |
| Prevent the application from starting and report all violations. |
Configuration
Configure policies using the camel.security.* properties:
# Global policy applied to all categories unless overridden
camel.security.policy = warn
# Per-category overrides
camel.security.secretPolicy = fail
camel.security.insecureSslPolicy = fail
camel.security.insecureSerializationPolicy = fail
camel.security.insecureDevPolicy = allow
# Exempt specific properties from all checks
camel.security.allowedProperties = camel.component.aws2-s3.trustAllCertificates | Property | Description | Default |
|---|---|---|
| Global security policy applied to all categories unless overridden. |
|
| Overrides the global policy for plain-text secrets. | |
| Overrides the global policy for insecure SSL/TLS settings. | |
| Overrides the global policy for insecure deserialization settings. | |
| Overrides the global policy for development-only features. | |
| Comma-separated list of property keys to exclude from all checks. |
When a per-category policy is not set, it falls back to the global camel.security.policy value.
Profile defaults
The enforcement level changes automatically based on the active Camel profile:
| Profile | Behavior |
|---|---|
No profile | Global policy defaults to |
|
|
| Global policy defaults to |
Set the profile with:
camel.main.profile = prod What is NOT flagged
The secret category only flags values that look like plain-text literals. The following patterns are considered safe and are not flagged:
-
{{vault:…}}— vault references -
${env:…}or${ENV:…}— environment variables -
${sys:…}or${SYS:…}— system properties -
{{…}}— general property placeholders
Examples
Production: strict enforcement
camel.main.profile = prod
# Implicit: camel.security.policy = fail
# Allow one specific exception where self-signed certs are needed
camel.security.allowedProperties = camel.component.aws2-s3.trustAllCertificates With this configuration, the application will refuse to start if any plain-text secret, insecure SSL setting, unsafe deserialization option, or dev feature is detected — except the one explicitly allowed property.