2543 Commits

Author SHA1 Message Date
frikilax
aeaf1160ed NEW CONTRIB::FFAUP:: URL parser module function using libfaup 2021-11-19 09:26:34 +01:00
Rainer Gerhards
2caf936bb5
testbench: modernize some tests
no functional changes
2021-11-18 08:44:28 +01:00
Rainer Gerhards
03518837e5
testbench: add test for mmanon with IPv6 followed by port number
see also https://github.com/rsyslog/rsyslog/issues/4725
2021-11-17 17:13:37 +01:00
Rainer Gerhards
672901845d
mmanon: relax IPv6 detection - improve anonymization
We so far tried to ensure a value is really an IPv6 address, in order
to avoid to mangle with just similar-looking information elements.
However, this lead to misdetection for unusual formats, e.g. when a
port is appended to a numerical IPv6 adress given without braces [].
This has been changed now. In a sense, we now prefer to err on the
side of privacy.

BEHAVIOR CHANGE:
Previously, a suspect value was not anonymized, and thus some other
elements (like some MAC addresses) preserved. Now the opposite is
true, and we anonymize anything that looks close enough to be an
IPv6 address. This improves anonymization.

closes https://github.com/rsyslog/rsyslog/issues/4725
2021-11-17 17:12:03 +01:00
Rainer Gerhards
4b49b94405
testbench: false positive when impstats was not built
Test omfwd_fast_imuxsock failed when impstats was not built. This
has been corrected, test is now only executed when impstats is
present.
2021-10-25 12:39:47 +02:00
Rainer Gerhards
202e10e24c
testbench: add test for legacy permittedPeer statement
This is required to ensure backwards compatibility when doing changes
to the networking subsystem. So far this was not covered by any test.
2021-10-25 09:18:44 +02:00
Michael Biebl
440fd1d51c testbench: skip omfwd_fast_imuxsock.sh if liblogging-stdlog is not available
Fixes #4712
2021-10-20 18:15:27 +02:00
6b3bba9e02 PrivDropToUser: fix abortOnIDResolutionFail handling #2
For new configuration style, security.abortonidresolutionfail was
not checked in rainerscript.

see also: https://github.com/rsyslog/rsyslog/pull/4710
closes: https://github.com/rsyslog/rsyslog/issues/4642
2021-10-13 10:57:22 +02:00
Rainer Gerhards
7b7a538da3
Merge pull request #4710 from alorbach/pr-issue-4642
PrivDropToUser: fix abortOnIDResolutionFail handling
2021-10-13 09:22:01 +02:00
03fdbfda74 PrivDropToUser: fix abortOnIDResolutionFail handling
security.abortonidresolutionfail needs to be loaded glblProcessCnf,
otherwise the setting is ignored in doGetUID / doGetGID.

see also: https://github.com/rsyslog/rsyslog/issues/4642
see also: cbcaf2c7e5
2021-10-12 12:15:15 +02:00
Rainer Gerhards
4a63f8e962
rscript fix: ruleset called async when ruleset had queue.type="direct"
The call rscript statement is able to call a rule set either synchronously or
asynchronously. We did this, because practice showed that both modes
are needed. For various reasons we decided to make async
calls if the ruleset has a queue assigned and sync if not.

To know if a "queue is assigned" we just checked if queue parameters were
given. It was overlookeded the case of someone explicitly specifying a
"direct  queue", aka "no queue". As such, queue="direct" triggered async
calls. That in turn meant that when a write operation to a variable was
made inside that rule set, other rulesets could or could not see the
write. While if was often not seen, this was a data race where the
change could also be seen by the outside.

This is now fixed. No matter if queue.type="direct" is specified or
left out, the call will always by synchronous. Any values written to
variables will also be seen by the "outside world" in later processing
stages.

Note that this has some potential to BREAK EXISTING CONFIGURATIONS.
We deem this acceptable because:

1. this was racy at all, so unexpected behaviour could alwas occur
2. it is actually unlikely that someone used the triggering conditions
   in practice. But we can not outrule this, especially when the
   configuration was auto-generated.

Potential compatibility issues can be solved by defining a small
array-memory queue on the ruleset in question instead of specifying
direct type.

Again, we expect that almost all users will never experience any
problems. If you do, however, please let us know: we may add an
option to re-enable the bug.
2021-10-11 15:07:16 +02:00
Rainer Gerhards
ed512aa18a
Merge pull request #4692 from alorbach/pr-issue-4686
openssl: Correct gnutlsPriorityString (custom ciphers) behaviour
2021-10-11 15:00:24 +02:00
Rainer Gerhards
7c3cf8e26e
Merge pull request #4685 from richm/fix-es-bulk-setting
Fix ElasticSearch Test broken by ES incompatibility
2021-09-24 12:44:17 +02:00
Rich Megginson
942f11b4d7
use correct api for es 6 and later
Special thanks to Radu Gheorghe for his help in adjusting ES 7
config so that test preconditions are still met.
2021-09-24 11:54:56 +02:00
Rainer Gerhards
d2d0254ab2
testbench: disable some clickhouse tests
It looks like the current version of clickhouse does not error out
on some types of errors. So tests need either to be redesigned
or removed.

As such, we temporarily skip them for now.
2021-09-21 13:05:14 +02:00
edc1b186c1 openssl: Correct gnutlsPriorityString (custom ciphers) behaviour
- Only apply default anon ciphers if gnutlsPriorityString is NULL and
  Authentication Mode is set to anon. Otherwise we do not set them
  as they overwrite custom Ciphers.
- Added two tests for custom cipher configuration (anon/certvalid mode).
- Add call for applyGnutlsPriorityString if gnutlsPriorityString changes.
- Merged openssl init code from Connect into osslInitSession

closes: https://github.com/rsyslog/rsyslog/issues/4686
2021-09-21 11:21:14 +02:00
Rainer Gerhards
61ba7f222c testbench: fix kafka URL for downloading components
We now also host kafka downloads on our own infrastructure, so
that they do not "suddenly" disappear (happened in the past).
2021-09-21 10:49:22 +02:00
Rainer Gerhards
6b790d8936
testbench bugfix: no pid file wait on elasticsearch startup
The testbench framework does not properly wait until ES has created
its pid file, which probably means it did basic initializiation.
This can cause test synchronization issues and ultimately failures.
2021-09-21 10:26:55 +02:00
Rich Megginson
5f3bd43951
Fix ElasticSearch Test broken by ES incompatibility
https://github.com/rsyslog/rsyslog/issues/4684
According to https://discuss.elastic.co/t/unknown-setting-thread-pool-bulk-queue-size/180120
The setting `thread_pool.bulk` has been renamed to `thread_pool.write`
"The bulk threadpool was renamed to write in 6.3.0, and support for the legacy bulk name was removed in 7.0.0 133."
2021-09-16 14:15:03 +02:00
Rainer Gerhards
26ee7dc527
testbench: migrate testbench run to ElasticSearch 7
ElasticSearch 7 is now the major version. Replacing old-style
ES with it by default.

also add basic test for ElasticSearch 7.14, to make sure we will
test ES 7 once we move up to next higher version.

Note: ES 5 is no longer beeing tested as it looks outphased.

see also: https://github.com/rsyslog/rsyslog/pull/4566
2021-09-14 09:59:12 +02:00
Nelson Yen
a8b8d6c1f9
imhttp updates - query parameter ingestion & basic auth support
- Basic Authentication support & tests
  * configured via imhttp option "basicAuthFile". This option should be configured
    to point to your htpasswd file generated via a standard htpasswd tool.
  tests:
  * imhttp-post-payload-basic-auth.sh
  * imhttp-post-payload-basic-auth-vg.sh

- Query parameter ingestion capability & tests
  use t `addmetadata` option to inject query parameters into
  metadata for imhttp input.

Signed-off-by: Nelson Yen <nyen@salesforce.com>
2021-09-10 08:38:20 -07:00
9a1f4c0f59 testbench: add testcase for queue discardSeverity (linkedlist)
Testcase omfwd_fast_imuxsock.sh uses imuxsock as input and checks
how the queue engine (linkedlist) handles discarded messages.

see also:
https://github.com/rsyslog/rsyslog/issues/4437

requires PR:
https://github.com/rsyslog/rsyslog/pull/4674
2021-09-09 11:29:54 +02:00
Rainer Gerhards
f30cc42ff1
testbench: bump kafka and zookeeper versions 2021-09-07 14:34:20 +02:00
Rainer Gerhards
9497a99119
Merge pull request #4662 from rgerhards/i4619
testbench: fix privdrop tests under root user
2021-09-07 09:45:39 +02:00
Petr Gajdůšek
d69420a6a1 ratelimit: fix rate limiting for already parsed messages
Rate limiting may not have worked if the considered message had already
been parsed (not having NEEDS_PARSING in msgFlags).

This affects also imuxsock in its default configuration
(useSpecialParser="true" and ratelimit.severity="1")

A test for imuxsock is included which requires
./configure --enable-liblogging-stdlog
2021-08-25 17:33:17 +02:00
Rainer Gerhards
6080121ab7
config: implement script-equavalent for $PrivDrop* statements
closes https://github.com/rsyslog/rsyslog/issues/891
2021-08-23 14:10:16 +02:00
Rainer Gerhards
1fc8a08c6f
testbench: fix privdrop tests under root user
When running under root, the privdrop tests did not properly work. This
patch fixes the issue and skips test where necessary.

This also includes some modernization of the related tests.

closes https://github.com/rsyslog/rsyslog/issues/4619
2021-08-23 09:41:43 +02:00
Rainer Gerhards
0c9b169a64
Merge pull request #4612 from n2yen/dev2-percentile
Percentile module to track percentile metrics via impstats
2021-08-16 08:31:21 +02:00
Rainer Gerhards
0461bacd4f
Merge pull request #4626 from n2yen/dev-ignore-older
imfile add `ignoreolderthanoption`
2021-08-12 10:18:25 +02:00
Nelson Yen
db44a20a25
imfile add ignoreolderthanoption
Submit on behalf of the primary author @yanjunli76

instructs imfile not to ingest a file that has not been modified in the
specified number of seconds.
2021-08-11 08:11:55 -07:00
Rainer Gerhards
a25c01c3d2
Merge pull request #4633 from pearseimperva/pearse/fix-deleteStateOnFileDelete
Fixing the deleteStateOnFileDelete option
2021-08-09 18:52:42 +02:00
Rainer Gerhards
5f6fc91417
Merge pull request #4656 from rgerhards/i4619
testbench: guard tests against unexpected warning messages
2021-08-09 15:05:15 +02:00
Rainer Gerhards
6bba5a7577
testbench: guard tests against unexpected warning messages
Practice has shown that environment-induced error messages may
appear during test runs. For example, incorrect resolver settings
may cause name resolution warnings or errors. These are unrelated
to the test itself.

This patch enables tests that are otherwise unaffected by the faillures
to continue and provide "pass" test result.

see also https://github.com/rsyslog/rsyslog/issues/4619
2021-08-09 10:41:09 +02:00
Rainer Gerhards
38856e6989
Merge pull request #4628 from rgerhards/ci-add-test
CI: add test for imtcp not correctly starting up
2021-08-09 09:29:34 +02:00
pearse
fca8e14d65 fixing the deleteStateOnFileDelete option 2021-08-06 22:25:27 +00:00
Rainer Gerhards
be22ec54ad
CI: add test for imtcp not correctly starting up and a Solaris fix
Test should have been added to commit 3d23c7ac8aea but was forgotten.

This test also showed an issue on Solaris, where NULL values cannot
be used in printf functions. This has also been addressed.

see also: https://github.com/rsyslog/rsyslog/pull/4627
2021-08-06 12:42:58 +02:00
Rainer Gerhards
39e81e133b
omfwd: add capability for action-specific TLS certificate settings
This permits to override the global definitions for TLS certificates
at the action() level.
2021-08-06 09:00:24 +02:00
Rainer Gerhards
13f5dfe2e2
imtcp: permit to use different certificate files per input/action 2021-08-04 10:23:24 +02:00
Nelson Yen
80e4ce1769 mmkubernetes fix for apiserver error handling
submit on behalf of @abwaheed
- Added graceful handling of apiserver errors with unexpected responses,
  i.e., anything other than 200, 404, or 429. Idea is that apiserver
  transient error state will recover. We don't want mmkubernetes to miss
  metadata resolution for containers that don't have cached metadata.
  During these transient error states, mmkubernetes will provide basic
  container file path based resolution of namespace and pod metadata for
  new pods whose metadata is not yet cached. After this error state
  recovers, mmkubernetes is expected to resume its metadata resolution as
  expected.
- Added a unit test case for apiserver return 500 with changes to mock server
-  Fixed existing unit test that was failing due to missing expected results file
-  Added mmkubernetes unit tests to testbench
2021-06-29 18:14:25 -07:00
Rainer Gerhards
cb686e96b8
testbench: simplify test
make easier to understand and less verbose
2021-06-24 14:46:11 +02:00
Rainer Gerhards
b78fdde38a
Merge pull request #4407 from alorbach/pr-issue-4406
testbench: Add testcase for librelp EINPROGRESS issue
2021-06-23 09:36:50 +02:00
Nelson Yen
91a2049877
percentile module to track percentile metrics via impstats
Brief overview:
TO configure tracking percentile metrics in rainerscript:
User would need to define:
  - which percentile to track, such as [p50, p99, etc.]
  - window size - note, this correlates directly with memory usage to
  track the percentiles.

To track a value, user would call built-in function `percentile_observe()` in their configurations to
record an integer value, and percentile metrics would be emitted every
impstats interval.
2021-06-23 00:14:39 -07:00
bda68f999d omhttp: Fix dynrestpath param in batch mode
When batchmode was used, the templates could not be used to
expand dynrestpath. We are now storing the restpath param
within the batch data if we are in batch mode.

- testbench: Added tests for omhttp dynrestpath param
  Testing setting the restpath by template - one with batch mode
  and one without batch mode
- When we are in batch mode, and the restpath value changes, the
  batch is submitted and reinitialized

closes: https://github.com/rsyslog/rsyslog/issues/4567
2021-06-16 11:43:08 +02:00
6e2a79376f testbench: Add testcase for librelp EINPROGRESS issue
closes: https://github.com/rsyslog/rsyslog/issues/4406
See also: https://github.com/rsyslog/librelp/issues/207
2021-06-16 09:40:29 +02:00
Rainer Gerhards
8d48ecf10a
imtcp: add more override config params to input() 2021-05-10 12:30:17 +02:00
Rainer Gerhards
a08591be5d
imtcp: add stream driver parameter to input() configuration
This permits to have different inputs use different stream drivers
and stream driver parameters.

closes https://github.com/rsyslog/rsyslog/issues/3727
2021-05-05 12:57:09 +02:00
Rainer Gerhards
3470728d44
further refactoring of tcpsrv parameter passing
Some further stream-lining and cleanup of paramter passing. This
levels ground for more substantial changes to the imtcp/tcpsrv
interaction.

see also https://github.com/rsyslog/rsyslog/issues/3727#issuecomment-525705318
2021-04-26 09:05:01 +02:00
Rainer Gerhards
39896ca622
config script: add re_match_i() and re_extract_i() functions
This provides case-insensitive regex functionality.

closes https://github.com/rsyslog/rsyslog/issues/4429
2021-04-21 12:23:46 +02:00
Rainer Gerhards
1bf65fdb52
Merge pull request #4542 from VultureProject/mmdblookup_reload
MMDBLOOKUP::Improvement:: allow mmdb to be reloaded on HUP signal
2021-04-19 10:38:26 +02:00
Nelson Yen
af8085fc83
Add built-in function get_property() to access property vars
Provides ability to evaluate a rsyslog variable using dynamically
evaluated parameters.
  1st param is the rsyslog param, 2nd param is a key, can be an array
  index or key string.

Useful for accessing json sub-objects, where a key
needs to be evaluated at runtime. Can be used to access arrays as well.

see tests for examples

remove unnecessary escape char
2021-04-15 11:52:15 -07:00