Skip to content

audit_log_forwarding_enabled: potential false negative when audit inputRef is not on the first pipeline #14910

Description

@mJace

Description

Rule: ocp4-audit-log-forwarding-enabled (applications/openshift/api-server/audit_log_forwarding_enabled)

it appears the check is expected to evaluate every pipeline in every
ClusterLogForwarder object and PASS if audit appears in the inputRefs
of any pipeline.

Suspected issue

In my test cluster, I have a single ClusterLogForwarder object with two
pipelines:

apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
  name: instance
  namespace: openshift-logging
spec:
  pipelines:
  - name: app-logs
    inputRefs:
    - application
    outputRefs:
    - app-sink
  - name: audit-logs
    inputRefs:
    - audit
    outputRefs:
    - siem-sink

Only the second pipeline (audit-logs) references audit in inputRefs.
The first pipeline does not.

Expected behavior

The rule should evaluate to PASS, since at least one pipeline
(audit-logs) forwards audit logs.

Actual behavior

If it evaluates as FAIL, this suggests the underlying OVAL/CEL check may only
be inspecting the first pipeline entry (e.g. .spec.pipelines[0].inputRefs)
rather than iterating over the full pipelines[] array, which would be a
false negative for any CLF object where the audit pipeline is not first in
the list.

After I removed my first pipleline entry, the check passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OpenShiftOpenShift product related.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions