19082 Commits

Author SHA1 Message Date
Ulrike Gerhards
2f62e6e76b rainerscript: warn on excessive random range
random() emitted a warning only to debug output when its maximum
exceeded RAND_MAX. Log the message to normal output as well so that
operators see the misconfiguration without enabling debugging.
Add a regression test verifying that both debug and standard logs
contain the warning.

AI-Agent: ChatGPT
2025-08-28 10:33:29 +02:00
Rainer Gerhards
f964060204
Merge pull request #6043 from rsyslog/alert-autofix-44
Potential fix for code scanning alert no. 44: Commented-out code
2025-08-28 10:30:56 +02:00
Rainer Gerhards
3e73fb69fd
Merge pull request #6044 from UGerhards/codex/fix-typos-in-documentation-files
Codex/fix typos in documentation files
2025-08-28 10:02:05 +02:00
Ulrike Gerhards
b82f1dcbfd doc: note AI authorship\n\nAI-Agent: ChatGPT 2025-08-28 09:33:45 +02:00
Rainer Gerhards
25a633afb4
Merge pull request #5994 from anis-bougrine/add-namespace-support-for-omjournal
Add namespace support for omjournal
2025-08-28 08:31:07 +02:00
Rainer Gerhards
49bfcad1bd
Potential fix for code scanning alert no. 44: Commented-out code
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-08-27 21:59:26 +02:00
Rainer Gerhards
3cdfdea244
Merge pull request #6041 from kevinbackhouse/actions-codeql
Add actions analysis
2025-08-27 21:34:10 +02:00
Rainer Gerhards
ee19477e91
Merge pull request #6040 from rgerhards/doc_build-action
CI: fix doc_build check which was not always built
2025-08-27 21:23:54 +02:00
Kevin Backhouse
525c424f8d
Add actions analysis 2025-08-27 17:59:04 +01:00
Rainer Gerhards
77819a7066
Merge pull request #6039 from rgerhards/codeql
codeql: fix "master" branch reference
2025-08-27 18:34:19 +02:00
Rainer Gerhards
ec8884ba79
CI: fix doc_build check which was not always built
Too shallow fetch from github made trigger condition unreliable.
2025-08-27 18:31:48 +02:00
Rainer Gerhards
02f7685455
codeql: fix "master" branch reference 2025-08-27 18:14:22 +02:00
Ulrike Gerhards
a76cf54036 doc: fix assorted typos across documentation 2025-08-27 17:56:33 +02:00
Rainer Gerhards
9927889112
CI: fix permission in github action 2025-08-27 17:08:49 +02:00
Rainer Gerhards
186e243bd2
debug version of welcome script 2025-08-27 16:54:54 +02:00
Rainer Gerhards
1142cf8947
community: some fixes to "welcome" helper action
Unfortuantely, this can only be seen in action once merged to main.
2025-08-27 15:58:20 +02:00
Rainer Gerhards
c50a262c7a
Merge pull request #6038 from rgerhards/ci-actions-auto-cancel2
CI: cancel hughe task automatically on all runners on re-push
2025-08-27 14:32:10 +02:00
Rainer Gerhards
d2742add4e
CI: cancel hughe task automatically on all runners on re-push
Saves ressources, gives faster follow-up build, save labor for
manual cancel.
2025-08-27 14:29:51 +02:00
Rainer Gerhards
5c5be0cbba
improve PR welcome message handling (#6037) 2025-08-27 14:24:27 +02:00
Rainer Gerhards
4b46d33ad7
improve PR welcome message handling 2025-08-27 14:23:06 +02:00
Madhushree
8f4df7a334
docs: fix minor typos in docs/source (#6028)
- fixed typos, corrected small text issues, and adjusted minor wording in messageparser.rst and multi_ruleset.rst.
- removing second 'be' & changing the verb form from activate to activates.

Only updates to documentation files (.rst, .md, .txt) for minor fixes. No source code or runtime behavior is affected.
2025-08-27 14:12:14 +02:00
Rainer Gerhards
c3c2bac6c4
CI: fix welcome message activation mode to make it really work (#6036)
* CI: fix welcome message activation mode to make it really work

We need to run the repo-provided script to have sufficient acces rights.
Otherwise, it will not work with PRs from forked repos (which is the
norm).

Plus some robustness amendments.

* Update .github/workflows/contributor-welcome.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 13:00:33 +02:00
Naisthecreator
d835987604
docs: fix typo ('begin' -> 'beginning') in developer documentation (#6029) 2025-08-27 11:23:50 +02:00
Rainer Gerhards
d081d89604
community: add welcome message to first few commits (#6032)
intent is two-fold:
- act welcoming and provide some guidance for PR contributors
- do a bit of checking so maintainer get's an idea if this might
  be a spammy account (the world is a bad place...). Also
  prevent rsyslog from being used for social engineering other
  repos.

This method will be improved in the future and is work in progress.

Note: rsyslog welcomes small PRs, even single typo fixes, when
they are useful to the project. We shall, however, reject frequent
single typo fixes from same account and ask them to combine the
commits. Reason is this might be a social engineering tactic to
make rsyslog itself or other repos build unrooted trust in the
account.
2025-08-27 09:25:17 +02:00
Rainer Gerhards
69fc7033f3
docs: add rsyslog issue assistant build files (#6026)
* docs: add rsyslog issue assistant build files

Add README and prompt used to build the external Issue Assistant that
drives rsyslog issue assistant which creates great and  AI-friendly
GitHub issues. This improves triage readiness and contributor experience
without touching runtime code. The assistant itself is free via the
ChatGPT store and will be linked from documentation and other entry points.

Note that the use of the assistant directly benenfits rsyslog AI First
ecosystem which ensures high quality AI code generation support.

Before: repository had no assistant build inputs.
After: versioned prompt and README are present; assistant is distributed
externally.

Technical details:
- Add ai/rsyslog_issue_assistant/{README.md,base_prompt.txt}.
- Prompt yields ASCII-only JSON metadata plus a Markdown body aligned
  with rsyslog templates; selects type, proposes repo, and adds minimal
  labels (always includes needs-triage).
- Heuristics default to rsyslog/rsyslog; librelp is chosen when clearly
  indicated by the report.
- No runtime, module, ABI, or testbench changes; docs-only assets.
- README points to a web helper page to be linked from CONTRIBUTING.md.


Co-authored-by: gemini-code-assist[bot]
2025-08-26 15:10:48 +02:00
Rainer Gerhards
8f5d492d17
Merge pull request #6022 from rgerhards/CODE_OF_CONDUCT
doc: add code of conduct
2025-08-26 13:16:41 +02:00
Rainer Gerhards
c378c953bc
Update README.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-26 12:39:39 +02:00
Rainer Gerhards
4e0fd3131b
Update README.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-26 12:39:32 +02:00
Rainer Gerhards
28427f87fa
doc: add code of conduct
We want to ensure our community is always welcoming and
acts professionally.
2025-08-26 12:11:51 +02:00
Rainer Gerhards
01c2fc1acc
dev doc: mention "good first issue" dashboard
also tell explicitely that we accept AI generated patches
2025-08-26 11:56:44 +02:00
Rainer Gerhards
0c87fb4057
prepare for next scheduled stable release cycle 2025-08-26 11:45:08 +02:00
Rainer Gerhards
408e1b98ce
fix: doc/ not in tarball (in progress) 2025-08-26 10:21:00 +02:00
Rainer Gerhards
813460390f
prepare for daily stable 8.2508.0 release 2025-08-25 17:10:56 +02:00
Rainer Gerhards
4a88a77ea1
Merge pull request #6010 from rgerhards/tcpsrc-clean2
tcpsrv refactor: use more common variable name for loop control (warmup)
2025-08-25 17:05:32 +02:00
Rainer Gerhards
19c218460e
Merge pull request #5978 from rsyslog/codex/investigate-csl-subtree-with-omfwd-issue
template: fix missing lenStr in subtree templates
2025-08-25 16:54:57 +02:00
Rainer Gerhards
975a87193b
maintain ChangeLog 2025-08-25 16:49:37 +02:00
Rainer Gerhards
de8dbc849e
Merge pull request #5971 from rgerhards/omsendertrack-final
omsendertrack: fix "template" parameter after PoC phase
2025-08-25 16:47:09 +02:00
Rainer Gerhards
3c4827a60c
tcpsrv: refactor IO loop; rearm-before-unlock; poll path
Improve maintainability and robustness of the TCP server by clarifying
locking/ownership, tightening invariants, and simplifying queueing.
Also fix a long-standing pragma macro typo across the tree.

Impact: Internal behavior only. EPOLL re-arm now occurs while holding
pSess->mut; starvation cap counts only successful reads.

Before/After:
Before: EPOLL re-arm happened after leaving the critical section; read
starvation cap counted loop iterations; closeSess() sometimes unlocked;
select_* helpers used on non-epoll path; enqueueWork() returned status.
After: EPOLLONESHOT is re-armed before unlocking; starvation cap counts
only RS_RET_OK reads; closeSess() never unlocks; poll_* helpers replace
select_*; enqueueWork() is void (best-effort).

Technical details:
- Replace notifyReArm() with rearmIoEvent() (EPOLL_CTL_MOD with
  EPOLLONESHOT|EPOLLET; asserts efd/sock; logs on failure).
- doReceive(): explicit state machine; would-block path re-arms before
  unlock; close path unlocks then calls closeSess(); starvation handoff
  enqueues without re-arming.
- Initialize ioDirection for listener and session descriptors; add
  assert(sock >= 0) and widespread ATTR_NONNULL annotations.
- startWrkrPool(): single finalize rollback (cancel/join partial
  threads; destroy cond/mutex); stopWrkrPool(): destroy cond/mutex.
- enqueueWork(): FIFO append under lock and cond signal; returns void.
- Cleanup hardening on construct failure: free ppLstn, ppLstnPort,
  ppioDescrPtr; free fromHostIP on SessAccept() error.
- Non-epoll: rename select_Add/Poll/IsReady -> poll_*; RunPoll() uses
  poll_* and sets sane ioDirection defaults.
- Typo fix: standardize PRAGMA_IGNORE_Wswitch_enum in header and all
  users (action.c, rainerscript.c, template.c, tcpsrv.c).
2025-08-25 15:57:42 +02:00
Rainer Gerhards
4c086ed78c
omsendertrack: stop towards full completion of module.
Work towards full completion of the module’s interface as it exits PoC.
The new name senderid (formerly: template) matches intent (identify a
sender, not an output format) and avoids confusion.  Also make state
persistence safer via atomic writes.

Merged a bit pre-completion in order to get a static analyzer fix
into the main code base. Some additional cleanup PR will follow.
State is much cleaner now than in PoC.

Impact: Configs must use senderid=; statefile is now required. Tests
and docs updated.

Before/After: action(... template="name") -> action(... senderid="name").

Technical details:
- Replace the config parameter and instance field; drop legacy template
  parsing in parseSelectorAct. The module now reads only senderid=.
- Enforce required statefile (descriptor + runtime) and cache a temp
  path "<statefile>.tmp" to ensure rename() is atomic. Provide a
  one-time fallback build if the cache is missing (e.g., reload flow).
- Add built-in template "StdOmSenderTrack-senderid" yielding
  "%fromhost-ip%" and use it as the default senderid template.
- Improve memory ownership (free cached temp path/default template) and
  keep existing locking/queue semantics unchanged.
- Update tests to use senderid= and prune PoC doc note accordingly.

see also: https://github.com/rsyslog/rsyslog/issues/5599
2025-08-25 15:51:58 +02:00
Cursor Agent
fc8d9bcdfa omhttp: add profile support and revise HTTP retry semantics
This change introduces profile-based configuration for omhttp. Profiles
simplify setup for common backends such as Grafana Loki and Splunk HEC by
applying recommended defaults for batching, paths, formats, and retry codes.
This improves usability and avoids error-prone manual tuning.

Impact: HTTP error handling semantics are changed; retry behavior for
3xx and 4xx differs from previous releases.

Technically, HTTP status handling is refactored: transport errors and 5xx
remain retriable, while 3xx (redirection) and 4xx (client errors) are now
treated as permanent failures (`RS_RET_DATAFAIL`). Retry ruleset logic in
batch mode is clarified: if a retry ruleset is configured, messages are
queued there; otherwise, core retry is used. In single-message mode, core
retry is always used.

The new `profile` parameter applies bundled settings. The `loki` profile
enables batching, lokirest formatting, compression, and a default path of
`loki/api/v1/push`. The `hec:splunk` profile sets HEC-specific defaults
including newline batching and size limits. A new test validates the Loki
profile end-to-end. Documentation typo in imptcp parameter reference is
also fixed.

Refs: https://github.com/rsyslog/rsyslog/issues/5957
Refs: https://github.com/rsyslog/rsyslog/pull/5972
2025-08-25 12:01:40 +02:00
Cursor Agent
582d9d98e9 runtime: fix NetstreamDriverCAExtraFiles parsing
Multiple intermediate CAs were not honored because strtok() modified
the original config value at the first comma. This led to only the
first file being considered. This change preserves the original value
and validates files using a duplicate buffer.

Impact: Users can reliably specify multiple CA intermediates via
NetstreamDriverCAExtraFiles; TLS chains that require intermediates
now validate as expected. Tests added.

Before: parsing mutated the stored string, effectively truncating at
the first comma and ignoring subsequent CA files.

After: we strdup() for validation, leave the original string intact,
and set it only if all files are accessible. Error handling follows
existing RS_RET patterns; temporary buffer is freed on all paths.

Additionally, add a test (OpenSSL backend) that generates a root,
two intermediates, and leaf certs on both client and server. The test
verifies chains with openssl, aligns CN/PermittedPeer, and exercises
a full send/receive path to guard against regressions. Makefile is
updated to include the new test in TESTS and EXTRA_DIST.

Fixes: https://github.com/rsyslog/rsyslog/issues/5207
2025-08-25 11:38:21 +02:00
Rainer Gerhards
5f8ee531a3
Merge pull request #6020 from rgerhards/omfwd-test
testbench: permit more message loss in test
2025-08-24 17:25:43 +02:00
Rainer Gerhards
86d99297f8
testbench: permit more message loss in test
this test loses messages because of tcp unreliability, so this is
expected. We are still investigating ways to improve test performance
even in spite of this problem. As an interim solution against flakes,
we at least temporarily increase permitted loss again.
2025-08-24 15:27:17 +02:00
Rainer Gerhards
275885a279
template: fix missing lenStr in subtree templates
Subtree-type templates failed to set the generated string length.
Modules relying on lenStr, such as omfwd, forwarded empty frames.
Set lenStr to the subtree length and add a regression test.

AI-Agent: ChatGPT
2025-08-24 15:24:36 +02:00
anis
564f9f8ce6 Feature: Add journald namespace feature to omjournal.
Starting from systemd V256, systemd API supports writing to journal
in a specific namespace.
2025-08-24 11:22:31 +02:00
Rainer Gerhards
309a46862a
Merge pull request #6012 from rsyslog/codex/fix-memory-leak-in-imdocker.c
imdocker: free temp buffer after option parse
2025-08-23 17:23:48 +02:00
Rainer Gerhards
930d36acc9
Merge pull request #6011 from rsyslog/codex/fix-memory-leak-in-immark
immark: release configuration strings on unload
2025-08-23 11:25:37 +02:00
Rainer Gerhards
8b5a1617b3 imdocker: free temp buffer after log option parse 2025-08-23 11:24:11 +02:00
Rainer Gerhards
6521000e12 immark: document config cleanup
Explain release of mark message and ruleset strings to prevent leaks on reload.\n\nAI-Agent: ChatGPT
2025-08-23 08:43:19 +02:00
Rainer Gerhards
186cdf3548
Merge pull request #6009 from rsyslog/codex/analyze-and-patch-invalid-pointer-bug
imjournal: initialize instance fields to avoid invalid free
2025-08-22 16:18:27 +02:00