2543 Commits

Author SHA1 Message Date
dc36db742a openssl: Add support to split tls commands by semicolon
- Add support to split tls commands by semicolon.
- Changed one test with multiple tls commands to use semicolon as
  seperator instead of newline.

closes: https://github.com/rsyslog/rsyslog/issues/4852
2022-08-02 12:58:03 +02:00
Rainer Gerhards
087f304897
Merge pull request #4937 from rgerhards/imptcp-slight-tuning
imptcp: slight tuning
2022-07-21 15:22:44 +02:00
Rainer Gerhards
f052717178 imptcp: slight tuning
- reduce indirect addressing to obtain more speed
- also a fix for an annoying typo
- minor other optimizations
- modernization of one test
2022-07-15 15:46:27 +02:00
Rainer Gerhards
050a611fa2
CI: suppress TSAN false positive
Close of fd previously added to an epoll set is ok.
2022-07-15 10:14:33 +02:00
Rainer Gerhards
90feae08e6
omfile: support for zstd compression
The zstd library provides better and faster compression than zlib.
This patch integrates zstd as a dynamically-loadable functionality.
As such, no further dependencies need to be added to the rsyslog
base package.

Due to the increased performance, usage of zstd is highly recommended
for high-volume use cases.

This patch also refactor zlib compression in order to unify handling
in both compression cases.
2022-07-13 14:31:51 +02:00
Rainer Gerhards
36392e745d
CI: add new TSAN suppression
This is a cosmetic issue, only seen during debug logging. We actually
cannot fix it, as it would alter runtime behaviour too much and would
pontentially render debug runs useless. It also causes no harm.
2022-07-13 12:14:51 +02:00
Sergio Arroutbi
318449ad3a Add mechanism to include extra CA files parameter
This change allows to include extra CA files
so that no "unable to get issuer certificates" issue
is obtained when using chained cert files.
Proposed new parameter name is "NetstreamDriverCAExtraFiles"

fixes #4851

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2022-07-13 11:12:29 +02:00
Rainer Gerhards
6ef5e826d7
CI: suppress TSAN exception for known-good case
We do not use a mutex an epd, but we do always access it in
pure sequence. Adding a mutex just to cover this "cosmetic"
would result in uncesseary performance penalty.
2022-07-06 10:30:44 +02:00
Rainer Gerhards
829a6f6a64
CI: improve use of github action matrix feature; optimization
Matrix feature was initially barely usable because github did not permit
to restart just failed jobs. This has changed. So we now migrate back to
the use of matrix feature where it is useful.

We also reduce the number of plain compile tests to newest and oldest
compiler version only. This saves CI ressources. The important other
ones (distro default!) are used during other CI tests anyways.

We also fix some minor coding errors detected by new compiler builds.
None of them seems to be related to any real issues.
2022-07-01 10:12:38 +02:00
Rainer Gerhards
e92f85b588
build error fix: libbson requires out-of-date language constructs 2022-06-27 17:44:28 +02:00
Jakub Kulík
ee3f88ffe4 Import <strings.h> when index() is used. 2022-06-15 16:49:24 +02:00
Rainer Gerhards
18e3505b62 omelasticsearch: some amendments to contributed patch
We disable ElasticSearch strict security in testbench, as
we do not need it for test runs, and it complicates thing.s
Note: this does NOT introduce a security weakness, because we use
only temporary testing ES instances which are always immediately
discarded after the test AND are run in our own test env with
user permissions.
2022-05-19 13:17:18 +02:00
Jarkko Oranen
d47b5c9b1c omelastisearch: allow omitting _type field
Allow omitting the _type field by setting it to an empty string.

Setting this field has been deprecated since 6.0, and support will
be removed in 8.0

Also add testbench test for empty searchType with ES 7.0

This checks for messages in the deprecation log and also provides
avoids deprecation messages from usage of transport.tcp.port in the
test configuration
2022-05-19 13:17:05 +02:00
Rainer Gerhards
d1a98b8260
tcpsrv/imtcp: slight performance improvements
This patch slightly improves performance for tcpsrv-based servers.
This affects imtcp and imgssapi as well as some helpers.

No other functional change is included in this patch.
2022-05-18 10:08:47 +02:00
Rainer Gerhards
b564a13451
testbench bugfix: some valgrind tests were run when valgrind disabled
This leads to test failures e.g. with LLVM sanitizers.
2022-05-09 13:06:59 +02:00
Rainer Gerhards
f211042ecb
Merge pull request from GHSA-ggw7-xr6h-mmr8
net bugfix: potential buffer overrun
2022-05-05 14:04:42 +02:00
c49180abdd testbench: removed unused notworking tls tests
Testcase sndrcv_tls_certless_ossl_client.sh was not finished
and was not used by testbench. Newer tests replaced its test usage.
See testcases sndrcv_tls_gtls_serveranon*.sh and
sndrcv_tls_ossl_serveranon*.sh

closes: https://github.com/rsyslog/rsyslog/issues/4853
2022-05-02 13:43:06 +02:00
Rainer Gerhards
03ba122e90
mmanon bugfix: shortened IPv6 form not always anonymized
If the IPv6 is in non-recommended form followed by a 5 digit port number, it
is not anonymized.

A reproducer for this is: 1a00:c820:1180:c84c::ad3f:d991:ec2e:49255

closes https://github.com/rsyslog/rsyslog/issues/4856
2022-04-25 18:00:01 +02:00
Rainer Gerhards
30ccf7cd4c
testbench: new tests for potential buffer overrun 2022-04-25 10:25:17 +02:00
Rainer Gerhards
aaf3ffd364
cleanup: remove file accidentally added to git 2022-04-22 10:45:20 +02:00
Rainer Gerhards
88c67d80e4
Merge pull request #4822 from sarroutbi/maxfilesize_non_empty_errorfile
Ensure error file does not increase appropriately when action.errorfile.maxsize option is enabled
2022-04-18 11:02:38 +02:00
Rainer Gerhards
33b7ccc928
Merge pull request #4823 from alorbach/pr-issue-4818
gnutls bugfix: Fix error handling in gtlsRecordRecv
2022-04-18 11:01:35 +02:00
Art O Cathain
a5ba462da8 Fixed a broken link in the PR failure message 2022-04-05 14:05:47 +01:00
aefcfa4d0f gnutls bugfix: Fix error handling in gtlsRecordRecv
There was a rare possibility that the E_AGAIN/E_INTERRUPT handling
could cause an infinite loop (100% CPU Usage), for example when a TLS
handshake is interrupted at a certain stage.

- After gnutls_record_recv is called, and E_AGAIN/E_INTERRUPT error
  occurs, we need to do additional read/write direction handling
  with gnutls_record_get_direction.
- After the second call of gnutls_record_recv (Expand buffer)
  we needed to also check the eror codes for E_AGAIN/E_INTERRUPT
  to do propper errorhandling.
- Add extra debug output based on ossl driver.
- Potential fix for 100% CPU Loop Receiveloop after gtlsRecordRecv
  in doRetry call.

see also: https://github.com/rsyslog/rsyslog/issues/4818
2022-04-04 16:38:07 +02:00
Rainer Gerhards
6c16d84237
Merge pull request #4758 from mbarbon/mbarbon/format-iso-week
add property options to support ISO week/year number
2022-04-01 12:57:31 +02:00
Sergio Arroutbi
5734b5853a Ensure errorfile max. size correct handling
When action.errorfile.maxsize configuration
option is enabled and error file already has a
certain size smaller than max size configured,
it is increasing higher than configured max
size as the error file is considered
to be zero in code.
This fix reads current error file size and
limits the size to the maximum size configured

fixes #4821

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2022-04-01 11:17:46 +02:00
Rainer Gerhards
71b81626ef
testbench: add tests for rscript comparison operations 2022-03-31 10:16:27 +02:00
Rainer Gerhards
2387c248f3
testbench: change git access protocol to cover github change
github disabled anon access via git protocol, so we need to adjust
this to https

no functional change
2022-03-28 10:11:42 +02:00
Rainer Gerhards
b0435d5e89
Merge pull request #4791 from Cropi/dynamic-config-queue
Make the main message queue part of the config
2022-03-16 12:48:22 +01:00
Sergio Arroutbi
f64ef442d5 Add option to limit error file to configured size
action.errorfile.maxsize has been added to enable
option to limit the amount of bytes dumped to
configured errorfile

fixes #4733

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2022-03-03 14:13:25 +01:00
alakatos
452b62b4a4 Make the main message queue part of the config 2022-03-01 09:56:39 +01:00
Michael Biebl
6569133c75
Typo fixes (#4801)
* typo fix: ambigious -> ambiguous

* typo fix: aquire -> acquire

* typo fix: assgined -> assigned

* typo fix: cancelation -> cancellation

* typo fix: childs -> children

* typo fix: configuraton -> configuration

* typo fix: delemiter -> delimiter

* typo fix: forwardig -> forwarding

* typo fix: initializiation -> initialization

* typo fix: intializing -> initializing

* typo fix: lengh -> length

* typo fix: mesage -> message

* typo fix: occured -> occurred

* typo fix: occurence -> occurrence

* typo fix: paramter -> parameter

* typo fix: remaing -> remaining

* typo fix: resetted -> reset

* typo fix: suppored -> supported

* typo fix: Sytem -> System

* typo fix: uncommited -> uncommitted

* typo fix: depricated -> deprecated

* typo fix: stoping -> stopping

* type fix: allow to -> allow one to
2022-02-17 10:54:12 +01:00
Masahiro Matsuya
46c79edc53 imfile: Remove inotify watch descriptor on inode change detected 2022-02-09 16:36:24 +09:00
Rainer Gerhards
f4a7733a96
Merge pull request #4762 from inahga/inahga-ompgsql-conninfo
ompgsql: allow connection params via connection string
2022-02-08 12:27:25 +01:00
Rainer Gerhards
94b467b3ee
Merge pull request #4690 from rgerhards/es7-test
testbench: restore original order of ES test execution
2022-02-04 17:54:33 +01:00
Rainer Gerhards
1a403f987b
testbench: restore original order of ES test execution
The order of execution was changed to a less optimal (more startups,
thus slower) order to work-around a testbench issue. This has been
fixed and so we can restore the original order.
2022-02-04 16:18:22 +01:00
Rainer Gerhards
df166eaa1d
Merge pull request #4793 from rgerhards/i4770-tests
testbench: test cases for rscript comparisons
2022-02-04 15:56:00 +01:00
Rainer Gerhards
439b7ec0c0
Merge pull request #4786 from alorbach/pr-issue-4784
testbench: adapt contentcheck for tlscommands tests
2022-02-04 15:55:43 +01:00
Rainer Gerhards
7836d298b5
testbench: test cases for rscript comparisons
This covers failure cases from practice which were not yet covered.

see also: https://github.com/rsyslog/rsyslog/issues/4770
2022-02-04 14:57:17 +01:00
504cc9fba3 omelasticsearch: Fix indexSuccess impstats counter in bulkmode
When bulkmode is enabled, and a batch was processed without any
failures (errors is false), the code that increments the indexSuccess
impstats counter was never reached. As fix, we obtain the numitems
first and add them to the indexSuccess impstats counter if
errors is false.

This fix may solve some of the random elasticsearch testbench failures.

closes: https://github.com/rsyslog/rsyslog/issues/4794
2022-02-03 15:57:56 +01:00
9428a9f666 testbench: adapt contentcheck for tlscommands tests
Under io / cpu stress, the OpenSSL tls error can be SSL_ERROR_SYSCALL
instead of SSL_ERROR_SSL. The outcome it the same from the
test perspective.

closes: https://github.com/rsyslog/rsyslog/issues/4784
2022-01-26 17:04:59 +01:00
Ameer Ghani
e98e691ad8
ompgsql: allow connection params via connection string
Happy new years! Add another action parameter `conninfo` that allows specifying
a postgres connection string. This enables us to use any of the postgres connection
parameters, particularly `sslmode` and `sslrootcert`.

Per the postgres docs, this connection string can be a URI or several key-value
pairs. https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

Here's an example:
```
module(load="ompgsql")

action(
	type="ompgsql"
	conninfo="postgresql://postgres:password@localhost/Syslog?sslmode=require"
)
```

This addresses https://github.com/rsyslog/rsyslog/issues/4741 by allowing the
user to specify ssl options as part of the connection string. `libpq` will take
care of the rest.

This also addresses https://github.com/rsyslog/rsyslog/issues/4698 because
`libpq` is not constrained by MAXHOSTNAMELEN. Long hostnames will work.

`conninfo` can be specified in lieu of the other parameters. `ompgsql` will
prioritize using `conninfo` to connect over the other parameters.

Signed-off-by: Ameer Ghani <inahga@gmail.com>
2022-01-17 15:09:43 -06:00
87e3a90d29
testbench: adjust ElasticSearch startup parameters
Newer versions seem to require some new defaults. Maybe this also
helps with some hard-to-explain flakiness in ES test runs.
2022-01-17 15:51:10 +01:00
d0b88c748c omhttp: Fix memory leak in lokirest batchmode
A JSON object was created (valueObj) but not used and also not
released causing a memory leak. This was properly caused by the
initial copy&paste from serializeBatchKafkaRest.

- Also added a valgrind test for lokirest batchmode
  Uncomment "--keep-debuginfo" in testcaseif stack traces
  are incomplete

closes: https://github.com/rsyslog/rsyslog/issues/4766
2022-01-05 22:03:00 +01:00
Mattia Barbon
a11ad1a451 add property options to support ISO week/year number 2021-12-28 10:35:59 +01:00
Rainer Gerhards
4fea318bcd
Merge pull request #4743 from Cropi/ratelimit-fix
Avoid use of loadConf in favor of runConf in ratelimiting during runtime
2021-12-14 13:25:12 +01:00
Rainer Gerhards
ba9c77c3f7
testbench: do not use valgrind --keep-debuginfo=yes by default
This option is not known by older valgrind versions. As such, it causes
false positives on older platforms. As the option is not necessary
(only helpful for some border cases), we remove it and add a comment
so that it may be enabled when necessary.
2021-12-13 10:01:25 +01:00
alakatos
ab99d68009 Use runConf instead of loadConf in ratelimiting during runtime 2021-12-08 19:36:48 +01:00
8fce4ad965 testbench: Add --keep-debuginfo=yes to default valgrind parameters.
This maintains a full stack trace, otherwise can be incomplete in some
cases!
2021-11-24 09:27:20 +01:00
Rainer Gerhards
03aa23a038
Merge pull request #4728 from VultureProject/faup_upstream
NEW CONTRIB::FFAUP:: URL parser module function using libfaup
2021-11-22 09:03:44 +01:00