17 Commits

Author SHA1 Message Date
b12f7da0d3 feat: add client_headers field - ordered list of client header names
Add a new JSON field 'client_headers' containing all HTTP header names
received from the client (r->headers_in), in original order and with
original case preserved. Useful for browser/bot fingerprinting since
header order is client-specific.

Example: "client_headers":["Host","User-Agent","Accept"]

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 16:17:07 +01:00
98e413be68 config: extend default headers list and raise max to 25
- CONFIG: Add Sec-CH-UA, Sec-CH-UA-Mobile, Sec-CH-UA-Platform,
  Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site, Accept,
  Accept-Language, Accept-Encoding to default JsonSockLogHeaders
- CONFIG: Raise DEFAULT_MAX_HEADERS from 10 to 25
- DOC: Update architecture.yml value_example and conf/mod_reqin_log.conf

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 15:14:28 +01:00
643557a2e7 fix: skip subrequests and internal redirects in post_read_request
- FIX: Guard post_read_request hook with r->main and r->prev checks to
  avoid logging duplicate lines for subrequests and internal redirects
- DOC: Document subrequest/redirect filtering in architecture.yml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 15:11:56 +01:00
54d210978f fix: timestamp uses r->request_time; remove unparsed_uri, fragment from architecture
- FIX: timestamp JSON field now uses r->request_time (set at request reception
  by Apache) instead of apr_time_now() called during log processing
- DOC: remove unparsed_uri and fragment fields from architecture.yml data model
  (these fields are not logged by the module)
- DOC: update example_full and timestamp description in architecture.yml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 14:42:00 +01:00
e606e7760f CHANGE: Replace req_id with query and fragment fields
- Remove req_id field (r->log_id) from JSON output
- Add query field (r->parsed_uri.query) - query string without '?'
- Add fragment field (r->parsed_uri.fragment) - fragment without '#'
- Update architecture.yml documentation
- Bump version to 1.0.9

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 21:07:22 +01:00
8a8ee8c6b1 FEATURE: Add missing JSON fields and fix socket type per architecture.yml
- Add req_id, scheme, unparsed_uri, args, keepalives, content_length fields
- Change socket type from SOCK_STREAM to SOCK_DGRAM
- Update architecture.yml documentation with new fields
- Bump version to 1.0.8 with changelog entry

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 20:59:38 +01:00
c61774f8ec 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>
2026-03-01 02:14:31 +01:00
3e9ff25033 conf: change default socket path to /var/run/logcorrelator/http.sock
- Update mod_reqin_log.conf example configuration
- Update README.md documentation and examples
- Update architecture.yml specification
- Update test_config_parsing.c test case

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:49:39 +01:00
08a6c72897 docs: add author information to architecture.yml
- Add author name: Jacquin Antoine
- Add author email: rpm@arkel.fr

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:06:36 +01:00
e3ea1fb486 docs: update README and architecture for RPM-only packaging
- Remove DEB and el7 references (RPM only: el8, el9, el10)
- Remove Python integration tests from documentation (not automated in CI)
- Add file inventory in architecture.yml (source, packaging, tests)
- Update CI verify jobs to check RPM metadata with rpm -qi
- Organize RPM packages by distribution in dist/rpm/{el8,el9,el10}/
- Add security and RPM packaging features to README
- Split Requirements into Runtime and Packaging sections

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:29:51 +01:00
c2e1221e5a release: version 1.0.2 - Audit security fixes and RPM packaging
Security hardening:
- Add input sanitization for method (32), path (2048), host (256), http_version (16)
- Prevent log injection via oversized HTTP values
- Add LOG_THROTTLED macro for consistent error reporting
- Improve socket state double-check pattern to avoid unnecessary reconnects

Code quality:
- Fix const qualifier warnings in get_header()
- Add flags field to module definition
- Add -Wno-error=format-security for compatibility

Documentation:
- Clarify timestamp precision (microseconds expressed as nanoseconds)
- Update README and architecture.yml

Testing:
- Add 4 unit tests for input sanitization
- All 78 tests passing

Packaging:
- Remove DEB package support (RPM only: el8, el9, el10)
- Add CHANGELOG file included in RPM packages
- Bump version to 1.0.2

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 21:45:06 +01:00
d0ca0a7e4c fix: correction bugs + tests + migration el7 vers el10
Correctifs de bugs critiques:
- Overflow entier dans le calcul du timestamp (nanoseconds)
- Validation des composantes temporelles dans format_iso8601
- Race condition mutex: échec dur pour MPM threadés (worker/event)
- Rejet des espaces en tête dans parse_int_strict

Nouveaux tests unitaires (38 ajoutés):
- Overflow timestamp, limites ISO8601, format fixe 20 chars
- Limite de taille JSON 64KB
- Détection headers sensibles (blacklist)
- Validation parse_int_strict
- dynbuf NULL handling et strlen mode

Migration packaging:
- Suppression CentOS 7 (EOL)
- Ajout AlmaLinux 10 (el10)
- RPMs supportés: el8, el9, el10

Mise à jour CI/CD et documentation:
- .gitlab-ci.yml: jobs verify pour el8/el9/el10
- architecture.yml: OS supportés à jour
- 70/70 tests pass

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 21:02:05 +01:00
a935ed1641 ci: migrate to GitLab CI with multi-distribution RPM builds
- Replace GitHub Actions with GitLab CI using Docker-in-Docker
- Build 3 RPMs (el7, el8, el9) + 1 DEB from Dockerfile.package
- Add verify jobs for each target distribution
- Remove obsolete files:
  - Dockerfile, Dockerfile.test-socket (replaced by Dockerfile.package)
  - scripts/socket_consumer.py, scripts/socket_listener.py
  - scripts/test_unix_socket.sh, scripts/run_integration_tests.sh
- Update README.md with new package targets
- Update architecture.yml for GitLab CI workflow

Breaks: Single RPM no longer supported (glibc incompatibility)
Replaced by: Distribution-specific RPMs (el7, el8, el9)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 16:06:57 +01:00
395635ab36 docs: update architecture.yml with unified packaging section
- Update CI package stage to use Dockerfile.package with fpm
- Replace rpmbuild and debhelper with unified fpm approach
- Document multi-stage build pipeline (builder, package_builder, output)
- Add file mappings, dependencies, and verification commands

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 15:41:29 +01:00
b5d093f8cb Docs: update security documentation and hardening notes
architecture.yml:
- Update header_handling: document built-in sensitive headers blacklist
- Expand security section with hardening measures
- Add socket permissions, path recommendations, environment variable

README.md:
- Add new 'Built-in Sensitive Headers Blacklist' section
- Document all blocked headers (Authorization, Cookie, X-Api-Key, etc.)
- Update socket security: permissions 0o660, /var/run path, group membership
- Add hardening features: path validation, JSON size limit, NULL checks, mutex
- Fix JSON example (remove extra closing brace)
- Update socket consumer example with secure permissions (0o660)
- Add MOD_REQIN_LOG_SOCKET environment variable to example
- Update Fields table: header_<Name> flat structure description
- Add note about automatic sensitive header exclusion

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 23:41:51 +01:00
070c2a7bd2 Refactor: thread-safe per-process state and add tests
Major changes:
- Move child state from global variable to server config (reqin_log_server_conf_t)
- Add reqin_log_create_server_conf() for proper per-server initialization
- Fix thread safety for worker/event MPMs
- Add cmocka unit tests (test_module_real.c)
- Add Python integration tests (test_integration.py)
- Update CI workflow and Dockerfiles for test execution
- Fix: Remove child_exit hook (not in architecture.yml)

Tests:
- Unit tests: JSON escaping, ISO8601 formatting, header truncation
- Integration tests: basic_logging, header_limits, socket_unavailable, socket_loss

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 23:28:45 +01:00
66549acf5c Initial commit: mod_reqin_log Apache module
Features:
- JSON logging of HTTP requests to Unix domain socket
- Configurable HTTP headers logging (flat JSON structure)
- Header value truncation and count limits
- Automatic reconnect on socket disconnection
- Error reporting with throttling

Configuration directives:
- JsonSockLogEnabled: Enable/disable logging
- JsonSockLogSocket: Unix socket path
- JsonSockLogHeaders: List of headers to log
- JsonSockLogMaxHeaders: Maximum headers to log
- JsonSockLogMaxHeaderValueLen: Max header value length
- JsonSockLogReconnectInterval: Reconnect delay
- JsonSockLogErrorReportInterval: Error log throttle

Includes:
- Module source code (src/)
- Unit and integration tests (tests/, scripts/)
- Documentation (README.md, architecture.yml)
- Build configuration (CMakeLists.txt, Makefile)
- Packaging (deb/rpm)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 13:55:07 +01:00