Skip to content

Conversation

ashwat287
Copy link
Contributor

Fixes: #4049
Fixes a logic gap where, if auditing was already enabled at startup, the code only set worthCheckingIPTables=true and did not launch setWorthCheckingIPTablesRoutine. Without the routine the flag never changes (never set false after idle, never toggled by NETFILTER_CFG events), so the cached a.latestIPTables path is never used and behavior differs from the “auditing just enabled” case.

Change:

  • After confirming auditing is (or becomes) enabled, always set worthCheckingIPTables=true for the initial scan and always start setWorthCheckingIPTablesRoutine.
  • Leave the non‑auditing fallback path unchanged.

This makes flag state transitions consistent regardless of initial auditStatus.Enabled.

Fixes a logic gap where, if auditing was already enabled at startup, the
code only set worthCheckingIPTables=true and did not launch
setWorthCheckingIPTablesRoutine. Without the routine the flag never
changes (never set false after idle, never toggled by NETFILTER_CFG
events), so the cached a.latestIPTables path is never used and behavior
differs from the “auditing just enabled” case.

Change:
- After confirming auditing is (or becomes) enabled, always set
  worthCheckingIPTables=true for the initial scan and always start
  setWorthCheckingIPTablesRoutine.
- Leave the non‑auditing fallback path unchanged.

This makes flag state transitions consistent regardless of initial
auditStatus.Enabled.

Signed-off-by: ashwat287 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

guestagent: worthCheckingIPTables logic seems incorrect
1 participant