Skip to content

Add Tripwire integrity rules - #15127

Open
israel-villar wants to merge 7 commits into
ComplianceAsCode:masterfrom
israel-villar:feat/tripwire-integrity-rules
Open

israel-villar wants to merge 7 commits into
ComplianceAsCode:masterfrom
israel-villar:feat/tripwire-integrity-rules

Conversation

@israel-villar

Copy link
Copy Markdown
Contributor

Description:

  • Adds a new tripwire rule group under linux_os/guide/system/software/integrity/software-integrity/tripwire/, mirroring the existing aide group, with three rules: package_tripwire_installed (template), tripwire_build_database (check-only, verifies /var/lib/tripwire/*.twd exists), and tripwire_periodic_cron_checking (check-only, verifies a tripwire --check cron entry exists). Adds the tripwire component.

Rationale:

  • Tripwire is a common alternative to AIDE for file and directory integrity checking, but the guide only covered AIDE. tripwire_build_database ships without remediation because tripwire --init requires the site and local passphrases to be entered interactively.

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/system/software/integrity/software-integrity/tripwire/*/rule.yml, the two oval/shared.xml files, components/tripwire.yml.
  • Single commit, straightforward to review as a whole.

israel-villar and others added 6 commits September 16, 2026 21:57
Tripwire is a common alternative to AIDE for file and directory
integrity checking, but the guide only covers AIDE. Adds a tripwire
group mirroring the existing aide group:

- package_tripwire_installed (from template).
- tripwire_build_database: check-only, verifies /var/lib/tripwire/*.twd
  exists; no remediation because tripwire --init requires the site and
  local passphrases to be entered interactively.
- tripwire_periodic_cron_checking: check-only, verifies a
  "tripwire --check" cron entry exists (the Debian package ships
  /etc/cron.daily/tripwire by default).

Adds the tripwire component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…_periodic_cron_checking

Both rules have custom OVAL (not template-based), so they aren't
covered by any template's built-in test suite.

- tripwire_build_database: pass when a *.twd file exists under
  /var/lib/tripwire, fail when none does.
- tripwire_periodic_cron_checking: pass both via the Debian package's
  own /etc/cron.daily/tripwire (verified against the real packaged
  file content, no admin action needed) and via an explicit
  /etc/cron.d entry (covers the OVAL's other OR branch); fail when no
  schedule exists at all.

All scenarios add linux-base to the packages list so the
system_with_kernel platform gate (inherited from the tripwire group,
mirroring aide's) evaluates true in the Docker test container, which
otherwise has no kernel package and would report every scenario as
not applicable.

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

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
packaged_default.pass.sh relied silently on the tripwire package's
post-install state instead of asserting it, which is fragile across
package versions (aide_periodic_cron_checking's own test suite never
relies on implicit package defaults, always writing the expected
content explicitly, even though the AIDE package also installs a
default cron.daily script). Writes the real /etc/cron.daily/tripwire
content directly instead.

Also adds crontab_entry.pass.sh, covering the /etc/crontab method the
rule's own description documents as the explicit alternative to the
packaged default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The /etc/cron.d and /etc/crontab OVAL branches (and their tests) were
speculative flexibility carried over from aide_periodic_cron_checking,
not grounded in how Tripwire is actually scheduled on Debian. A real
Debian 13 host running tripwire confirms the package relies solely on
/etc/cron.daily/tripwire; there is no crontab line or cron.d file for
it.

Drops both branches from the OVAL and the corresponding description/
ocil text, keeping only the /etc/cron.{daily,weekly,hourly} check
(generalized beyond "daily" so an administrator can relocate the
script to a less frequent cron directory). Replaces
cron_d_entry.pass.sh/crontab_entry.pass.sh with cron_weekly.pass.sh,
which exercises that relocation instead of a scenario with no
real-world basis.

Verified with Automatus against the debian13 test container: all 3
remaining scenarios evaluate as expected, and a full
--datastream-only build stays clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Hourly was another untested, speculative option (Tripwire integrity
checks are too heavy for hourly runs, and it isn't part of the rule's
own "at least weekly" rationale). Narrows the OVAL path pattern and
description/ocil text to just /etc/cron.daily (the packaged default)
and /etc/cron.weekly, matching aide_periodic_cron_checking's own
cron.(daily|weekly) pattern.

Verified with Automatus against the debian13 test container: all 3
scenarios evaluate as expected, and a full --datastream-only build
stays clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Leftover from before hourly was dropped from the rule; harmless
(rm -f on a nonexistent path is a no-op) but inconsistent with the
rule's current scope.

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.

@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 Tripwire 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.

@macko1
macko1 self-requested a review September 17, 2026 10:46
Comment thread components/tripwire.yml
@@ -0,0 +1,9 @@
name: tripwire

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 #15127 (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 Tripwire sources for the decisions in this PR:

I've also pushed a commit adding/extending expected-result comments on each test scenario per your second request

Add or extend a comment on 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