2718 Commits

Author SHA1 Message Date
Rainer Gerhards
8d384b9f89
Merge pull request #5302 from n2yen/dev-omhttp-patches
omhttp patches and updates
2024-04-02 11:55:27 +02:00
Rainer Gerhards
de1e294bfc
Merge pull request #5338 from rgerhards/i5337
testbench bugfix: testbench tarball did not include a test script
2024-03-28 11:38:22 +01:00
Rainer Gerhards
cefc15f000
Merge pull request #5341 from VultureProject/mmdblookup_fix
MMDBLOOKUP::FIXED:: Don't suspend action on incompatible IP lookups
2024-03-28 11:35:54 +01:00
Théo Bertin
313d6922b2 MMDBLOOKUP::FIXED:: Don't suspend action on incompatible IP lookups
Mmdblookup module used to suspend after erroring on an IPv6 IP lookup on IPv4-only DBs
This commit replaces the suspension of the module by a simple log message, allowing it to keep working for future lookups
2024-02-28 10:51:26 +01:00
Rainer Gerhards
39fce095f3
testbench bugfix: testbench tarball did not include a test script
Thanks to Michael Biebl for alerting us.

closes https://github.com/rsyslog/rsyslog/issues/5337
2024-02-27 17:20:24 +01:00
Rainer Gerhards
f2f9332f07
Merge pull request #5280 from alorbach/pr-issue-5211
Initial implementation of imdtls and omdtls modules
2024-02-26 09:15:25 +01:00
679b0b038c Initial implementation of imdtls and omdtls modules
- Extracted basic OpenSSL helper functions into own module net_ossl.h/net_ossl.c
  Both are compiled into lmnsd_ossl.
- Cleanup of OpenSSL code, fixed minor compiler and linking issues.
- Added DTLS Sender option DTLS into tcpflood for testbench.
- Add initial implementation of imdtls input module. Added to configure and makefile
- Add initial implementation of omdtls output module. Added to configure and makefile
- Add multiple basic tests for imdtls receiving data by using tcpflood.
- Add multiple send-receive test for imdtls and omdtls based on existing tls tests.
- Add timeout and sessionbreak tests for imdtls stress testing.

closes: https://github.com/rsyslog/rsyslog/issues/5211
2024-02-23 13:44:05 +01:00
Nelson Yen
a67af36914
WIP - omhttp patches and updates 2023-12-30 19:38:25 -08:00
Rainer Gerhards
1f864ec519
testbench: make omusrmsg-noabort test more reliable
The previous test did not always detect an abort of rsyslog/omusrmsg.
The detection method has now been improved, so it is far more
probable that an abort is detected.

While doing this, we noticed that the omusrmsg-noabort-legacy test was
now a 100% duplicate. There is no need any longer to check pure legacy
syntax, and so that test has been removed.

We also added a valgrind-based test ofr omusrmsg-noabort, which furthers
strengthens bug detection. Most importantly, it helps us to detect
potentially new memory leaks on all CI platforms (in case the lib
behaves differently depending on os/distro).

see also https://github.com/rsyslog/rsyslog/issues/5294
2023-12-14 14:43:23 +01:00
Rainer Gerhards
311d7c0b54
Merge pull request #5274 from rgerhards/nitfix
testbench: fix "typo" in test case
2023-12-08 17:24:24 +01:00
Rainer Gerhards
d25d9e48bd
Merge pull request #5270 from alorbach/pr-issue-5269
omazureeventhubs: Corrected handling of transport closed failures
2023-12-06 12:46:07 +01:00
Rainer Gerhards
84539a71a6
maintain ChangeLog 2023-11-24 13:18:46 +01:00
Rainer Gerhards
a1b6097e0d
testbench: fix "typo" in test case
executed more code than intended
2023-11-10 12:50:30 +01:00
193fc7bc34 omazureeventhubs: Corrected handling of transport closed failures
- Added test for connection interrupts (requires root)
- Corrected handling of PN_TRANSPORT_CLOSED.
- Make sure Connection is being reestablished trough tryResume
- Enhanced Debug log output

closes: https://github.com/rsyslog/rsyslog/issues/5269
2023-11-09 14:19:03 +01:00
Rainer Gerhards
de5069c26c
TLS subsystem: add remote hostname to error reporting
This provides richer and easier to process logs for error and warning
cases. One goal is to enable automatic operations without the need
to consolidate multiple message to a single information.

This improves one situation in gtls driver and provides a more
generic approach in ossl driver for OpenSSL error reporting.

There is probably still room for improvement, however this patch
is at least a good starting point for further work. Please
provide feedback if you need more!

closes https://github.com/rsyslog/rsyslog/issues/5244
2023-10-25 16:00:03 +02:00
Rainer Gerhards
24442dddb1
testbench: bump zookeeper version to match current offering
Older version can no longer be downloaded. It also makes sense to
test with mainstream version.
2023-10-20 16:10:18 +02:00
Rainer Gerhards
c8a2969580
tcpflood bugfix: plain tcp send error not properly reported
The error code when plain tcp sending failed was improperly returned,
resulting in no meaningful error message.

Note: tcpflood is a testbench tool, not part of production rsyslog.
2023-09-13 09:33:40 +02:00
Rainer Gerhards
edf5c6908a
Merge pull request #5209 from rgerhards/testbench-imfile-state-file-dir2
testbench: cleanup and improve some more imfile tests
2023-08-02 16:56:04 +02:00
Rainer Gerhards
d6adb68bce
testbench: cleanup and improve some more imfile tests
Added state files to make tests more robust in parallel test
execution. Fixed some slightly out of order setup statements.
Cleaned up some noise.
2023-08-02 15:03:46 +02:00
Rainer Gerhards
b6b4f25eda
lookup tables bugfix: reload on HUP did not work when backgrounded
Lookup tables were only reloaded on HUP if the -n option was given
and rsyslog no backgrounded. This patch fixes the issue.

closes: https://github.com/rsyslog/rsyslog/issues/4813
2023-08-02 15:01:31 +02:00
Rainer Gerhards
37de8f66a4
testbench: make test more reliable
There was a race between tcpflood and rsyslog in imptpc_maxsessions.sh.
We now use the new -A tcpflood option to make the timing more
predictable, hopefully fixing test flakiness.

Note: if that does not help, we need to introduce a wait on the number
of error messages and maybe a delay before tcpflood termination. The
theory behind the latter is that rsyslog possibly does not fully
iniaitlize session which are quickly aborted before rsyslog receives
the related OS notification! We just record this info in case we
need it and are positive that this change will fix the situation.
2023-07-28 18:44:22 +02:00
Rainer Gerhards
bf58c35e58
tcpflood: add -A option to NOT abort when sending fails
Note: tcpflood is a testbench tool, not meant for production use

We add the -A option. If set, it does NOT abort tcpflood if
sending messages fails.

This is required for some tests which test connection closes.
If tcpflood terminates quickly before rsyslog could fully
initializes all sessions, the expected error message count is
not necessarily reached, which results in flakes. When tcpflood
contines to run, rsyslog has sufficient time (at least a race
is far less likely).
2023-07-28 18:44:22 +02:00
Rainer Gerhards
27e1da29b3
Merge pull request #5204 from rgerhards/fix-5050249a1e
tcpflood: fix today's programming error
2023-07-28 18:43:44 +02:00
Rainer Gerhards
4455f63f6b
tcpflood: fix today's programming error
In commit 5050249a1e tcpflood was "fixed" to work properly when senden
data to a TCP stream socket. Unfortunately, there was an undetected
copy&past problem, which this commit corrects.

The issue did unfortunatley not surfcase with the previous commit as
the situation where this can happen occurs infrequently and randomly
(has to do with timing on the system in question). So the original PR
went fine, but later PRs brought the issue up.

This is not a real regression, as the original fix was for the same
symptom, but with different cause. Now everything should indeed be
fixed.

NOTE: same day correction on a testbench tool
2023-07-28 16:57:18 +02:00
8d8fe80d87 openssl: Replaced depreceated method SSLv23_method with TLS_method
In OpenSSL 1.1.0 and higher, SSLv23_method causes some errors
in TLS handshake from time to time. As this method is depreceated
since 1.1.0, I have replaced it with the follow up method
TLS_method which is the most generic one.

It fixes the random test failures in tests like
- sndrcv_tls_ossl_anon_rebind.sh

Also added some debug output in OpenSSL error handling, which is
useful when analysing debug files.

closes: ./sndrcv_tls_ossl_anon_rebind.sh
2023-07-28 16:27:07 +02:00
Rainer Gerhards
ee69c29beb
Merge pull request #5196 from rgerhards/testbench-imfile-statefiles
testbench improvement: define state file directories for imfile tests
2023-07-28 16:00:44 +02:00
Rainer Gerhards
a9b8c57443
Merge pull request #5197 from rgerhards/tcpflood-fix-tcp-sending
tcpflood bugfix: TCP sending was not implemented properly
2023-07-28 14:31:42 +02:00
Rainer Gerhards
11933498f9
testbench improvement: define state file directories for imfile tests
Not all imfile tests have state file directories or a global working
directory defined. This results in usage of the default location.
While state file names should be sufficiently different, there is still
some riks of using the same name in different tests. That becomes
problematic if tests are run in parallel (and they are run in
parallel inside the regular CI).
2023-07-28 14:30:56 +02:00
Rainer Gerhards
f34eee3a82
Merge pull request #5199 from rgerhards/testbench-sndrcv-cleanup
testbench: cleanup a test and some nitfixes to it
2023-07-28 14:26:57 +02:00
Rainer Gerhards
68a9014b6c
testbench: cleanup a test and some nitfixes to it 2023-07-28 10:27:27 +02:00
Rainer Gerhards
5050249a1e
tcpflood bugfix: TCP sending was not implemented properly
Note: tcpflood is a testbench tool. This bug could lead to testbench
false positives. No way it can affect production deployments.

The tcpflood tool did improperly assume that a TCP sendto() call
would send messages of any size in a single shot. This is not the
case. It has now been corrected to proper behavior.

As a side-activity, some int variables which acutally needed to be
size_t have been fixed as well.
2023-07-28 09:08:41 +02:00
Rainer Gerhards
0e5444706d
testbench: make waiting for HUP processing more reliable
The previous approach was more or less delay based. We have now
changed the code to enable imdiag to detect if HUP is underway
and wait until it is completed. The new method still employs some
kind of timeout, but is now quite reliable. Most importantly,
it works great with long-running HUP processing, which can happen
e.g. when querying the system name takes long or some actions need
longer time to persist their HUP processing.

The new approach will most likely reduce CI flakes and also speed
up testbench runs. The speedup happens from not having to wait a
full delay in cases where we detect HUP is completed (plus reduced
timeout when we cannot clearly detect this - see code comments why
the new method is still considered more reliable than the old one).

Code note: we needed to slightly re-structure the way actual HUP
processing and the "HUP mutex" is handled. After best analysis,
this does not affect the reliability or speed in production
settings.

closes https://github.com/rsyslog/rsyslog/issues/5192
2023-07-26 17:17:01 +02:00
Rainer Gerhards
e08e5ec72f
CI: update zookeper download to newer version
Old version is no longer available.
2023-07-25 16:07:59 +02:00
a9aa043a82 ossl driver: Using newer INIT API for OpenSSL 1.1+ Versions
See reference from: https://wiki.openssl.org/index.php/Library_Initialization

closes: https://github.com/rsyslog/rsyslog/issues/4981
2023-07-11 10:57:15 +02:00
45c8d47696 ossl: Fix CRL File Expire from 1 day to 100 years.
The default in openssl.cnf was set to 1 day (Which is valid for
live systems). However for testbench we do not need an expired CRL
List, so changing it to 100 years is fine for the testbench.

This fixes issues with testcases added in PR
https://github.com/rsyslog/rsyslog/pull/5175

closes: https://github.com/rsyslog/rsyslog/issues/5180
2023-07-11 09:56:29 +02:00
Rainer Gerhards
8f6845e000
Merge pull request #5175 from darrenmoffat/master
TLS CRL Support Issue 5081
2023-07-07 13:21:44 +02:00
Rainer Gerhards
d4ac70e48a
Merge pull request #4881 from alorbach/omazureeventhubs
omazureeventhubs: Initial implementation of new output module
2023-07-07 13:17:23 +02:00
6c83bffb6a PR5175: Add TLS CRL Support for GnuTLS driver and OpenSSL 1.0.2+
- Add TLS CRL support tp GnuTLS driver using gnutls_certificate_set_x509_crl_file.
- Add code in OpenSSL driver that works with OpenSSL 1.0.2 and higher.
  Disable feature on older features with error message.
- Some cosmetic changes
- testbench: Add revoked certificate for testing (Including CRL PEM and other files)
- testbench: Add testcase for gtls and ossl testing revoked certificates
2023-07-07 08:02:05 +02:00
d5ce3daa3f omazureeventhubs: Initial implementation of new output module
The output module uses Apache "Qpid Proton C API" which is a solid
AMQP protocol library implementation that can be integrated
very well into the rsyslog dev environment.

- Implemented Delivery with submitted and accepted state checking
- impstatscounter used in testcases
- saving of failed messages in a failed list with support of saving
  and restoring.
- Add testcases (requires ENV variables) to testbench
- Using application/octect-stream (binary) to send messages based on
  Microsoft Code Sample:
  https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-c-getstarted-send
  * Note original Microsoft Samplecode is not working anymore, we are using
  * QPID Proton Proactor based on
    https://github.com/apache/qpid-proton/blob/main/c/examples/send.c
- requires QPID-PROTON Version 0.13 or higher because of the proactor API
- Add EventProperties configuration parameters
- using internal array instead of linkedlist for better performance
- using single byte helper to store message status (ubsubmit/submitted...)
- trigger wake up if messages need to be resubmitted (rejected)
- Slow down when sender credit reaches zero (10ns).
- Add enhanced performance stress test omazureeventhubs-stress.sh
- Add support for static library linking of qpid-proton
  This is needed to build the module from source and remove
  library package dependencies.
- adjusted valgrind suppressions
2023-07-06 23:40:20 +02:00
Rainer Gerhards
102e492182
testbench: use newer zookeeper version in tests 2023-06-22 15:34:03 +02:00
Rainer Gerhards
fa83b5b4bd
Merge pull request #5143 from VultureProject/redis_streams
New Redis streams functionality + various fixes and improvements
2023-06-19 10:22:00 +02:00
Rainer Gerhards
66dfa396da
Merge pull request #5141 from paulfertser/fix-mmexternal-test-typo
tests: mmexternal-SegFault-empty-jroot-vg.sh: fix typo
2023-06-19 10:18:24 +02:00
alakatos
4abe60f526 imjournal: Add FileCreateMode module parameter
FileCreateMode allows to set the default file mode bits
when creating new files. As of now, it has only impact on the state file.
Add test suite as well.

Minor indentation fix in run_journal.yml
2023-06-08 12:18:02 +02:00
Rainer Gerhards
e1ad71da39
Merge pull request #5012 from sakateka/fix-external-dir-fd-leaking
imfile: Fix leak of fd of external directories
2023-06-06 15:00:28 +02:00
Paul Fertser
7a63ac8481 Fix quoting for omprog, improg, mmexternal
This changes the current behaviour from honouring the double quotes in
any part of the argument but leaving them in place and passing to the
executed binary to requiring quotes exactly at the beginning and at the
end of a multi-word argument, and not including them in the actual call.

Testcases added to ensure the expected results.

Fixes #4249.
2023-05-26 10:48:02 +03:00
frikilax
ca4e320c3a OMHIREDIS::ADDED:: New support for 'stream' mode
### ADDED
- [OMHIREDIS] module is now able to insert entries to a Redis Stream
- [OMHIREDIS] in 'stream' mode, module can insert the message to a custom field in the entry ('msg' by default)
- [OMHIREDIS] in 'stream' mode, module can acknowledge an entry coming from imhiredis (if entry was claimed but not ACK'ed)
- [OMHIREDIS] in 'stream' mode, acknowledgements can be made from dynamic templates or static values
- [OMHIREDIS] in 'stream' mode, module can approximately cap the size of the output stream
- [OMHIREDIS] in 'stream' mode, module can delete an entry while inserting its message (useful to remove entry coming from another stream with imhiredis)
- [OMHIREDIS] new tests for 'stream' mode
 ### FIXED
- [CONFIGURE.AC] Missing line to give omhiredis compilation status
2023-05-23 11:01:03 +02:00
frikilax
4fa296727c OMHIREDIS::ADDED:: new tests for existing functionalities 2023-05-23 11:01:03 +02:00
frikilax
3ac9fa5267 IMHIREDIS::ADDED:: New support for 'stream' mode
- [IMHIREDIS] Add support for simple XREADs from Redis Streams (Redis >= 5.0 required)
- [IMHIREDIS] Add support for XREADGROUP from Redis Streams, allowing for user to define workers to dequeue logs in a stream
- [IMHIREDIS] stream mode can select fields to extract and insert in custom keys
- [IMHIREDIS] Add tests for the new 'stream' modes
2023-05-23 10:58:40 +02:00
frikilax
4ef42fde7a REDIS::ADDED:: Implement tests for imhiredis module
- changed diag.sh to be able to start/stop/clean a redis server
- added helper functions in diag.sh to be able to query a redis server instance
- added new tests for imhiredis module to check
  - that the queue mode works, with both lpop and rpop
  - that the module is capable of handling a redis server going down
  - that the module is capable of handling a redis server that appears afterwards
  - that the subscribe mode works
2023-05-17 12:02:22 +02:00
Paul Fertser
086358c61b tests: mmexternal-SegFault-empty-jroot-vg.sh: fix typo
Fix the typo that makes the test fail.
2023-05-17 08:08:10 +03:00