Skip to content

Conversation

@Arden97
Copy link
Contributor

@Arden97 Arden97 commented Oct 29, 2025

Description:

  • This pull request enhances the OVAL check for rsyslog remote logging configuration to properly detect RainerScript action() statements that span multiple lines
  • The regex pattern rsyslog_remote_loghost_rainer_regex now includes the s flag (dotall mode), which allows the . metacharacter to match newline characters
  • This enables the pattern to match RainerScript action() configurations where parameters are split across multiple lines for readability, which is a common formatting practice in rsyslog configurations
  • Added a new test case remote_configured_rainer_newline.pass.sh that validates detection of multiline RainerScript action configurations

Rationale:

  • The previous regex pattern with only the (?m) (multiline) flag could match patterns where ^ and $ anchors work across lines, but the .* portions could not span newlines

  • Fixes # RHEL-104207

Review Hints:

  • use automatus to verify, that remote_configured_rainer_newline test is passing

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Oct 29, 2025
@openshift-ci
Copy link

openshift-ci bot commented Oct 29, 2025

Hi @Arden97. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Arden97 Arden97 changed the title Add multiline support for RainerScript action detection in rsysslog_remote_loghost rule Add multiline support for RainerScript action detection in rsyslog_remote_loghost rule Oct 29, 2025
@jan-cerny jan-cerny added the bugfix Fixes to reported bugs. label Oct 30, 2025
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine. The automatus test scenarios pass locally for me.

Two things that came to my mind:

  1. Please check if there aren't any other similar rules that would need the same modification. I know that there are multiple rules for rsyslog configuration in the project and they might suffer from the same problem.

  2. Consider creating another test scenario that would create the same configuration file as the example of the configuration file the reporter of the bug provided in the Jira ticket. I think that would be a good regression test.

@jan-cerny jan-cerny added this to the 0.1.79 milestone Oct 30, 2025
@jan-cerny jan-cerny self-assigned this Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes to reported bugs. needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants