conf: change socket path to /var/run/logcorrelator/http.socket

- Update all documentation and configuration files
- Update test cases

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Jacquin Antoine
2026-03-01 02:14:31 +01:00
parent 395af61497
commit c61774f8ec
5 changed files with 10 additions and 10 deletions

View File

@ -66,7 +66,7 @@ LoadModule reqin_log_module modules/mod_reqin_log.so
JsonSockLogEnabled On
# Unix socket path
JsonSockLogSocket "/var/run/logcorrelator/http.sock"
JsonSockLogSocket "/var/run/logcorrelator/http.socket"
# Headers to log (be careful not to log sensitive data)
JsonSockLogHeaders X-Request-Id X-Trace-Id User-Agent Referer
@ -147,7 +147,7 @@ import socket
import os
import json
SOCKET_PATH = os.environ.get("MOD_REQIN_LOG_SOCKET", "/var/run/logcorrelator/http.sock")
SOCKET_PATH = os.environ.get("MOD_REQIN_LOG_SOCKET", "/var/run/logcorrelator/http.socket")
# Remove existing socket file
if os.path.exists(SOCKET_PATH):
@ -199,7 +199,7 @@ These headers are silently skipped (logged at DEBUG level only).
### Socket Security
- **Socket permissions**: Default to `0o660` (owner and group only)
- **Recommended path**: `/var/run/logcorrelator/http.sock` (not `/tmp`)
- **Recommended path**: `/var/run/logcorrelator/http.socket` (not `/tmp`)
- **Environment variable**: Use `MOD_REQIN_LOG_SOCKET` to configure path
- **Group membership**: Ensure Apache user is in the socket's group
@ -227,7 +227,7 @@ ls -la /usr/lib/apache2/modules/mod_reqin_log.so
### Socket connection failures
```
[mod_reqin_log] Unix socket connect failed: /var/run/logcorrelator/http.sock
[mod_reqin_log] Unix socket connect failed: /var/run/logcorrelator/http.socket
```
- Ensure the socket consumer is running

View File

@ -163,7 +163,7 @@ configuration:
type: string
context: server-config
required_when_enabled: true
example: "/var/run/logcorrelator/http.sock"
example: "/var/run/logcorrelator/http.socket"
description: >
Filesystem path of the Unix domain socket to which JSON log lines
will be written.
@ -294,7 +294,7 @@ constraints:
- Module includes built-in blacklist of sensitive headers to prevent
accidental credential leakage (Authorization, Cookie, X-Api-Key, etc.).
- Socket permissions default to 0o660 (owner+group only) for security.
- Recommended socket path: /var/run/logcorrelator/http.sock (not /tmp).
- Recommended socket path: /var/run/logcorrelator/http.socket (not /tmp).
- Use environment variable MOD_REQIN_LOG_SOCKET to configure socket path.
- Module does not anonymize IPs; data protection is delegated to configuration.
- No requests are rejected due to logging failures.

View File

@ -10,7 +10,7 @@ JsonSockLogEnabled On
# Unix domain socket path for JSON log output
# Important: if JsonSockLogEnabled is On and this directive is missing/empty,
# Apache startup fails due to strict configuration validation.
JsonSockLogSocket "/var/run/logcorrelator/http.sock"
JsonSockLogSocket "/var/run/logcorrelator/http.socket"
# HTTP headers to include in the JSON log
# Warning: Be careful not to log sensitive headers like Authorization, Cookie, etc.

View File

@ -38,7 +38,7 @@ install -m 644 %{_pkgroot}/%{_sysconfdir}/httpd/conf.d/mod_reqin_log.conf %{buil
%changelog
* Sun Mar 01 2026 Developer <dev@example.com> - 1.0.6
- CONF: Change default socket path to /var/run/logcorrelator/http.sock
- CONF: Change default socket path to /var/run/logcorrelator/http.socket
- BUILD: Allow Docker cache for RPM builds (remove --no-cache flag)
* Sun Mar 01 2026 Developer <dev@example.com> - 1.0.4

View File

@ -116,8 +116,8 @@ static void test_parse_enabled_off(void **state)
static void test_parse_socket_path_valid(void **state)
{
(void)state;
const char *result = parse_socket_path("/var/run/logcorrelator/http.sock");
assert_string_equal(result, "/var/run/logcorrelator/http.sock");
const char *result = parse_socket_path("/var/run/logcorrelator/http.socket");
assert_string_equal(result, "/var/run/logcorrelator/http.socket");
}
/* Test: Parse socket path empty */