Skip to content

Add Zabbix agent rules - #15128

Open
israel-villar wants to merge 3 commits into
ComplianceAsCode:masterfrom
israel-villar:feat/zabbix-agent-rules
Open

israel-villar wants to merge 3 commits into
ComplianceAsCode:masterfrom
israel-villar:feat/zabbix-agent-rules

Conversation

@israel-villar

Copy link
Copy Markdown
Contributor

Description:

  • Adds a new zabbix rule group under linux_os/guide/services/zabbix/ with three rules: package_zabbix_agent_installed and service_zabbix_agent_enabled (both using existing templates), and zabbix_agent_server_configured (custom OVAL check verifying Server/ServerActive are set in zabbix_agentd.conf and not left at the packaged 127.0.0.1 default). Adds the zabbix component.

Rationale:

  • Zabbix is a widely used open-source network monitoring solution; the project already carries SELinux booleans referencing it (sebool_httpd_can_connect_zabbix, sebool_zabbix_can_network) but had no rules covering the monitoring agent itself. zabbix_agent_server_configured ships without remediation since the correct monitoring server address is site-specific.

Review Hints:

  • No product profile selects these rules yet; this PR only adds the rule definitions and component. Verified with a clean ./build_product --datastream-only debian13.
  • Key files: linux_os/guide/services/zabbix/*/rule.yml, linux_os/guide/services/zabbix/zabbix_agent_server_configured/oval/shared.xml, components/zabbix.yml.
  • Single commit, straightforward to review as a whole.

israel-villar and others added 2 commits September 16, 2026 21:55
Zabbix is a widely used open-source network monitoring solution; the
project already has SELinux booleans referencing it
(sebool_httpd_can_connect_zabbix, sebool_zabbix_can_network) but no
rules covering the monitoring agent itself.

Adds a new zabbix service group with three rules:

- package_zabbix_agent_installed and service_zabbix_agent_enabled
  (from templates).
- zabbix_agent_server_configured: check-only, verifies Server and
  ServerActive are set in zabbix_agentd.conf and not left at the
  packaged 127.0.0.1 default. No remediation is shipped, since the
  correct monitoring server address is site-specific.

Adds the zabbix component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
zabbix_agent_server_configured has custom OVAL (not template-based),
so it isn't covered by any template's built-in test suite. Adds 5
scenarios covering the AND of the four OVAL criteria: both directives
configured (pass), both left at the packaged default, either directive
missing entirely, and either directive individually left at default
while the other is configured (fail).

Verified with Automatus against the debian13 test container: all 5
scenarios evaluate as expected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown

Hi @israel-villar. Thanks for your PR.

I'm waiting for a ComplianceAsCode 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

Details

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.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Sep 16, 2026
@macko1

macko1 commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Hello @israel-villar, thanks for the submission.

In order to consider this for a review, and to review this properly, please provide exact official Zabbix documentation sources for the decisions you made when creating these rules.

Also please provide full documentation (comments) into the test benches you provided (expected results)

Thanks.

Comment thread components/zabbix.yml
@@ -0,0 +1,7 @@
name: zabbix

@macko1 macko1 Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Refer to #15128 (comment) please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

▎ Thanks for the review, @macko1. Here are the exact official Zabbix sources for the decisions in this PR:

▎ Server / ServerActive directive names and semantics — Zabbix agent (UNIX) configuration parameter reference:
https://www.zabbix.com/documentation/current/en/manual/appendix/config/zabbix_agentd
▎ This confirms Server governs passive checks (mandatory unless StartAgents=0) and ServerActive governs active checks, which is why the check requires both to be set.

▎ The 127.0.0.1 "packaged default" — the official upstream Zabbix source repository ships zabbix_agentd.conf with these two directives uncommented and set to 127.0.0.1:
https://github.com/zabbix/zabbix/blob/master/conf/zabbix_agentd.conf#L132-L200
▎ (see ### Option: Server and ### Option: ServerActive — the parameter reference page itself documents no default, but this reference template is the file that ships as-is in the zabbix-agent package, which is why an unmodified install ends up with both directives pointing at 127.0.0.1.)

▎ Passive vs. active checks concept, explaining why both directives are relevant to a correctly-configured agent:
https://www.zabbix.com/documentation/current/en/manual/concepts/agent

▎ I've also pushed a commit adding expected-result comments to each test scenario per your second request (587f3a8).

Add a comment to each Automatus test scenario explaining what it
exercises and the expected pass/fail outcome, as requested in review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@macko1 macko1 self-assigned this Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants