ComplianceAsCode / ComplianceAsCode/content
audit_log_forwarding_enabled: potential false negative when audit inputRef is not on the first pipeline
- Dominant language
- Shell
- Stars
- 2.8k
- Forks
- 828
- Avg merge
- 3d 8m
- Merged PRs (30d)
- 80
Description
### 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:
```yaml
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.
Contributor guide
Assessment
This issue has not been assessed yet.