Skip to content

Commit fc09913

Browse files
authored
Add TLS support for Syslog TCP Server (openobserve#6956)
Features: - Setup TLS server using tcp as the transport - API endpoint for certificate download: `GET /api/syslog-tcp-server-ca-cert`, `GET /api/syslog-tcp-server-cert` The corresponding documentation updates are listed in this PR: openobserve/openobserve-docs#67 Issue addressed: openobserve#6956
1 parent 340d18b commit fc09913

File tree

41 files changed

+4056
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4056
-259
lines changed

Cargo.lock

Lines changed: 137 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,14 @@ actix-service = "2.0.3"
188188
actix-utils = "3.0.1"
189189
derive_more = { version = "2.0.1", features = ["full"] }
190190
brotli = "8.0.1"
191+
tokio-rustls = "0.26.1"
191192

192193
[dev-dependencies]
193194
async-walkdir.workspace = true
194195
expect-test.workspace = true
195196
base64 = "0.22"
196197
float-cmp = "0.10"
198+
rcgen = "0.13"
197199

198200
[workspace]
199201
members = [
@@ -339,6 +341,7 @@ tempfile = "3"
339341
thiserror = "1.0"
340342
time = "0.3"
341343
tokio = { version = "1", features = ["full"] }
344+
tokio-rustls = "0.26"
342345
tokio-util = { version = "0.7.12", features = ["compat"] }
343346
tokio-stream = "0.1"
344347
tonic = { version = "0.12.3", features = ["gzip", "prost", "tls"] }

coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _cov_test() {
2929
cargo llvm-cov test \
3030
--workspace \
3131
--verbose \
32-
--ignore-filename-regex job \
32+
--ignore-filename-regex 'job|.*generated.*' \
3333
"$@"
3434
}
3535

src/common/utils/auth_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,6 +3268,7 @@ mod tests {
32683268
file_download_priority_queue_window_secs: Default::default(),
32693269
file_download_enable_priority_queue: Default::default(),
32703270
histogram_enabled: Default::default(),
3271+
calculate_stats_step_limit: Default::default(),
32713272
},
32723273
compact: config::Compact {
32733274
enabled: bool::default(),

src/common/utils/redirect_response.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ impl RedirectResponse {
5959
.append_header((LOCATION, redirect_uri))
6060
.finish()
6161
} else {
62+
// if the URL is too long, we send the original URL and let FE handle the redirect.
6263
let html = format!(
6364
r#"
6465
<!DOCTYPE html>

src/config/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ tracing-subscriber.workspace = true
7676
urlencoding.workspace = true
7777
utoipa.workspace = true
7878
vrl.workspace = true
79+
rustls = "0.23.20"
7980

8081
[dev-dependencies]
8182
expect-test.workspace = true

src/config/src/config.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@ pub struct TCP {
659659
pub tcp_port: u16,
660660
#[env_config(name = "ZO_UDP_PORT", default = 5514)]
661661
pub udp_port: u16,
662+
#[env_config(name = "ZO_TCP_TLS_ENABLED", default = false)]
663+
pub tcp_tls_enabled: bool,
664+
#[env_config(name = "ZO_TCP_TLS_CERT_PATH", default = "")]
665+
pub tcp_tls_cert_path: String,
666+
#[env_config(name = "ZO_TCP_TLS_KEY_PATH", default = "")]
667+
pub tcp_tls_key_path: String,
668+
#[env_config(name = "ZO_TCP_TLS_CA_CERT_PATH", default = "")]
669+
pub tcp_tls_ca_cert_path: String,
662670
}
663671

664672
#[derive(EnvConfig)]

0 commit comments

Comments
 (0)