Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ template:
# By using the objects filter we ensure we are getting the object to query for its url.
filepath: "{{{ openshift_filtered_path('/apis/observability.openshift.io/v1/namespaces/openshift-logging/clusterlogforwarders', 'try [.items[].spec.outputs[][]|objects|select(.url != null).url] catch []') }}}"
yamlpath: "[:]"
check_existence: any_exist
Copy link
Collaborator

@rhmdnd rhmdnd Oct 22, 2025

Choose a reason for hiding this comment

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

Does this mean the rule will pass if no log forwarding is enabled?

https://github.com/OVALProject/Language/blob/master/docs/oval-common-schema.md#ExistenceEnumeration

Do we want at_least_one_exists here?

Copy link
Member Author

@yuumasato yuumasato Oct 23, 2025

Choose a reason for hiding this comment

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

Does this mean the rule will pass if no log forwarding is enabled?

Yes, 🫠

But at_least_one_exists doesn't work either:
If only AzureMonitor is configured, no ClusterLogForwarder will be returned, and the posture is still PASS.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rhmdnd But If I'm pedantic, this rule is about ensuring that log forwarding uses TLS.
If no logs are forwarded, is it a PASS or FAIL?

There is a rule about enabling log forwarding: https://github.com/ComplianceAsCode/content/blob/master/applications/openshift/api-server/audit_log_forwarding_enabled/rule.yml

Unfortunately it is not automated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

When at_least_one_exists was set and only AzureMonitor is configured, the rule will FAIL.

% oc get ccr -n openshift-compliance| grep audit-log-forwarding-uses-tls
ocp4-stig-audit-log-forwarding-uses-tls                         FAIL     medium
upstream-ocp4-stig-audit-log-forwarding-uses-tls                FAIL     medium
% oc get clusterlogforwarders.observability.openshift.io  clf-71770 -o=jsonpath={.spec.outputs} -n openshift-logging | jq -r
[
  {
    "azureMonitor": {
      "authentication": {
        "sharedKey": {
          "key": "shared_key",
          "secretName": "azure-secret-71770"
        }
      },
      "customerId": "816936a6-c9f8-40f2-bda1-986582acd354",
      "logType": "case71770app_log"
    },
    "name": "azure-app",
    "type": "azureMonitor"
  },
  {
    "azureMonitor": {
      "authentication": {
        "sharedKey": {
          "key": "shared_key",
          "secretName": "azure-secret-71770"
        }
      },
      "customerId": "816936a6-c9f8-40f2-bda1-986582acd354",
      "logType": "case71770infra_log"
    },
    "name": "azure-infra",
    "type": "azureMonitor"
  },
  {
    "azureMonitor": {
      "authentication": {
        "sharedKey": {
          "key": "shared_key",
          "secretName": "azure-secret-71770"
        }
      },
      "customerId": "816936a6-c9f8-40f2-bda1-986582acd354",
      "logType": "case71770audit_log"
    },
    "name": "azure-audit",
    "type": "azureMonitor"
  }
]

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me try one thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should be addressed now, this rule ensures that at least one secure CLF exists.

entity_check: "all"
values:
- value: "^(https|tls)://.*$"
Expand Down
Loading