๐Ÿ” Security Audit โ€” redpanda

Commit: 6f994515c7fb017dfb10aa7706343a21fdfe9f7f  |  2026-03-18  |  OWASP Top 10
โš  CONCERNS
6/10
OWASP Score
Finding Summary
0
Critical
3
High
5
Medium
4
Low
0
Unsafe Blocks
0
Secrets Found
OWASP Top 10 Checks
โœ“
A01 ยท Injection
PASS

No SQL queries (library crate, no DB layer). format! macros used for error messages only โ€” not in query construction. No Command::new or shell invocation found.

โ€“
A02 ยท Broken Authentication
N/A
LOWN/A
Library crate โ€” no JWT validation, password hashing, or session management. Auth responsibility belongs to consuming services. No JWT decode calls found.
!
A03 ยท Sensitive Data Exposure
WARN
MEDIUM.gitignore
Missing *.pem and *.key patterns. Current exclusions: target/, .env, .env.*, *.log. TLS cert files would not be excluded if accidentally added.
MEDIUMsrc/monitoring.rs:14
WebhookConfig.headers: HashMap<String, String> stores arbitrary auth tokens (test at line 397 shows "Authorization": "Bearer token123"). Struct derives Serialize โ€” callers who log or serialize MonitoringConfig will expose tokens in plaintext.
โ€“
A04 ยท XML External Entities
N/A

JSON-only. No XML parsing libraries in Cargo.toml or source.

โœ“
A05 ยท Broken Access Control
PASS
LOWsrc/event.rs:77
Positive finding: tenantid is validated as non-empty in CloudEvent::validate(). Producer enforces event.validate() before emission. Tenant isolation is structurally enforced at the event layer. No RLS needed (no DB layer in library).
!
A06 ยท Security Misconfiguration
WARN
HIGHsrc/producer.rs:47
Redpanda ClientConfig sets only bootstrap.servers and message.timeout.ms. No security.protocol, sasl.mechanism, sasl.username, sasl.password, or ssl.* settings. Effective default is plaintext. No enforcement or guidance for callers to add TLS/SASL.
HIGHsrc/consumer.rs:51
Same plaintext-only ClientConfig for the consumer. No TLS/SASL configured.
HIGHsrc/replication.rs:255
Replication consumer also missing security.protocol โ€” cross-cluster replication would transmit all ODS events in cleartext.
MEDIUMsrc/consumer.rs:51
enable.auto.commit=true is hardcoded and not exposed via ConsumerConfig. This enforces at-most-once delivery: consumer crash after Kafka commits offset but before event processing silently drops the event. Audit-critical events (auth, billing) may be lost.
MEDIUMsrc/replication.rs:256
Same enable.auto.commit=true hardcoded in replication consumer. Cross-cluster event replication is vulnerable to silent event loss on crash.
โ€“
A07 ยท Cross-Site Scripting
N/A

Library crate โ€” no HTML rendering, templates, or browser-facing output.

!
A08 ยท Insecure Deserialization
WARN
MEDIUMsrc/consumer.rs:78
serde_json::from_slice::<CloudEvent>(payload) deserializes raw Kafka message bytes with no prior size check. A malformed or deliberately oversized message could trigger excessive memory allocation before deserialization fails. No max_payload_bytes guard is configured.
!
A09 ยท Known Vulnerabilities
WARN
MEDIUMCargo.toml
cargo-audit is not installed on this machine. Cannot verify known CVEs for: rdkafka 0.36, tokio 1.x, chrono 0.4, serde_json 1.x, uuid 1.x. Manual inspection shows no obviously insecure pinned versions, but automated verification is required before any release.
!
A10 ยท Insufficient Logging
WARN
LOWsrc/alerting.rs
No tracing instrumentation. Alert generation, threshold evaluation, and webhook dispatch errors are not logged. No audit trail for alert actions.
LOWsrc/event.rs
CloudEvent construction and validate() failures are returned as errors but never logged. Failed event creation is invisible in production traces.
LOWsrc/ (all files)
Zero usage of tracing::error!. All error paths propagate as Result::Err without being recorded in telemetry. Errors in production will only be visible if callers log at error level โ€” no guarantee.
Cargo Audit
โš  cargo-audit not available on this machine

Cannot scan for known CVEs in: rdkafka 0.36, tokio 1.x, chrono 0.4, serde_json 1.x, futures-util 0.3, thiserror 2.x, uuid 1.x, tracing 0.1. Install and run before release:

cargo install cargo-audit && cargo audit
Secrets Scan
โœ“ No hardcoded secrets detected in source code.

Note: WebhookConfig.headers is a runtime secret container โ€” flagged under A03. Not a static secret in source.

Unsafe Code
โœ“ Zero unsafe blocks found in production source.
Recommended Actions
P1
Add TLS/SASL support to ClientConfig (A06 โ€” HIGH x3) Expose security_protocol, sasl_mechanism, sasl_username, sasl_password in ProducerConfig, ConsumerConfig, and replication config. Apply them in ClientConfig::new() when provided. Default to plaintext for dev only.
P1
Install cargo-audit and run in CI (A09 โ€” MEDIUM) Add cargo install cargo-audit && cargo audit --deny warnings to the GitHub Actions workflow. Block merge on any advisory with severity โ‰ฅ high.
P2
Make enable.auto.commit configurable (A06 โ€” MEDIUM x2) Expose enable_auto_commit: bool in ConsumerConfig (default false for at-least-once). Document delivery guarantee semantics. Apply the same fix to the replication consumer.
P2
Add payload size guard in consumer (A08 โ€” MEDIUM) Before calling serde_json::from_slice, check payload.len() <= MAX_PAYLOAD_BYTES (recommended: 1 MB). Return EventError::Consume and log a warning if exceeded.
P2
Scrub WebhookConfig from serialization logs (A03 โ€” MEDIUM) Add #[serde(skip_serializing)] to WebhookConfig.headers, or implement a custom Debug that masks the values. Document that callers must not log the config object.
P3
Add *.pem and *.key to .gitignore (A03 โ€” MEDIUM) Append *.pem, *.key, *.crt, *.p12 to .gitignore as a precaution against accidental certificate commits.
P3
Add tracing::error! to error paths (A10 โ€” LOW x3) Instrument alerting.rs, event.rs, and all consumer/producer error paths with tracing::error! so failures appear in production traces without requiring callers to handle logging.